Hiding Buttons in the Status Bar

Hiding Buttons in the Status Bar

Paulio
Advocate Advocate
1,062 Views
4 Replies
Message 1 of 5

Hiding Buttons in the Status Bar

Paulio
Advocate
Advocate

Can anyone please tell me how to programmatically hide buttons in the Status bar?

I've set the visibility of all panes in the Application.StatusBar object to False but my status bar still looks like this:
StatusBar.PNG

This is for an OEM application and we're not supporting customising the interface and some other stuff so I need to remove the last four ideally but I can't see anywhere to access them.

There's a Status bar on the document too but setting them all to false also has no effect.

 

Is there another object I need to go through? I don't really want to hide the entire status bar (not that I can see how to do that either) as the user can still use the OSnap stuff.

 

Thanks

0 Likes
Accepted solutions (1)
1,063 Views
4 Replies
Replies (4)
Message 2 of 5

norman.yuan
Mentor
Mentor
Accepted solution

AutoCAD's StatusBar object contains 2 collections of items: Panes and TrayItems. That is, not all items you see is a Pane, some of them are Panes, some of them are TrayItems (though, both are derived from StatusBarItem, which has a property VIsible). Usually, the items with text in it is a Pane, the item only showing an icon is TrayItem.

 

So, you need to go through both collections and set each item in each collection with Visibile = False

 

 

Norman Yuan

Drive CAD With Code

EESignature

Message 3 of 5

Paulio
Advocate
Advocate

Thanks Norman

0 Likes
Message 4 of 5

Juergen_Becker
Advocate
Advocate

Hi,

is there a way to select a specific pane to switch the visibilty to false or to true.

I cannot identify for example the snap-pane.

Regards Jürgen

I hope my tip helps. If so then give me kudos and mark the tip as a solution.
Thanks.

Jürgen A. Becker
Building Services

Development and Support
Autodesk Forge Spezialist


CAD-Becker.de
https://www.CAD-Becker.de

0 Likes
Message 5 of 5

paul_mace
Contributor
Contributor

Hi Juergen,

 

It's definitely not easy to identify specific panes. I went through a painstaking process of turning each one off (using Panes[n].visible = false) to identify which was which.

I think the 2D snap pane is number 19, so you would hide it like this:

StatusBar bar = Application.StatusBar;
bar.Panes[19].Visible = false;

There might be an easier way to identify them, but if there is, I'm not aware of it.

 

Paul

0 Likes