Ilogic Syntax/Language

Ilogic Syntax/Language

fabricelione
Explorer Explorer
751 Views
6 Replies
Message 1 of 7

Ilogic Syntax/Language

fabricelione
Explorer
Explorer

Hi Everyone, 

Can someone please send a link or document where one can learn the advacned stuff on ilogic ? Not just use the code snippets but the entire manual with advanced stuff. 

 

Kinds regards,

 

Fabrice

Accepted solutions (3)
752 Views
6 Replies
Replies (6)
Message 2 of 7

WCrihfield
Mentor
Mentor
Accepted solution

Hi @fabricelione.  Welcome to the Autodesk Community.

I do not think there is any single resource or location that can teach us everything there is to know about iLogic or all of the possible codes we can put into our iLogic rules.  The term 'iLogic' is often mistaken for representing the name of a coding language, but it is actually just the name of an add-in (Inventor.ApplicationAddIn) within Inventor which offers us a user interface for entering and editing code, and a bunch of resources to help make that process simpler and easier for those who may not have much (if any) previous coding experience.  Among those resources are a lot of custom Object types, Classes, Modules, Interfaces, Properties, & Methods.  However the primary coding language used within our iLogic rules is VB.NET.  In Inventor 2024 and older versions (to a certain point) are using the VB.NET Framework 4.8.1 version of that system, while Inventor 2025 and 2026 are using the newer VB.NET 8 (in the 'Core' series) system.  Inventor 2027 is still using the VB.NET 8 system, but they are also encouraging folks designing add-ins for Inventor to bump them up to VB.NET 10.  The 'VB' stands for 'Visual Basic', which is just one of several possible parallel coding languages (Link) that we can be using within our external coding resources like add-ins and standalone exe's though.  Many folks also use C#.NET (C Sharp) also.

One of the resources I use most often is the online help documentation.  There are several branches of that type of documentation though, and it can be important to familiarize yourself with each of them.  The term 'API' means 'Application Programming Interface'.  Inventor has its own primary API, then the iLogic add-in also has its own API, but they are different, and the iLogic stuff actually 'uses' the Inventor API resources behind the scenes, while presenting alternate tools for interacting with it.  The VBA (Visual Basic For Applications) editor is another 'interface' for interacting with the Inventor API, but since Microsoft (its developer) stopped maintaining that resource several years ago, and Autodesk then stopped including it in any new installations of its products, it has become less safe to use, and a less popular option, but can still be installed and used, and many still use it today.

The next most helpful resource, in my opinion, has been this 'Inventor Programming Forum' we are in right now.  This has been a very active community of folks interacting with each other, asking questions, presenting challenges, and receiving answers, code examples, and help.  If you use its search functionality with something relatively basic in the search bar, you may get tons of Links to forum conversations / discussions on those topics, often with working code examples included, and many marked as 'solved'.

 

Another good resource is the Autodesk University.

https://www.autodesk.com/autodesk-university/ 

 

And since sometimes the majority of the code in our iLogic rules can be just regular vb.net code (instead of things that are unique to the iLogic add-in), there is TONS of resources online about how to do things with vb.net code, and there is also Microsoft's Visual Studio application, which is the primary coding environment for most external coding resources across many industries.  But that application can be a bit intimidating if you have not been coding for long yet.  The 'Stack Overflow' website is also a powerhouse place for finding answers to vb.net related coding questions that may not have anything to do with Inventor or iLogic.

https://stackoverflow.com/questions 

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Message 3 of 7

WCrihfield
Mentor
Mentor
Accepted solution

Within the iLogic online help documentation are the following Links:

About iLogic Expansion and Customization 

To Configure iLogic Options 

Advanced iLogic Techniques Reference 

In that documentation, there is a lot of talk about including 'references' to other external resources.  This essentially opens things up so that we can access, utilize, and benefit from other external code resources, which can greatly extend what we can do with an iLogic rule, and can greatly reduce the amount of code required within the iLogic rule to get things done.  This also means that we can reach out to other programs and applications from within an iLogic rule in Inventor.  For example, we can include references for accessing Microsoft Excel that will allow our rule to be able to recognize all the object types and resources available in Excel's own API, enabling us to start a session of Excel, open Excel documents in it, read data from it and/or write data to it, save it, close the file, and close Excel.  Similarly, we can reach out to Microsoft Outlook to create a new email, and so on.  Besides that, we can create our own 'special' external iLogic rules, in which we turn on its 'Straight VB Code' option, and can define things like our own custom Class, Module, Enum, Structure, and so on, which can contain our own custom methods (Sub routines & Function routines) for common tasks.  Then to use those special external rules from our other 'regular' rules, we can include the 'AddVbFile'. followed by the file name of the external rule, in the 'Header' of the 'regular' rule.  If the external resource is defining a Module, then you should be able to directly access any of its extension method or public methods.  If the external resource is defining a Class, then you will usually need to 'instantiate' it (create an 'instance' of the Class using the 'New' keyword).  Then should be able to access the stuff within that Class from the variable representing an instance of that Class.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Message 4 of 7

WCrihfield
Mentor
Mentor
Accepted solution

I forgot to add another very helpful Link in my earlier posts.  Since 'Language' is right in the title of this post, and VB.NET (which is primarily used in our iLogic rules) is a coding language developed by Microsoft, I should include a Link to the start page for conducting searches for ".NET API" stuff.

https://learn.microsoft.com/en-us/dotnet/api/ 

If you are using Inventor 2024 or earlier version, you may may (or may not) want to choose the .Net Framework 4.8.1 subset of documentation, as a filter.  But if using any of the newer versions, you may not even want to use that type of filter.  Anyways, that website represents the 'official' online help documentation for the vb.net programming language API, because they are the folks who primarily developed it.  It may not help any with things that are unique to 'iLogic', but may be able to help with most other things.  Plus, they often include code examples that you can try which include whatever object, property, method, or subject matter you are looking for.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Message 5 of 7

fabricelione
Explorer
Explorer

thanks for the info

0 Likes
Message 6 of 7

lauri_barnhart
Autodesk
Autodesk

@fabricelione - Welcome! Thanks for your question.

 

Did previous replies by WCrihfield help clarify your question?

 

If yes, feel free to click on the Accept Solution button.

 

This helps other users benefit from the information.

 

Regards,

 

Let us know how we did on Trustpilot.


Lauri | Community Manager

0 Likes
Message 7 of 7

fabricelione
Explorer
Explorer

Hi Lauri ,

 

Yes the previous post from WCrihfield was very helpful. 

 

Regards,

 

fabrice

0 Likes