I have been using Visual Studio (VS) to debug iLogic code since Inventor 2019. Works for both internal and external rules.
Inspired by post by @BrianEkins
https://modthemachine.typepad.com/my_weblog/2019/12/using-visual-studio-to-debug-ilogic-rules.html
You can step through code, set multiple breakpoints, conditional breakpoints, etc. Such a valuable workflow.
I have attached the VS2022 SLN in Zip form which is compatible with Inventor 2025. Not sure if it works with INV2026.
Usage:
- Start Inventor.
- Start Visual Studio and open the SLN file.
- From the Visual Studio Debug Menu, select 'Attach to Process..."
- Select Inventor from the list.
- In Inventor, open a document containing an iLogic rule to debug.
- Edit the iLogic rule to include a 'Break' statement. On rare occasions, I have had to use 'Debugger.Break'
- When the Break statement is encountered, VS is activated. Step through code using F11.
For example:
Sub Main()
Break
Call Greet
End Sub
Sub Greet()
MessageBox.Show("Hello, World!", "HELLO", MessageBoxButtons.OK, MessageBoxIcon.Information)
End Sub
Hope this is helpful.
Regards,
Jerry
-----------------------------------------------------------------------------------------
CAD Administrator
Using AutoCAD & Inventor 2025
Autodesk Certified Instructor
Autodesk Inventor 2020 Certified Professional
Autodesk AutoCAD 2017 Certified Professional