StatusBarText

StatusBarText

gilsdorf_e
Collaborator Collaborator
1,046 Views
5 Replies
Message 1 of 6

StatusBarText

gilsdorf_e
Collaborator
Collaborator

Hello,

 

I'm in need to track the idle status of Inventor from an external application. My idea was to use the StatusBarText (at least I imagined that the "Ready" text in the bottom bar is the StatusBarText). I have reused that text already in Inventor 2014 from AutoIt, yet I already noticed that this is not possible anymore in Inventor 2016.

 

Even through Inventor API, the Application.StatusBarText is always an empty string. Was this function removed and are there alternative options to track if Inventor has finished all tasks and is idleing?

 

Best regards

Erik Gilsdorf

0 Likes
1,047 Views
5 Replies
Replies (5)
Message 2 of 6

Owner2229
Advisor
Advisor

TLDR: There's a function on the Inventor.Application object you can use to check if it's idle.

You can then create a function to hold your threat until Inventor loads up, something like:

 

Public Sub Inventor_WaitForReady(iApp As Inventor.Application)
	If iApp.Ready Then Exit Sub
	While True
		Threading.Thread.Sleep(100)
		If iApp.Ready Then Exit While
	End While
End Sub
Consider using "Accept as Solution" / "Kudos" if you find this helpful.
- - - - - - - - - - - - - - -
Regards,
Mike

"Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." - John F. Woods
0 Likes
Message 3 of 6

gilsdorf_e
Collaborator
Collaborator

Thank you, but I already checked the Inventor.Application.Ready property. This just means that Inventor has started and loaded all addins. So this is always true after Inventor has started. I cannot judge by this property if Inventor is loading an assembly or calculating something.

 

 

0 Likes
Message 4 of 6

b_sharanraj
Advocate
Advocate

Please try this one 🙂

 

MsgBox (ThisApplication.CommandManager.CreateInteractionEvents.StatusBarText)

Regards

B.Sharan Raj

0 Likes
Message 5 of 6

gilsdorf_e
Collaborator
Collaborator

Sorry for the late answer. Unfortunately the value seems to be always "Ready", even if Inventor is updating a large assembly model (the status bar in the UI does not display "Ready".

 

class Program
    {
        static void Main(string[] args)
        {
            Inventor.Application invApp;
            invApp = (Inventor.Application)System.Runtime.InteropServices.Marshal.GetActiveObject("Inventor.Application");
           
                String test = invApp.CommandManager.CreateInteractionEvents().StatusBarText;
                
           
           // invApp.Documents.CloseAll();
        }
    }
0 Likes
Message 6 of 6

chandra.shekar.g
Autodesk Support
Autodesk Support

Hi @gilsdorf_e,

 

 

Unfortunately, StatusBarText is not giving status of Inventor. But, there are many events to capture the status of Inventor.

 

Try "EventWatcher.exe" which is explained in detail in below blog link.

 

http://modthemachine.typepad.com/my_weblog/2009/03/running-commands-using-the-api.html

 

Please feel free to contact if there is any queries,

 

If solves problem, click on "Accept as solution" / give a "Kudo".

 

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



0 Likes