iLogic rules by Chat GPT

iLogic rules by Chat GPT

kacper.suchomski
Mentor Mentor
3,325 Views
7 Replies
Message 1 of 8

iLogic rules by Chat GPT

kacper.suchomski
Mentor
Mentor

Hi

What are your experiences with building rules using AI?

What can Chat do for us and what can't it do yet?

Do you have experience comparing different versions of Chat GPT?

Or with other language models (Gemini, Claude, etc.)? 


Kacper Suchomski

EESignature


YouTube - Inventor tutorials | LinkedIn | Instagram

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.


3,326 Views
7 Replies
Replies (7)
Message 2 of 8

bradeneuropeArthur
Mentor
Mentor

Hey @kacper.suchomski 

 

My experience is that sometimes code is generated, that the  AI-user does not fully understand.

This may lead into severe errors in future when code needs to be modified.

Often I get requests from user that ask for help understanding or modify the AI code that is not working completely or does not work anymore after update/migrate. 

Most times the easiest/quickest way is not the best....

Still we need somebody that has understanding of the AI created. 

So my general advice would be, to fully rewrite and reproduce the AI code in your own word/style.

 

 

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

Message 3 of 8

ryan.rittenhouse
Advocate
Advocate

I've used it in two contexts. If I am using ChatGPT with straight up prompts, your starting prompt is key. This is the one that I've been using:

 

For the duration of this thread use only the Autodesk Inventor 2024 API and VB12 in responding to inquiries.  Any access to other versions will be incorrect, do not add functions, attributes, properties to responses that are not specifically included in those versions of the API. If this is a clear instruction respond with "Understood" 

 

Results, even with that prompt are decidedly mixed. If you are hewing close to pure iLogic/VB, then it works pretty well. Once you need to dig into the Inventor specific parts of the API, it still starts to break down.

 

I have had much better luck using Copilot through VSCode. When it has your entire iLogic code library to draw on it does much better about following the proper ways to access things in the API. It still has trouble differentiating what methods are available for derived classes (like PartDocument vs AssemblyDocument) if you are not careful with your prompts. I've also had much better luck doing inline comments or code starters with what I want it to do instead of using the prompt to get the code. With autocomplete turned on you can write something like "Function GetComponentDefinition(doc As Document) As ComponentDefinition" with good odds that it'll work out what you're doing. If it doesn't, adding a comment above the function call can often clean it up. From there using the inline prompt tools can steer it in the right direction.

 

ryanrittenhouse_0-1735922031032.png

 

If you look closely at the code it provided, it's more complicated than it needs to be (both document types get to the definition the same way), but it's correct and aware of the pitfall that can happen with derived classes.

 

My $0.02

 

If this solved your problem, or answered your question, please click Accept Solution.
Message 4 of 8

kacper.suchomski
Mentor
Mentor

@bradeneuropeArthur  you're right.

I do the same thing, actually. While I'm good at creating conditional rules and configurators, I'm just starting to learn about the API, and the learning curve is long. That's why I sometimes use Chat GPT 4o. The upside is that it creates code with comments right away. There are rules that it creates flawlessly (for example, I once had to change the language of column titles in parts lists in dozens of files and I managed to do it right away); other times I need a few feedback messages, and sometimes it can't do it after a dozen or so attempts.

So I wonder if there is any difference between 4o and 1o; or if there are better LLM for it.

Another thing is that although I plan to learn it, I think that in 1-2 years the chat will be better anyway, and I will be correcting the code instead of writing it by hand.

 

@ryan.rittenhouse  that's a great prompt.

I'm just wondering why you mentioned VBA12 when the help also mentions that Inventor supports VBA11?

https://help.autodesk.com/view/INVNTOR/2025/ENU/?guid=GUID-32B66838-22E4-4A0A-B5BB-862350C76B36

Can you clarify how to access Copilot through VSCode with the entire code library?


Kacper Suchomski

EESignature


YouTube - Inventor tutorials | LinkedIn | Instagram

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.


Message 5 of 8

k.hendrickx
Advocate
Advocate

I also use it a a rough basis to generate the big outlines of a script.

As mentioned, one very good thing about Chat GPT is that it not only generates code, but also comments the code very well so you understand what it's trying to achieve and also a brief explanation of what the code will do.

 

Off course most of the time you'll run into errors or faults because the iLogic programming language isn't that commonly used, but with some fine tuning and adding those last manual touches, you are able to create some nice working scripts in a reasonable amount of time, without having to follow a 3 year programming course to begin with.

 

Watching how the AI attacks certain problems and how it accesses certain API's does help me understand the structure of iLogic and at the same time I feel like I'm also learning new things everytime.

 

In our old (manual) VBA codes for example there was a very poorly error handling (on very little documentation) which more than once caused Inventor to crash. Chat GPT will try to always include error handling and we also brought a lot of that over to our old codes which now work better than before.

 

 

Also a very cool trick... if you have undocumented code and don't know how it works, feed it to Chat GPT and ask it to document it. It won't change the code itself, but it will add those very important "comments" to help you understand the code.

Message 6 of 8

Ivan_Sinicyn
Advocate
Advocate

I have already written more than 10 add-ons using ChatGPT 4o, o1, o3 mini-high, Claude sonnet 3.5, Grok 3
I have attached screenshots of some of the programs. First I make the base in iLogic then I transfer the code to csharp.
I don't understand a line of code, but I'm already very familiar with IDE environments.

The biggest problem is the lack of API instructions suitable for LLM and sometimes I have to search for a solution on forums or copy the web page of instructions into a dialog box.

1.png2.png3.png4.png5.png

INV 2025.3
0 Likes
Message 7 of 8

liam.dewhurstNMKYG
Contributor
Contributor

I'm busy training this custom GPT to be better and better at writing automations for me.

I co-wrote a code for finding sneaky drawings that didn't fully link to the part in inventor:
Here's the logic
- check local for an .idw (same name)
- check vault for an .idw thats the same name
- And then ping the "has drawing" to find a drawing on vault.
- and if it draws a blank, it starts a dialogue box for selecting a template and auto places the parts.

It's getting reasonably good. Jump in and use it, and fire me codes or training if you want and I'll keep adding to this tool. (though there may be a better one out there?)

I just pulled any training doc I could find for ilogic or vault API and added it in. I'm up to starting to create custom dll add-ins, but I just need to book our software engineers in to aid in this (slightly out of my personal depth here)

liamdewhurstNMKYG_0-1748486576007.png

 

0 Likes
Message 8 of 8

mgrenier2
Advocate
Advocate

I've had mixed results, sometimes it does great, other times I just give up.

I seemed to have better results the one month I did subscribe to ChatGPT +

0 Likes