Can I run a rule without the editor closing?

Can I run a rule without the editor closing?

DonStauffer99
Advocate Advocate
224 Views
6 Replies
Message 1 of 7

Can I run a rule without the editor closing?

DonStauffer99
Advocate
Advocate

It seems to me I remember being able to run an external rule in the rule editor without the editor closing. That allowed me to monitor execution using things like Debug.Print. But I haven't been able to remember how to do that for some reason.

0 Likes
Accepted solutions (1)
225 Views
6 Replies
Replies (6)
Message 2 of 7

WCrihfield
Mentor
Mentor

Isn't Debut.Print a VBA tool?  That is usually not used in iLogic rules.  In iLogic rules, we have the iLogic 'Logger' rule object for writing entries into the iLogic Log window.  We can certainly have the VBA window open while we run macros from it, and watch stuff happen in Inventor.

Or, were you maybe using Visual Studio, with it connected to the Inventor application at the time?

I do not recall having that ability.  I do know that we can have iLogic Forms open on our screen, and either a rule already running in the background, &/or buttons in the form for running rules, and being able to watch the iLogic Log window while that is going on.  And I have certainly right-clicked external rules to run them, or clicked on their buttons in the ribbon to run them, and watching the iLogic Logger window while it ran.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 3 of 7

DonStauffer99
Advocate
Advocate

In Inventor, in the rule editor, I'm sure Debug.Print used to work. But in any event, whatever the program, click "Save and Run" and the editor closes. The script runs, and the editor remains closed when it finishes. No debug window, nothing. I'm sure if I defined a form, that form would remain visible while appropriate, but I'm talking about working on a program and not having to reload the rule into the editor after every test run, and ideally being able to look at debugging output while it runs. I see nothing of the script except its actions in Inventor.

0 Likes
Message 4 of 7

WCrihfield
Mentor
Mentor

I just checked, and yes, there are similar objects and methods in both VBA and in VB.NET (which is used in iLogic rules).  I just rarely ever used that tool in iLogic rules.  I think I've been doing automation stuff in Inventor for about 10+ years, and used to use VBA more heavily in the beginning, but transitioned over to iLogic pretty quickly.  Got to the point where the vast majority of my code was in external iLogic rules, and was only using VBA macros to run my iLogic rules, so that I could put the macro buttons in the ribbon.  Then completely quit using VBA at all, for anything, a few years ago.  I did often have my Inventor VBA editor screen open in one screen, and run macros from it in Inventor which was open in the other screen.  That was certainly handy.  I just can't remember ever doing that with iLogic rules.  Maybe it was before I started paying attention to those types of things.  But I still do not know how to make that happen now.  Good luck with that.

Debug Object (VBA)

Debug.Print method (VBA)

Debug Object (VB.NET)

Debug.Print method (VB.NET)

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 5 of 7

hollypapp65
Advocate
Advocate
Accepted solution

Don't think the editor keep open.

You can add iLogic log panel:

ilogicLog-02.jpg

Set log level:

ilogicLog-01.jpg

And use:

Logger.Info("Debug")

 

Message 6 of 7

DonStauffer99
Advocate
Advocate

That log window will get me by. I didn't know that setting was there. Thanks!

0 Likes
Message 7 of 7

hollypapp65
Advocate
Advocate

You can debug iLogic with Visual Studio too.

You can set break point and step through the code.

0 Likes