Dockable windows - show and hide

Dockable windows - show and hide

GeorgK
Advisor Advisor
1,159 Views
5 Replies
Message 1 of 6

Dockable windows - show and hide

GeorgK
Advisor
Advisor

Hello together,

 

how could I show and hide dockable windows via API?

 

Thanks

 

Georg

0 Likes
Accepted solutions (1)
1,160 Views
5 Replies
Replies (5)
Message 2 of 6

EelcoWiggers
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

Message 3 of 6

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
Message 4 of 6

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
Message 5 of 6

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
Message 6 of 6

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