Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

Dockable windows - show and hide

GeorgK
Advisor

Dockable windows - show and hide

GeorgK
Advisor
Advisor

Hello together,

 

how could I show and hide dockable windows via API?

 

Thanks

 

Georg

0 Likes
Reply
Accepted solutions (1)
822 Views
5 Replies
Replies (5)

ewiggers
Enthusiast
Enthusiast

Hi,

 

Check the Programming Help for an example, methodes and properties, search for "DockableWindow Object".

 

This is a code example found in the help:

Sub DockableWindow()
    Dim oUserInterfaceMgr As UserInterfaceManager
    Set oUserInterfaceMgr = ThisApplication.UserInterfaceManager

    ' Create a new dockable window
    Dim oWindow As DockableWindow
    Set oWindow = oUserInterfaceMgr.DockableWindows.Add("SampleClientId", "TestWindowInternalName", "Test Window")

    ' Get the hwnd of the dialog to be added as a child
    ' CHANGE THIS VALUE!
    Dim hwnd As Long
    hwnd = 4851096

    ' Add the dialog as a child to the dockable window
    Call oWindow.AddChild(hwnd)

    ' Don't allow docking to top and bottom
    oWindow.DisabledDockingStates = kDockTop + kDockBottom

    ' Make the window visible
    oWindow.Visible = True
End Sub

 

Regards,

Eelco

GeorgK
Advisor
Advisor

Hello Eelco,

 

I got it already running. But how could I hide the Dockable window for example the viewcube?

 

Regards

 

Georg

0 Likes

adam.nagy
Autodesk Support
Autodesk Support

If you named your dockable window with internal name "TestWindowInternalName" as was done in the above sample code, then this code will hide it:

Sub HideDockableWindow()
    Dim oUserInterfaceMgr As UserInterfaceManager
    Set oUserInterfaceMgr = ThisApplication.UserInterfaceManager

    Dim oWindow As DockableWindow
    Set oWindow = oUserInterfaceMgr.DockableWindows("TestWindowInternalName")
    
    oWindow.Visible = False
End Sub

Not sure what you mean by viewcube? :-s

 

Cheers,

 



Adam Nagy
Autodesk Platform Services

GeorgK
Advisor
Advisor

Hello Adam,

 

I could hide my dockable window now. I found the solution to hide the viewcube:

 

ThisApplication.CommandManager.ControlDefinitions.Item("AppViewCubeCmd").Execute

 

 

How could I get the internalname from other add-ins?

 

Thanks

 

Georg

0 Likes

adam.nagy
Autodesk Support
Autodesk Support
Accepted solution

Hi Georg,

 

have a look at the PrintCommandNames function here:

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

 

Cheers,



Adam Nagy
Autodesk Platform Services
0 Likes