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, that would be helpful to.
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 simply create an iLogic rule with whatever code I want the button to run and add that rule to the form just like you add a parameter or iProperty. If the code you're trying to run is not iLogic, simply have an iLogic rule that contains a line to call up the code you want. (i.e. a rule called "runSomeCode" that contains the line "InventorVB.RunMacro("project", "module", "sub")"
I don't bother with using straight VB, I have visual studio on my PC but haven't found much of a need for it. I do 95% of my coding directly in iLogic and the other 5% in Inventors API.
Don't be intimidated by the coding, it sounds to me like you have more experience with actual coding then me, I just started teaching myself with 0 experience last autumn.
Now that you've explained how to apply a button, I actually remember already creating a button to refresh a drawing. I guess it had just slipped my mind.
Everyone that I have asked always points me in the direction of Inventor's API. The only problem is I don't know what this is or where to find a place to start learning how to access it.
By the sounds of it, I'm assuming that you've found some useful resources in learning how to access the API or code a little deeper than the supplied snippets. Do you think it would be possible to point me in the direction of those resources? I'm fairly quick at picking things up once I have a starting point and some samples. After that there has to be a way to program the first dimenion of a set, or lone dimension to always be offset a certain distance from a view. This could be based off of the leader length or text location of the dimension in my theory.
When you're in Inventor, press alt+F11. This takes you to the Inventor API editor. This uses Microsoft's VBA (Visual Basic for Applications) language and should be very familiar if you do any Excel programming or, if not, there's tons of great information you can google up by searching for VBA help. From here you can access additional offline help files and, more importantly, the Inventor object browser by pressing F2. The object browser can help you understand the iLogic hierarchy, but doesn't exactly translate. You can also find useful information by looking into Inventor's SDK (Software Developer Kit). I believe the SDK ships free with all IV packages.
The API is much more powerful and robust then iLogic, but is a slightly more complex language. It is also much easier to access parameters from iLogic than the API.
I just went through the lesson process found in the customization forms and have a better understanding.
As you said, I've opened Inventor and pressed alt+F11, but nothing happens. Would you know how to manually access this?
Sorry, I believe it's because I was already using Visual Basic 2010 due to the tutorial as when I Press F2 in this it brings up the Object Browser.
Thanks for your help, I will look through those resources and get back to you if I find anything that helps our drawing situation
Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register
Start with some of our most frequented solutions to get help installing your software.