Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Inventor Pro 2014: iLogic: Assign a Keystroke to open a form or run a Rule

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
sgwilliams
1296 Views, 3 Replies

Inventor Pro 2014: iLogic: Assign a Keystroke to open a form or run a Rule

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")
Work Station : Custom built, Liquid Cooled, Asus Pro WS X570-ACE Motherboard; AMD Ryzen 9 3900X 3.8 GHz 12-Core Processor; ASUS TUF Gaming NVIDIA GeForce RTX 3060 V2 OC Edition Video Card; 32 GB CORSAIR Dominator Platinum DDR4-2132 Memory ; Samsung 850 EVO 1TB SSD Drive.
3 REPLIES 3
Message 2 of 4
admaiora
in reply to: sgwilliams

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.

EESignature

_____________________________________________________________________________
Facebook | Twitter | Youtube

Message 3 of 4
philippe.leefsma
in reply to: admaiora

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.



Philippe Leefsma
Developer Technical Services
Autodesk Developer Network

Message 4 of 4

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.

Work Station : Custom built, Liquid Cooled, Asus Pro WS X570-ACE Motherboard; AMD Ryzen 9 3900X 3.8 GHz 12-Core Processor; ASUS TUF Gaming NVIDIA GeForce RTX 3060 V2 OC Edition Video Card; 32 GB CORSAIR Dominator Platinum DDR4-2132 Memory ; Samsung 850 EVO 1TB SSD Drive.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report