AutoCAD Inventor :: VBA Code To Toggle Custom Button Image?
Jun 5, 2013
I have created some custom button in VBA. I wish I can make those buttons toggling their image.
For example my custom button toggles Part/Component priority or Highligt on/off and I would like the button image will change showing the current state.
The background image color change will work too, or the some extra tiny mark on working sceen would be useful if it quite complicated to deal with ribbons.
Generally I need to see the current state at glance.
I'm trying to find a way to add a custom button to my ribbon that will launch a global rule or form using VB. I know of a way using VBA but I want to get away from VBA. I'd much rather create an add with VB and use that.
Is it possible to add a stop or cancel button onto ilogic code?
I have code that looks into all .ipts with a certain material type,that works great but if we run by accident there is no way of stopping code until it finishes .
I have some code that edits the breaklines of a surface. Everything works correctly, except for the surface rebuild when finished.At the end of the command I use:
surf.Rebuild();
But when the command completes I still need to manually rebuild the surface to see the result of my command's edits. This is in both 2013 & 2014. I shouldn't need to do this and was just wondering why the Rebuild() method doesn't always work.
Also, is it possible to toggle the Automatic Rebuild option for surfaces in code?
I'm trying to find a way to trigger an "Add-Ins" button that we have customized, and have it pop up on the closing of a form. If you know a way to program how to close a form through iLogic, or find a way to see if it's still open
I'm not sure that I actually want to access the button per say, but instead launch the dialog box. I'm not sure if this differs your answer in any way, but I searched the customization forum and found little information.
I was looking for some iLogic Code for Inventor 2013 that would cycle through all the parts in an assembly grabbing the quantity of each part and setting it equal to the custom property "Qty" of each part.
Having a little trouble creating the for each loop and setting reference to each part without referencing each part by specific name.
I have a couple of VB pieces of code that set up the standards of my company. What I want to do create a buttom in my Workspace -within a tab created by me with the CUI tools- and trigger my VB code.
How is possible to create this buttom that is connected with my code and displayed in my workspace?
I have a couple of VB pieces of code that set up the standards of my company. What I want to do create a button in my Workspace -within a tab created by me with the CUI tools- and trigger my VB code.
I have been looking for a way to toggle which brush is selected with a custom key but I cant seem to figure out how to do it. Perhaps even better would be to select specific tool presets with custom keys.
I should also note that I am aware of the shortcut action "Select Brush by Index", however it always selects the first brush. Is there a way to change the index number?
I am growing increasinly frustrated. I just installed AutoCAD LT 2013 on my laptop. I managed to get everything customized the way I want, except the button icons on my (classic) toolbar are much too small. If I go into the menu and select 'use large icons', they are too huge. My screen resolution DOES NOT need to be changed or adjusted. I went to the help menu to see what I can do, and found that I can go into CUI and adjust the size of the button icons that way, via the button image editor, however there is no 'button image editor' dialog box when I select any given toolbar command.
Is it possible to code a custom linetype, so that it only follow certain annotation scales (e.g. 1:100, 1:200 1:500) and so that it just appears as a continuous line below and above these certain scales?
The solution should work even when the drawing is used by others and apply to both modelpsace and paperspace (viewport).
I wrote some code in VB .NET 2010 getting started from Kean Walmsley project to create a new layer. I did it working directly from code and not using a command line as he did.
[URL] ...
The problem is that the same code works if I call it directly inside the application code, but doesn't if I throw it from a push button.
I'm searching for quiet a while now, but I can't find information or an example to show an Icon (image) in a button on the shelf for my new tools. The addin should run on 64bit windows.
I found some example wich use vb6 tools, but I don't have these on my win64 and c#.
I am mainly developing for AutoCAD 2013/2014 how to implement a custom property as a drop-down list using OPM and .NET/C# wrapper. I have successfully created categorized custom properties already and can read/save them in XRecords via the OPM. I further implemented the members for IDynamicEnumProperty (using an ObjectARX DLL) in .NET/C# which are:
And I have implemented the GetCurrentValueData() and SetCurrentValueData() members in my .NET/C# wrapper as per the IDynamicProperty2 interface as following:
public void GetCurrentValueData( Object pUnk, ref Object varData ) {AcadObject obj = pUnk as AcadObject; if ( obj != null ){using ( Active .Document.LockDocument( DocumentLockMode.ProtectedAutoWrite, null, null, true ) ){using ( var tr = Active.Transaction ){ObjectId ObjId = new ObjectId( (IntPtr) obj.ObjectID ); DBObject DbObj = tr.GetObject( ObjId, OpenMode.ForRead ); if ( DbObj != null ){try {if ( [code]....
This code compiles without error but instead of the expected drop-down list the OPM only shows a field where I can enter or edit integer numbers, but there is no drop-down list when clicking on the field....
I would like to do something when my paletteset is closed. I took the C# code from here
[URL]
I modified the code to VB.net
Dim WithEvents ps As Autodesk.AutoCAD.Windows.PaletteSet <Autodesk.AutoCAD.Runtime.CommandMethod("psTest")> _ Public Sub PSTest() If ps Is Nothing Then ps = New Autodesk.AutoCAD.Windows.PaletteSet("psTest")
[Code]...
My code crashed. If I catch exception it is eInvalidInput exception. I don't know what to do as it is a simple code segment I don't know hot to fix it.
when I hover the cursor over my own custom toolbar buttons, I get the message "Press F1 for more help" you can then go to F1 but that only for Autocad commands not my own programs. My question is how can I get rid of the message "Press F1 for more help" when the cursor is over my custom program buttons?
Where the proper location to store custom images for new custom materials? We do not use vault and I currently store everything locally. I found where Inventor stores all of the material library images in C:Program Files (x86)Common FilesAutodesk SharedMaterialsTextures. In that "Textures" folder there are Inventor material images stored in folders named "1","2 "and "3". Should I paste my custom image in all three folders, or a completely different location? I need Inventor to find this material and image for every new project so I save it to my library but I do not know where to store the image.
I have a custom toolbar that I've used for years in an olderversion of CAD. Now I'm in 2012 and loaded my custom toolbar in from my previous CUI. Naturally it dropped in all question marks even though I have all paths in the support file added. I even copied all my bitmaps to autodesk's default bitmap location. Neither work.
So after that I went into the CUI and manually selected the bitmap image for "small image" and "large image". It shows in the CUI now, but no luck on the main board. (also, not that this matters, must be a glitch but it won't even show in the CUI until i manually select another bitmap and reselect my origional desired image)
So then I tried taking the whole path and copying it into the CUI manually but it goes right back to defaulting to (MYIMAGENAME.BMP) without keeping the extension. My other custom toolbars loaded with all the pictures but this one just refuses to cooperate.
How to add buttons and create my own ribbon in AutoCAD, but now I would like to be able to have buttons for two different schedules that I have created. While I can have a button start the schedule command it won't automatically pick the schedule that I want it to create.
Part of my project includes a slider that is dynamically given a position. Because this all happens in code, I can't use the timeline tool to change the easing to something like "easeOutBounce."
This seems to follow the jQuery convention but results in the standard easing: