Inventor General Discussion

Inventor General Discussion

Reply
Contributor
ygingras
Posts: 25
Registered: ‎03-09-2007
Message 1 of 3 (1,218 Views)
Accepted Solution

iLogic; Developing and debugging

1218 Views, 2 Replies
12-07-2010 08:59 AM

Hi!

 

What would be the best practices to use while developing and/or debugging any iLogic rules? I guess there is no way we can use "break points" and/or have anything similar to the "watch" in VBA

 

Also, any real life "tricks" woul be greatly appreciated.

 

Thanks in advance.

 

Yves

You can develop and debug code in Visual Studio or Visual Basic Express.  Compile it to create a dll that is loaded and run from an iLogic rule.  Put most of your code in the dll.  Then when you have it working, you can cut and paste it to the rule.  This is a lot of work, but it can be worth it if you need to put together a lot of code.

 

 One minor thing you can do in iLogic to help with debugging is to add something like a Print statement (using the function Trace.WriteLine)  that will show you a log of what the rule is doing.   For instance:

 

Trace.WriteLine(" d0 = " & d0)

 

To see the output, you can run DebugView from

http://technet.microsoft.com/en-us/sysinternals/bb896647

 

(In Inventor 2010, you have to add the line:

Imports System.Diagnostics

at the top of the rule.)

 

Employee
MjDeck
Posts: 959
Registered: ‎02-24-2009
Message 2 of 3 (1,180 Views)

Re: iLogic; Developing and debugging

12-10-2010 01:50 PM in reply to: ygingras

You can develop and debug code in Visual Studio or Visual Basic Express.  Compile it to create a dll that is loaded and run from an iLogic rule.  Put most of your code in the dll.  Then when you have it working, you can cut and paste it to the rule.  This is a lot of work, but it can be worth it if you need to put together a lot of code.

 

 One minor thing you can do in iLogic to help with debugging is to add something like a Print statement (using the function Trace.WriteLine)  that will show you a log of what the rule is doing.   For instance:

 

Trace.WriteLine(" d0 = " & d0)

 

To see the output, you can run DebugView from

http://technet.microsoft.com/en-us/sysinternals/bb896647

 

(In Inventor 2010, you have to add the line:

Imports System.Diagnostics

at the top of the rule.)

 



Mike Deck
Software Developer
DLS - Mechanical Design
Autodesk, Inc.

Contributor
ygingras
Posts: 25
Registered: ‎03-09-2007
Message 3 of 3 (1,149 Views)

Re: iLogic; Developing and debugging

12-13-2010 05:33 AM in reply to: ygingras

Thanks Mike, 

this will surely help.

 

Yves

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.