The View > Optional Panels menu lists the optional panels of the current layout. In the default layout, this includes the main command panel (MCP), the timeline, time range slider, and the Main Shelf.
To check if a panel is open, get the panel from the ActiveLayout.Views collection and check whether it’s visible:
LogMessage( Application.Desktop.ActiveLayout.Views("main_shelf").Visible );
Why would you need to do this ? 🙂
Someone on xsibase asked this, but they didn’t say what they were doing. Maybe they want to hide the optional panel if it is visible, or update it somehow if it is visible.