Create iLogic Form with VBA or iLogic

Create iLogic Form with VBA or iLogic

GeorgK
Advisor Advisor
2,173 Views
6 Replies
Message 1 of 7

Create iLogic Form with VBA or iLogic

GeorgK
Advisor
Advisor

Hello together,

 

I create some iLogic rules automatically. Is there any possibility to create a iLogic form with all the rules as buttons on it with VBA or iLogic?

 

Thank you

 

Georg

0 Likes
2,174 Views
6 Replies
Replies (6)
Message 2 of 7

Anonymous
Not applicable

Sub RuniLogicRule() RuniLogic ("Path to extrenal rule.txt") End Sub Public Sub RuniLogic(ByVal RuleName As String) Dim iLogicAuto As Object Dim invDoc As DrawingDocument Set invDoc = ThisApplication.ActiveDocument Set iLogicAuto = GetiLogicAddin(ThisApplication) If (iLogicAuto Is Nothing) Then Exit Sub iLogicAuto.RunExternalRule invDoc, RuleName End Sub Public Function GetiLogicAddin(oApplication As Inventor.Application) As Object 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

This is the code to call an extrenal ilogic rule from VBA.

Create a form and for each of the buttons when clicked  call the sub which runs the relevant external ilogic rule, which can be saved in a txt document.

0 Likes
Message 3 of 7

GeorgK
Advisor
Advisor

Hello Alice,

 

thanks for your help. But I would like to add a form with VBA or iLogic and then add the rules to the form.

 

Formular.png

 

Georg

0 Likes
Message 4 of 7

chandra.shekar.g
Autodesk Support
Autodesk Support

Hi @GeorgK,

 

Unfortunately, there is no API to add iLogic form.

 

Please post this wish list at idea station using following link.

 

https://forums.autodesk.com/t5/inventor-ideas/idb-p/v1232/tab/most-recent

 

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



0 Likes
Message 5 of 7

GeorgK
Advisor
Advisor

Is this possible for Inventor 2019?

0 Likes
Message 6 of 7

philip1009
Advisor
Advisor

Unfortunately no, there's no way to control the iLogic forms via API, if you want a more dynamic form that changes, your best choice is to make the form in Visual Studio, and then look into the Create Rule for a Dialog Wizard.  If you're trying to make a form that isn't file dependent then you can make a global form.

0 Likes
Message 7 of 7

GeorgK
Advisor
Advisor

I create some iLogic rules with an add-in per model. This would be great to  that with a form.

0 Likes