Inventor Customization

Inventor Customization

Reply
Mentor
mehatfie
Posts: 163
Registered: ‎02-10-2012
Message 1 of 6 (890 Views)

Trigger Custom Add-Ins Button through iLogic

890 Views, 5 Replies
02-14-2012 06:24 AM

Hi all,

 

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.

 

Please Advise

 

Thanks

Mitch

*Expert Elite*
mrattray
Posts: 2,482
Registered: ‎09-13-2011
Message 2 of 6 (874 Views)

Re: Trigger Custom Add-Ins Button through iLogic

02-17-2012 08:18 AM in reply to: mehatfie

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.

Mike (not Matt) Rattray

Mentor
mehatfie
Posts: 163
Registered: ‎02-10-2012
Message 3 of 6 (872 Views)

Re: Trigger Custom Add-Ins Button through iLogic

02-17-2012 08:38 AM in reply to: mrattray

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.

 

Mitch

*Expert Elite*
mrattray
Posts: 2,482
Registered: ‎09-13-2011
Message 4 of 6 (866 Views)

Re: Trigger Custom Add-Ins Button through iLogic

02-17-2012 10:50 AM in reply to: mehatfie

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. 

Mike (not Matt) Rattray

Mentor
mehatfie
Posts: 163
Registered: ‎02-10-2012
Message 5 of 6 (855 Views)

Re: Trigger Custom Add-Ins Button through iLogic

02-17-2012 01:16 PM in reply to: mrattray

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?

Mentor
mehatfie
Posts: 163
Registered: ‎02-10-2012
Message 6 of 6 (853 Views)

Re: Trigger Custom Add-Ins Button through iLogic

02-17-2012 01:19 PM in reply to: mrattray

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

 

Mitch

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.