iLogic rule msgbox/log live feed

iLogic rule msgbox/log live feed

JoãoASilva
Advocate Advocate
806 Views
6 Replies
Message 1 of 7

iLogic rule msgbox/log live feed

JoãoASilva
Advocate
Advocate

Hello everyone!

 

I have a complex rule that fires a lot of external rules when the multisheet drawing is done.

At the end, a message box is shown saying the rule as finished as well as the elapsed time.

 

Sometimes a few errors may occur during an external rule, but the Master Rule will continue the rest.

I would like to get a "live feed" of whats going on.

 

Example:

JoãoASilva_0-1605623773500.pngJoãoASilva_1-1605623794346.pngJoãoASilva_2-1605623807100.png

 

Is it even possible to have a live feed like this, running alongside the rule?

João Silva

Mechanical Engineer

 

0 Likes
807 Views
6 Replies
Replies (6)
Message 2 of 7

DRoam
Mentor
Mentor

What version of Inventor do you have? If you have Inventor 2019 or newer you can use the new iLogic "Logger" that's built specifically for this purpose. See here for usage instructions: Inventor 2019 Help: To Create Log Statements.

0 Likes
Message 3 of 7

JoãoASilva
Advocate
Advocate

I have Inventor always up to date (2021).

 

I'll give it a go and i'll either post here the result, or ask for more help.

Thanks!

João Silva

Mechanical Engineer

 

0 Likes
Message 4 of 7

JoãoASilva
Advocate
Advocate

I'm having trouble using the new "logger" function.

I can't seem to log anything. I've set the logging to info, enabled iLogic Log and even placed the "Logger.log level("message")" (wich gives an error).

 

From what I understand, this log will not be a pop up window like a message box. And if I don't have 'iLogic Log' enabled, I won't even see anything.

 

I'm implementing this at work, and we have a few people that don't know to work with this kind of stuff.

It would be a lot easier if it could be a msgbox.

 

Is it possible?

João Silva

Mechanical Engineer

 

0 Likes
Message 5 of 7

lmc.engineering
Advocate
Advocate

Hi @JoãoASilva 

 

By the very nature of a message box, it will pause the executing code to await a user input, so essentially no you cannot use this method to have a live feed unless you want your users to continually click 'OK'. 

 

Use 'Logger.Debug("My message")' to feedback your progress. Launch the iLogic log window in your main rule like this:

 

oInternalName = "ilogic.logwindow"
For Each oDockableWindow As Inventor.DockableWindow In ThisApplication.UserInterfaceManager.DockableWindows
	If oDockableWindow.InternalName = oInternalName Then
		If Not oDockableWindow.Visible = True Then
			oDockableWindow.Visible = True
		End If
	End If
Next

I found this from another post by @DRoam, here: Open iLogic Browser 

0 Likes
Message 6 of 7

Eide.N
Advocate
Advocate
0 Likes
Message 7 of 7

JoãoASilva
Advocate
Advocate

Hi @lmc.engineering !

 

Thanks for the code!

I even placed an altered version at the end to close the iLogic Log window.

That works well, but I need to clean the previous run from the logger.

Do you know how to do it?

 

@Eide.N 

A progression bar is cool, but it would be a pain to figure out the number os steps so that it doesn't go past 100%.

This because I have multiple rules that run depending on the type of file and our internal coding.

 

@DRoam 

It's a shame that we don't have that much information regarding the logger on that link...

João Silva

Mechanical Engineer

 

0 Likes