CALL ILOGIC FORM FROM VB.NET

CALL ILOGIC FORM FROM VB.NET

jcorrero87
Enthusiast Enthusiast
669 Views
4 Replies
Message 1 of 5

CALL ILOGIC FORM FROM VB.NET

jcorrero87
Enthusiast
Enthusiast

Hello everyone,

One question, how can I call an ilogic form from a VB.net module?
If this is possible, what command should I use?

Thank you so much.

0 Likes
670 Views
4 Replies
Replies (4)
Message 3 of 5

jcorrero87
Enthusiast
Enthusiast

Thank you very much, but my idea is to call a form created in ilogic called "control" from a module and thus be able to create a button with that module.

0 Likes
Message 4 of 5

tyler.warner
Advocate
Advocate

@jcorrero87 you can take a look at this tool which is a free add-in from the Autodesk App Store.
I believe it has now been included in Inventor 2023 out of the box.

 

If this solved your problem or answered your question, please click ACCEPT SOLUTION.
If this helped you, please click LIKE.
0 Likes
Message 5 of 5

WCrihfield
Mentor
Mentor

What version/year of Inventor are you using?  Where are you planning on putting this button you plan on creating (into another form, into an Inventor RibbonPanel, some other UI)?  Why not just create a Windows Form in vb.net, and show that form?  Is this code being put into an Inventor ApplicationAddIn, a standalone EXE, or something else?  Maybe the button could just run an iLogic rule, then the rule could contain its own code to create a Windows Form, show it, & react to your interactions with it, instead of just launch a pre-existing iLogic form.  I have done that before, but it is obviously not ideal if the design of the form may need to change periodically.

 

Accessing iLogic forms is not as simple/easy as accessing iLogic rules, and like rules, they are stored in different places, depending on if it is an internal one, or an external/global one.  Much of the specs of internal iLogic forms are stored in attributes of the document, similarly to internal iLogic rules.  Much of the specs of the global iLogic forms are stored in external XML documents.  The iLogic forms are buried in layers of stuff and references that are custom to the iLogic ApplicationAddIn, so it is difficult to get a simple 'reference' to one, before it is launched, that would allow you to show it, or fully control it from outside of Inventor.  Within the iLogic rule editor environment, before we even type anything in, many references are already included for us, and several object variables are automatically created for us that represent certain interfaces or objects.  One such term is 'iLogicForm'.  That term has been defined for us within the 'ThisRule' class (that is also created for us in the background), and it represents the 'IiLogicForm' Interface (within Autodesk.iLogic.Interfaces)(does not represent a specific form).  That Interface only exposes 3 properties, and 3 methods...none of which is, or can lead us to, the actual Windows Form type object.  Two of those properties will return a list of available internal or global form names, if there are any, but do not tell us where those names are being pulled from.  And two of the methods will show a form, by simply specifying its name, but they to not leave you with a reference to the actual form itself, or a reference to something that can be used to point to the form.  Just a reference to something that was generated as a result of closing the form.  There are ways of digging into the reference dll resources that iLogic uses to build the forms, but so far in my snooping experience, they just lead to special namespaces, and classes that are unique to the iLogic add-in, and many of the specifications of the forms, without an actual direct route to a 'Form' object.

It sounds to me like you may need your button to execute a special command, that would then launch your Module, that would then launch the iLogic form, similarly to how it was done in the linked example from the first response.  Do you need to interactively react to any changes made within the form, or are you just planning on using it normally (lauch it, make changes in the form the close the form, then check for any changes made using other code, then react to them).

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes