Getting to Grips with the Newest iLogic-Specific Features in Inventor 2019

9 April 2018mechanicalReading time 2Min
Post view


Getting to Grips with the Newest iLogic-Specific Features in Inventor 2019

The 26th March 2018 marked the official release of Autodesk’s latest instalment in the Inventor Professional product family, the 2019 version.

This year has seen the BETA site awash with fresh faces discussing the improvements added to the roadmap by the Autodesk development team a year ago.

The additions are many and fall into the category of (sometimes long overdue) “bug fix” or “new feature” and it’s a couple of these new features I wish to discuss today.

Named Geometry

The first of which is the newly added “Named Geometry” – that being, when in a part file you can now right-click any face and select “Assign Name”:

Once you do this, (assuming you have it open or visible) the iLogic browser will display a new tab called Geometry. You can continue adding named faces like this until you end up with something that looks like this:

{{Caption: Here with Bottom shown highlighted}}

Now, you may be asking yourself, what can I do with these named faces? Well, the answer is two-fold:

Use number one: you can use them to help automate construction of an assembly, in this case a stack of boxes goes from this:

Use number two: these newly named faces can potentially automate drawing object dimensioning:

This is the sort of thing that could be useful if your company is hoping to automate drawing creation as part of a wider automation initiative.?

Debugging iLogic

For the first time ever, it is now possible to debug using Inventor iLogic. Hurray! I hear you shout!

Autodesk have stated in the Inventor BETA forums that the functionality is NOT SUPPORTED and from my own experience certain Inventor addins will prevent this from working!

Note: If you’re used to developing add-ins for Inventor I’ll warn you now that this is **NOT** the debugging you’ll have become used to inside of whatever version of Visual studio you happen to be using.

First things, first, this is not by any means a replacement for creating a fully managed .NET add-in, nor is it the crème-de-la-crème of box-ticking solutions but the team at Autodesk had to start somewhere – after all, the IdeaStation post has been on the “to-do” list for 5 years now.

To get debugging working, you’ll need to have installed Inventor 2019 to your local machine and have a copy of Visual Studio (VS) installed.

These days, there are three flavours of VS available:

Community (Free but license terms apply)

Professional (included if you have a VS Subscription)

Enterprise (for those businesses who build enterprise-class solutions for themselves/others)

I have Professional 2017 (Build 15.6.4) installed, so that’s what I will be using today.

Open VS and create a new project, I called mine “InventoriLogicDebugging” so use similar, (the project type should be VB.NET!) save the project and that’s all that we need VS for; for the time being.

Next, inside of Inventor 2019, create your iLogic rule in the usual way. Except, where before we had the limitation of debugging using or occasional output to a log file of some kind, we can now query our object properties inside of Visual Studio.

The secret sauce that allows this is the change Autodesk have made to the way iLogic rules get compiled – if you were to query “%TEMP%iLogic Rules” whilst Inventor 2019 is open after having run an iLogic rule or two, you will see that any rules run in the current Inventor session will compile into the above folder with the .vb extension:

iLogic Rules

Getting the debugging to work is as simple as including the word “break” at the relevant location within your code.

Once you have added your break lines, save the rule by using ctrl+s (you knew you could do that, right? Right?) then return to Visual Studio and select “Debug > Attach to Process…”. Select (or filter to) Inventor from the list then return to the Inventor window.

Now you can run the iLogic rule in the usual fashion and as soon as iLogic reaches a “break” line you will immediately see the VS window appear with the relevant line highlighted:

Whilst the execution pauses, you can query the properties of objects created by the rule itself, as well as some small properties created by iLogic itself.

To continue with the rule, you simply need to hit F5 (within the VS window). One bonus is that should you encounter an error, iLogic execution will now stop at the exact line of the error and provide you with the relevant details that are always lacking in ALL VERSIONS of Inventor prior to 2019:

One important tip I learned to my cost recently is to avoid wrapping your code in too many unnecessary Try Catch loops because as Yoda would say “Do or do not, there is no Try”.

Graitec run a number of Inventor courses including update training, intermediate training and iLogic essentials. To find out about these just head over to our Inventor training page or click on the button below to request more information.

Any question?

Please contact us if you have any questions or requests on our products, training, consulting services or events. Our team of experts are here to help you get the best out of your projects.

Contact us

Related content

What’s New in Autodesk Vault 2022

21 May 2021mechanicalGRAITEC Expert

What's New in Autodesk Vault 2022

What’s New in Autodesk Inventor 2022

19 May 2021mechanicalGRAITEC Expert

What's New in Autodesk Inventor 2022

Graitec Vault Health Check

14 September 2020mechanicalGRAITEC Expert

Graitec Vault Health Check