I'm sort of new to iLogic and VB. I just created a Form called "Carter Data" which has a consolidated group of iproperty feilds that we require to fill out for all of our Solid models which in turn are populated on our drawing files. This was created to save us the time of going from tab to tab in the default Inventor Iproperties dialog. This should streamline the iproperty chore for our standard data. I have browsed thru the forums and researched the ability to create a button or assign a keystroke to open this form when needed.
I created a iLogic rule called "Open Carter Data" but could not figure out how to assign a keystroke to it or create a button for my menu.
-=Open Carter Data Snippet=-
iLogicForm.ShowGlobal("Carter Data")
Solved! Go to Solution.
Solved by philippe.leefsma. Go to Solution.
Ho sgwilliams,
to do that you have to use vba code.
Or more easily use an iTrigger.
Click once the iTrigger botton (Manage>iLogic), that create a user parameter
Then you have only to insert in your rule for example
iTrigger = iTrigger0
whenever now you will click the itrigger botton in manage>ilogic you will run that rule (or all the rule that will contain iTrigger = iTrigger0 )
You can use the event trigger too to connect you rules with event (Open a document..change a parameter..a material..etc)
Hope that it can helps you
Admaiora
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
If you want to create a button of your own in the UI, listen to keystroke events or create shortcuts, you would need to use the proper APi directly from an addin. iLogic offers only limited ways to customize Inventor comparing with what you can achive from an addin.
We have resources that can help you getting started:
http://usa.autodesk.com/adsk/servlet/index?siteID=123112&id=17324828
https://github.com/ADN-DevTech/Inventor-Training-Material
Philippe.
We had a VB wizard come in and he wrote a macro which I added to a custom button by right clicking on the ribbon selecting "Customize User Commands". Then on the Customize Dialog Window>KeyBoard Tab I chose Catagories > Macros in the drop down. Then assiggned a keystroke. All set now my form pops up whenever I need it to. See the Macro Code below.
Sub LaunchCarterFrom() RuniLogic "ShowForm" End Sub Public Sub RuniLogic(ByVal RuleName As String) Dim iLogicAuto As Object Dim oDoc As Document Set oDoc = ThisApplication.ActiveDocument If oDoc Is Nothing Then MsgBox "Missing Inventor Document" Exit Sub End If Set iLogicAuto = GetiLogicAddin(ThisApplication) If (iLogicAuto Is Nothing) Then Exit Sub iLogicAuto.RunRule oDoc, RuleName End Sub Function GetiLogicAddin(oApplication As Inventor.Application) As Object Set addIns = oApplication.ApplicationAddIns 'Find the add-in you are looking for Dim addIn As ApplicationAddIn On Error GoTo NotFound Set addIn = oApplication.ApplicationAddIns.ItemById("{3bdd8d79-2179-4b11-8a5a-257b1c0263ac}") If (addIn Is Nothing) Then Exit Function addIn.Activate Set GetiLogicAddin = addIn.Automation Exit Function NotFound: End Function
Thanks for the help Philippe Leefsma.