how to make dockable window align below main browser exactly?

how to make dockable window align below main browser exactly?

liminma8458
Collaborator Collaborator
2,358 Views
21 Replies
Message 1 of 22

how to make dockable window align below main browser exactly?

liminma8458
Collaborator
Collaborator

Hi, all,

I want to create a dockable window which locates below and align exactly with the main browser, as shown in the picture, how can I define it?

liminma8458_0-1626704634238.png

I used code below, but it does not locate the dockable window as expected.

Dim selection_Wnd As DockableWindow
selection_Wnd = ThisApplication.UserInterfaceManager.DockableWindows.Add(m_ClientID, "selection_dock_Wnd", "Selection")
selection_Wnd.DisabledDockingStates = DockingStateEnum.kDockBottom
 'Create propertyGrid control
 oPropertyGrid = New PropertyGrid()
 'Add propertyGrid to dockable window
 selection_Wnd.AddChild(oPropertyGrid.Handle)
 selection_Wnd.Visible = True

 

Anyone can help?

 

Thanks
Limin
Inventor pro 2023 64 bit update 5.3; Windows 11 pro 64 bit version 24H2; Office 2013 64 bit

Download iCable in App Store to Create Cables Easily

0 Likes
Accepted solutions (1)
2,359 Views
21 Replies
Replies (21)
Message 2 of 22

bradeneuropeArthur
Mentor
Mentor

Where is it located then, if not correct position?

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 3 of 22

liminma8458
Collaborator
Collaborator

It is on the side of browser.

liminma8458_0-1626706935378.png

 

I want it to be below the browser and align with it

Thanks
Limin
Inventor pro 2023 64 bit update 5.3; Windows 11 pro 64 bit version 24H2; Office 2013 64 bit

Download iCable in App Store to Create Cables Easily

0 Likes
Message 4 of 22

bradeneuropeArthur
Mentor
Mentor

And if you place it correct and use this
My_DockableWindow.DockingState = DockingStateEnum.kDockLastKnown

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 5 of 22

liminma8458
Collaborator
Collaborator

No. I tried it and it still locates on the side.

Actually, when the dockable window is on the side, you can drag it but you can not make if locate below and align with main browser exactly vertically. code as below:

 

selection_Wnd = ThisApplication.UserInterfaceManager.DockableWindows.Add(m_ClientID, "selection_dock_Wnd", "Selection")
selection_Wnd.DockingStates = DockingStateEnum.kDockBottom

'selection_Wnd.DockingStates == DockingStateEnum.kDockLastKnown
'Create propertyGrid control
oPropertyGrid = New PropertyGrid()
'Add propertyGrid to dockable window
selection_Wnd.AddChild(oPropertyGrid.Handle)
selection_Wnd.Visible = True

Thanks
Limin
Inventor pro 2023 64 bit update 5.3; Windows 11 pro 64 bit version 24H2; Office 2013 64 bit

Download iCable in App Store to Create Cables Easily

0 Likes
Message 6 of 22

bradeneuropeArthur
Mentor
Mentor

What if you give the window a fix height?

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 7 of 22

liminma8458
Collaborator
Collaborator

I will not care about the height of the dockable window. I just want the width of dockable window will aligh with and match to the width of the default browser, and locate below it.

Thanks
Limin
Inventor pro 2023 64 bit update 5.3; Windows 11 pro 64 bit version 24H2; Office 2013 64 bit

Download iCable in App Store to Create Cables Easily

0 Likes
Message 8 of 22

bradeneuropeArthur
Mentor
Mentor

I understand that.

But if you have a fix small height , my idea was that it will be positioned.

You understand?

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 9 of 22

bradeneuropeArthur
Mentor
Mentor

For me that works.

I am now on Inventor 2022

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 10 of 22

liminma8458
Collaborator
Collaborator

Hi, B

Thanks
Limin
Inventor pro 2023 64 bit update 5.3; Windows 11 pro 64 bit version 24H2; Office 2013 64 bit

Download iCable in App Store to Create Cables Easily

0 Likes
Message 11 of 22

bradeneuropeArthur
Mentor
Mentor

I am in the office right now where I work with Inventor 2018 and there it works too.

Please send me the complete add in (vb.net project files) to test it here!

bradeneuropeArthur_0-1626761944195.png

 

Regards,

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 12 of 22

liminma8458
Collaborator
Collaborator

I just simply create a button on the ribbon to call the dockable window:

      Private Sub m_button_dockable_property_OnExecute(ByVal Context As Inventor.NameValueMap) Handles m_button_dockable_property.OnExecute

            Dim selection_Wnd As DockableWindow

            selection_Wnd = ThisApplication.UserInterfaceManager.DockableWindows.Add(m_ClientID, "selection_dock_Wnd", "Selection")

            selection_Wnd.ShowVisibilityCheckBox = True

            'selection_Wnd.DisabledDockingStates = DockingStateEnum.kFloat + DockingStateEnum.kDockLeft + DockingStateEnum.kDockRight + DockingStateEnum.kDockTop

            selection_Wnd.DockingStates = DockingStateEnum.kDockBottom

            selection_Wnd.Height = 200

            'Create propertyGrid control

            oPropertyGrid = New PropertyGrid()

            selection_Wnd.AddChild(oPropertyGrid.Handle)

            selection_Wnd.Visible = True

        End Sub

 

I ever tried to put a form beneath the browserpane as you did. But it does not align well. how do you do that. And if the browser get drag wider and narrower, does the dockable form follow (such as having a horizontal scroll bar automatically)?

Thank you in advance

Thanks
Limin
Inventor pro 2023 64 bit update 5.3; Windows 11 pro 64 bit version 24H2; Office 2013 64 bit

Download iCable in App Store to Create Cables Easily

0 Likes
Message 13 of 22

bradeneuropeArthur
Mentor
Mentor

Please see the movie how it works here!

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 14 of 22

liminma8458
Collaborator
Collaborator

It will be very appreciated if you can share how to set up in code to do this.

Thanks
Limin
Inventor pro 2023 64 bit update 5.3; Windows 11 pro 64 bit version 24H2; Office 2013 64 bit

Download iCable in App Store to Create Cables Easily

0 Likes
Message 15 of 22

bradeneuropeArthur
Mentor
Mentor

I will tomorrow.

Please send me a private message 

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 16 of 22

bradeneuropeArthur
Mentor
Mentor

I use it without button maybe that is already the case.

 

Maybe it is easier that you send me the add in files complete so that I can add my code to it.

Otherwise you can use my code:

Imports Inventor
Imports System.Runtime.InteropServices
Imports Microsoft.Win32
Imports System.Windows.Forms

Namespace KnoorsInventorToolsDockableWindow
    <ProgIdAttribute("######.StandardAddInServer"), _
    GuidAttribute("#####")> _
    Public Class StandardAddInServer
        Implements Inventor.ApplicationAddInServer

        ' Inventor application object.
        Private m_inventorApplication As Inventor.Application
        Private m_ClientID As String
        Public m_Form As StartFormulier

        Public My_DockableWindow As DockableWindow

        Private WithEvents oInteraction As InteractionEvents
        Private WithEvents oUserInputEvents As UserInputEvents
        Private WithEvents m_AppEvents As Inventor.ApplicationEvents
        Private WithEvents oUserInterfaceEvents As UserInterfaceEvents

        Private WithEvents oSelectEvents As SelectEvents
        Private WithEvents oMouseEvents As MouseEvents
        Private WithEvents oKeyPress As KeyboardEvents
        Private WithEvents oAppEvents As ApplicationEvents
        Private WithEvents oModelingEvents As ModelingEvents
        Private WithEvents oDocEvents As DocumentEvents
        Private WithEvents oDockableWindowsEvents As DockableWindowsEvents
        Private WithEvents oDockableWindowsSinkEvents As DockableWindowsEventsSink_Event

        Private WithEvents M_LargeButtonDefinition As ButtonDefinition
        Private WithEvents M_SmallButtonDefinition As ButtonDefinition

#Region "ApplicationAddInServer Members"

        Public ReadOnly Property InventorApplication As Inventor.Application
            Get
                Return m_inventorApplication
            End Get
        End Property

        Public Sub Activate(ByVal addInSiteObject As Inventor.ApplicationAddInSite, ByVal firstTime As Boolean) Implements Inventor.ApplicationAddInServer.Activate
            'MsgBox("sdfsfdsf")
            ' This method is called by Inventor when it loads the AddIn.
            ' The AddInSiteObject provides access to the Inventor Application object.
            ' The FirstTime flag indicates if the AddIn is loaded for the first time.

            ' Initialize AddIn members.
            m_inventorApplication = addInSiteObject.Application
            m_ClientID = AddInGuid(GetType(StandardAddInServer))

            SetupUserInterface(addInSiteObject, firstTime, m_ClientID)

            My_DockableWindow = m_inventorApplication.UserInterfaceManager.DockableWindows.Add(m_ClientID, m_ClientID, "Kit (Bom Info)")
            My_DockableWindow.Visible = False
            m_Form = New StartFormulier(m_inventorApplication, My_DockableWindow)

            My_DockableWindow.AddChild(m_Form.Handle.ToInt64)
            My_DockableWindow.DockingState = DockingStateEnum.kDockLastKnown

            My_DockableWindow.Width = 208
            My_DockableWindow.SetMinimumSize(200, 208)
            My_DockableWindow.Visible = False

            m_AppEvents = m_inventorApplication.ApplicationEvents

            oUserInputEvents = m_inventorApplication.CommandManager.UserInputEvents
            oUserInterfaceEvents = m_inventorApplication.UserInterfaceManager.UserInterfaceEvents
            oInteraction = m_inventorApplication.CommandManager.CreateInteractionEvents
            oAppEvents = m_inventorApplication.ApplicationEvents
            oModelingEvents = m_inventorApplication.ModelingEvents
            oDockableWindowsEvents = m_inventorApplication.UserInterfaceManager.DockableWindows.Events
            oDockableWindowsSinkEvents = m_inventorApplication.UserInterfaceManager.DockableWindows.Events
            oInteraction.Start()

            oSelectEvents = oInteraction.SelectEvents
            oMouseEvents = oInteraction.MouseEvents
            oKeyPress = oInteraction.KeyboardEvents

        End Sub

        Public Sub Deactivate() Implements Inventor.ApplicationAddInServer.Deactivate

            ' This method is called by Inventor when the AddIn is unloaded.
            ' The AddIn will be unloaded either manually by the user or
            ' when the Inventor session is terminated.

            ' TODO:  Add ApplicationAddInServer.Deactivate implementation

            ' Release objects.
            Marshal.ReleaseComObject(m_inventorApplication)
            m_inventorApplication = Nothing
            m_Form = Nothing
            My_DockableWindow.DockingState = DockingStateEnum.kDockLastKnown
            My_DockableWindow = Nothing

            m_AppEvents = Nothing
            oUserInputEvents = Nothing
            oUserInterfaceEvents = Nothing
            oInteraction = Nothing
            oAppEvents = Nothing
            oModelingEvents = Nothing
            oDockableWindowsEvents = Nothing
            oDockableWindowsSinkEvents = Nothing
            oSelectEvents = Nothing
            oMouseEvents = Nothing
            oKeyPress = Nothing

            System.GC.WaitForPendingFinalizers()
            System.GC.Collect()

        End Sub

        Public ReadOnly Property Automation() As Object Implements Inventor.ApplicationAddInServer.Automation

            ' This property is provided to allow the AddIn to expose an API 
            ' of its own to other programs. Typically, this  would be done by
            ' implementing the AddIn's API interface in a class and returning 
            ' that class object through this property.

            Get
                Return Nothing
            End Get

        End Property

        Public Sub ExecuteCommand(ByVal commandID As Integer) Implements Inventor.ApplicationAddInServer.ExecuteCommand

            ' Note:this method is now obsolete, you should use the 
            ' ControlDefinition functionality for implementing commands.

        End Sub

#End Region


        Public Shared ReadOnly Property AddInGuid(ByVal t As Type) As String
            Get
                Dim guid As String = ""
                Try
                    Dim customAttributes() As Object = t.GetCustomAttributes(GetType(GuidAttribute), False)
                    Dim guidAttribute As GuidAttribute = CType(customAttributes(0), GuidAttribute)
                    guid = "{" + guidAttribute.Value.ToString() + "}"
                Finally
                    AddInGuid = guid
                End Try
            End Get
        End Property

        Public Sub SetupUserInterface(ByVal addInSiteObject As Inventor.ApplicationAddInSite, ByVal firstTime As Boolean, ClientID As String)

            If firstTime And addInSiteObject.Application.UserInterfaceManager.InterfaceStyle = InterfaceStyleEnum.kRibbonInterface Then

            ElseIf firstTime And addInSiteObject.Application.UserInterfaceManager.InterfaceStyle = InterfaceStyleEnum.kClassicInterface Then
                MsgBox("classic Interface")
            Else
                MsgBox("unknown Interface")
            End If

        End Sub


        Private Sub m_AppEvents_OnActivateDocument(ByVal DocumentObject As Inventor._Document, ByVal BeforeOrAfter As Inventor.EventTimingEnum, ByVal Context As Inventor.NameValueMap, ByRef HandlingCode As Inventor.HandlingCodeEnum) Handles m_AppEvents.OnActivateDocument

            'ONLY DEFINE THE LAYOUT OF THE FORM HERE
            'DON'T READ ANY PROPERTIES SINCE THE ADD IN IS BASED ON THE ACTIVE EDIT DOCUMENT.
            If BeforeOrAfter = EventTimingEnum.kAfter Then

                If DocumentObject.DocumentType = DocumentTypeEnum.kDrawingDocumentObject Then
                    m_Form.GbGenSpecProps.Hide()
                    m_Form.GbCompSpecProps.Hide()
                    m_Form.GbKeys.Hide()

                    MdlPropertyValuesFillIn.PropertyValuesFillIn(m_inventorApplication, m_Form)
                    MdlInitializeStartFormulier.InitializeStartFormulier(m_Form, DocumentObject)

                ElseIf DocumentObject.DocumentType = DocumentTypeEnum.kAssemblyDocumentObject Then
                    m_Form.GbGenSpecProps.Show()
                    m_Form.GbCompSpecProps.Show()
                    m_Form.GbKeys.Hide()

                ElseIf DocumentObject.DocumentType = DocumentTypeEnum.kPartDocumentObject Then
                    m_Form.GbGenSpecProps.Show()
                    m_Form.GbCompSpecProps.Show()

                    m_Form.GbKeys.Show()

                End If


                m_Form.Show()
            End If

        End Sub

        Private Sub m_AppEvents_OnDocumentChange(DocumentObject As _Document, BeforeOrAfter As EventTimingEnum, ReasonsForChange As CommandTypesEnum, Context As NameValueMap, ByRef HandlingCode As HandlingCodeEnum) Handles m_AppEvents.OnDocumentChange

            If BeforeOrAfter = EventTimingEnum.kAfter Then

                If ReasonsForChange = 1 Then
                    If DocumentObject.DocumentType = DocumentTypeEnum.kDrawingDocumentObject Then

                        Try
                            MdlListModelKeys.ListModelKeys(DocumentObject, m_Form)
                        Catch ex As Exception

                        End Try

                    End If
                End If

                MdlPropertyValuesFillIn.PropertyValuesFillIn(m_inventorApplication, m_Form)

            End If

        End Sub

        Private Sub m_AppEvents_OnNewEditObject(EditObject As Object, BeforeOrAfter As EventTimingEnum, Context As NameValueMap, ByRef HandlingCode As HandlingCodeEnum) Handles m_AppEvents.OnNewEditObject

            Dim DocumentObject As Document = Nothing

            Try
                DocumentObject = TryCast(EditObject, Document)

            Catch ex As Exception

            End Try

            If BeforeOrAfter = EventTimingEnum.kAfter Then

                If DocumentObject.DocumentType = DocumentTypeEnum.kDrawingDocumentObject Then
                    m_Form.GbGenSpecProps.Hide()
                    m_Form.GbCompSpecProps.Hide()
                    m_Form.GbKeys.Hide()
                ElseIf DocumentObject.DocumentType = DocumentTypeEnum.kAssemblyDocumentObject Then
                    m_Form.GbGenSpecProps.Show()
                    m_Form.GbCompSpecProps.Show()
                    m_Form.GbKeys.Hide()
                ElseIf DocumentObject.DocumentType = DocumentTypeEnum.kPartDocumentObject Then
                    m_Form.GbGenSpecProps.Show()
                    m_Form.GbCompSpecProps.Show()

                    m_Form.GbKeys.Show()

                    Try
                        MdlListModelKeys.ListModelKeys(DocumentObject, m_Form)
                    Catch ex As Exception

                    End Try


                End If

                MdlPropertyValuesFillIn.PropertyValuesFillIn(m_inventorApplication, m_Form)
                MdlInitializeStartFormulier.InitializeStartFormulier(m_Form, DocumentObject)
                My_DockableWindow.Visible = True

            End If
        End Sub



        Private Sub m_AppEvents_OnSaveDocument(DocumentObject As _Document, BeforeOrAfter As EventTimingEnum, Context As NameValueMap, ByRef HandlingCode As HandlingCodeEnum) Handles m_AppEvents.OnSaveDocument

            If DocumentObject.FileSaveCounter = 1 Then
                If BeforeOrAfter = EventTimingEnum.kAfter Then

                    If DocumentObject.DocumentType = DocumentTypeEnum.kDrawingDocumentObject Then
                        m_Form.GbGenSpecProps.Hide()
                        m_Form.GbCompSpecProps.Hide()
                        m_Form.GbKeys.Hide()

                    ElseIf DocumentObject.DocumentType = DocumentTypeEnum.kAssemblyDocumentObject Then
                        m_Form.GbGenSpecProps.Show()
                        m_Form.GbCompSpecProps.Show()
                        m_Form.GbKeys.Hide()
                    ElseIf DocumentObject.DocumentType = DocumentTypeEnum.kPartDocumentObject Then
                        m_Form.GbGenSpecProps.Show()
                        m_Form.GbCompSpecProps.Show()
                        m_Form.GbKeys.Show()
                        MdlListModelKeys.ListModelKeys(DocumentObject, m_Form)

                    End If

                    MdlPropertyValuesFillIn.PropertyValuesFillIn(m_inventorApplication, m_Form)
                    MdlInitializeStartFormulier.InitializeStartFormulier(m_Form, DocumentObject)

                    m_Form.Show()
                End If
            End If
            '
        End Sub

        Private Sub m_AppEvents_OnCloseDocument(DocumentObject As _Document, FullDocumentName As String, BeforeOrAfter As EventTimingEnum, Context As NameValueMap, ByRef HandlingCode As HandlingCodeEnum) Handles m_AppEvents.OnCloseDocument
            If BeforeOrAfter = EventTimingEnum.kAfter Then
                If m_inventorApplication.ActiveDocument Is Nothing Then

                    My_DockableWindow.Visible = False

                Else
                End If
            End If

        End Sub

        Private Sub m_AppEvents_OnActivateView(ViewObject As Inventor.View, BeforeOrAfter As EventTimingEnum, Context As NameValueMap, ByRef HandlingCode As HandlingCodeEnum) Handles m_AppEvents.OnActivateView
            If BeforeOrAfter = EventTimingEnum.kAfter Then
                m_Form.Height = My_DockableWindow.Height
            End If

        End Sub

        Protected Overrides Sub Finalize()
            MyBase.Finalize()
        End Sub

    End Class

End Namespace

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 17 of 22

liminma8458
Collaborator
Collaborator

Hi, bradeneuropeArthur,

There is not a StartFormulier form in your code. I can't test it through.

Attached is code for a fully-work register-free addin. It will add a button in "Tools" tab in Part environment. Click the button will create a dockable window. Can you figure out how to put the dockable window under main browserpane?

Thanks
Limin
Inventor pro 2023 64 bit update 5.3; Windows 11 pro 64 bit version 24H2; Office 2013 64 bit

Download iCable in App Store to Create Cables Easily

0 Likes
Message 18 of 22

bradeneuropeArthur
Mentor
Mentor

I will have a look!

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 19 of 22

bradeneuropeArthur
Mentor
Mentor

Hi,

 

Change this and it will work.

At least by me it works.

'from UI_demo, mod_dock_window
Imports Inventor
Public Class cls_dock_window
    Dim ThisApplication As Inventor.Application
    Public oWindow As Inventor.DockableWindow
    'Public IsBrowserVisible As Boolean = True
    'Public DockHeight As Long = 500
    'Public dockWidth As Long = 350
    'Public DockShown As Boolean = False
    'Public DockShown As Boolean = True
    'Private InitialDockHeight As Long = 30
    'Private InitialDockWidth As Long = 30
    'Public InAction As Boolean = False
    'Public InAction As Boolean = True
    'Private addInCLSIDString As String
    'Private dc As Test01
    Private dc As form_dockable

    Public Sub New(AppObj As Application)
        ThisApplication = AppObj
    End Sub

    Public Sub SetDockableWindow(ByVal addInCLS As String)
        Try
            'Dim oUserInterfaceMgr As Inventor.UserInterfaceManager = AddinGlobal.InventorApp.UserInterfaceManager

            Dim oUserInterfaceMgr As Inventor.UserInterfaceManager = ThisApplication.UserInterfaceManager

            oWindow = oUserInterfaceMgr.DockableWindows.Add(addInCLS, "AutoSheetDockWindow", "Auto Sheets")
            oWindow.AddChild(CreateChildDialog())
            oWindow.DisabledDockingStates = DockingStateEnum.kDockTop + DockingStateEnum.kDockBottom

            'oWindow.Visible = False 'Dont show the window on loading. Set to True to show on startup
            oWindow.Visible = True
        Catch ex As Exception
            MsgBox("There is problem in SetDockableWindow" & vbCrLf & vbCrLf & ex.Message & vbCrLf & vbCrLf & ex.StackTrace & vbCrLf & vbCrLf & ex.ToString)
        End Try
    End Sub
    Public Function CreateChildDialog() As Long
        CreateChildDialog = Nothing

        Try
            'Dim dc As Object
            If Not dc Is Nothing Then
                dc.Dispose()
                dc = Nothing
            End If
            dc = New form_dockable(ThisApplication)
            'dc.Show(New WindowWrapper(AddinGlobal.InventorApp.MainFrameHWND))
            'New addin_sub_func.WindowWrapper(ThisApplication.MainFrameHWND)
            dc.Show(New WindowWrapper(ThisApplication.MainFrameHWND))
            'MsgBox(dc.Handle.ToInt64())
            Return dc.Handle.ToInt64()

        Catch ex As Exception
            MsgBox("There is problem in CreateChildDialog" & vbCrLf & vbCrLf & ex.Message & vbCrLf & vbCrLf & ex.StackTrace & vbCrLf & vbCrLf & ex.ToString)
        End Try
    End Function

    Public Sub DockableWindow()
        Try
            Dim oUserInterfaceMgr As UserInterfaceManager
            oUserInterfaceMgr = ThisApplication.UserInterfaceManager

            Dim oWindow As DockableWindow
            'Dim i As Integer

            For Each oWindow In oUserInterfaceMgr.DockableWindows
                If oWindow.Caption = "Cable Information" Then
                    oWindow.Delete()
                End If

                'Debug.Print oWindow.Caption & "    internal name: " & oWindow.InternalName
            Next

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

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

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

            'oWindow.DisabledDockingStates = DockingStateEnum.kDockTop + DockingStateEnum.kDockRight

            'oWindow.DockingState = DockingStateEnum.kDockRight
            'oWindow.DockingState = DockingStateEnum.kDockLeft
            'oWindow.DockingState = DockingStateEnum.kDockBottom

            'mean last known its own location
            oWindow.DockingState = DockingStateEnum.kDockLastKnown

            'DockingStateEnum.kDockTop + DockingStateEnum.kDockBottom
            ' Make the window visible

            oWindow.Visible = True

        Catch ex As Exception
            MsgBox("There is problem in CreateChildDialog()" & vbCrLf & vbCrLf & ex.Message & vbCrLf & vbCrLf & ex.StackTrace & vbCrLf & vbCrLf & ex.ToString,, "Information")
        End Try
    End Sub

End Class

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 20 of 22

liminma8458
Collaborator
Collaborator

It does NOT locate below the browser in my Inventor 2019

Thanks
Limin
Inventor pro 2023 64 bit update 5.3; Windows 11 pro 64 bit version 24H2; Office 2013 64 bit

Download iCable in App Store to Create Cables Easily

0 Likes