Dockable window does not resize

Dockable window does not resize

JelteDeJong
Mentor Mentor
785 Views
9 Replies
Message 1 of 10

Dockable window does not resize

JelteDeJong
Mentor
Mentor

resizeNotWorking.pngIm creating an addin with a dockable window. It works fine but when the dockable window is floating it is not possible to rezise it anymore. (draging the edge does not work.)

i create the dockable window with the following code:

Form1 form = new Form1(inventor);

UserInterfaceManager uiMan = inventor.UserInterfaceManager;
docableWin = uiMan.DockableWindows.Add("###############", "###############", "###############");

docableWin.AddChild(form.Handle.ToInt64());
docableWin.Title = "SheetOverView";
docableWin.ShowTitleBar = true;
docableWin.DisabledDockingStates = DockingStateEnum.kDockBottom | DockingStateEnum.kDockTop;
docableWin.SetMinimumSize(200, 150);
if (!docableWin.IsCustomized)
{
    docableWin.DockingState = DockingStateEnum.kDockRight;
    docableWin.Visible = true;
}
form.Show();
docableWin.Visible = true;

any on has some idea why it does not work or what i can try to make it work.

Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Blog: hjalte.nl - github.com

0 Likes
786 Views
9 Replies
Replies (9)
Message 2 of 10

HideoYamada
Advisor
Advisor

Hello,

 

The Dockable Window which is created with follow code is resizable in my enviroment.

 

public void Activate(Inventor.ApplicationAddInSite addInSiteObject, bool firstTime)
{
    // 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;

    var inventor = m_inventorApplication;

    // TODO: Add ApplicationAddInServer.Activate implementation.
    // e.g. event initialization, command creation etc.

    //Form1 form = new Form1(inventor);
    Form form = new Form();
    form.BackColor = System.Drawing.SystemColors.Highlight;
    form.FormBorderStyle = FormBorderStyle.None;

    UserInterfaceManager uiMan = inventor.UserInterfaceManager;
    docableWin = uiMan.DockableWindows.Add("###############", "###############", "###############");

    docableWin.AddChild(form.Handle.ToInt64());
    docableWin.Title = "SheetOverView";
    docableWin.ShowTitleBar = true;
    docableWin.DisabledDockingStates = DockingStateEnum.kDockBottom | DockingStateEnum.kDockTop;
    docableWin.SetMinimumSize(200, 150);
    if (!docableWin.IsCustomized)
    {
        docableWin.DockingState = DockingStateEnum.kDockRight;
        docableWin.Visible = true;
    }
    form.Show();
    docableWin.Visible = true;
}

DockableWindow.png

 

If you can resize the dockable window with this code, the issue will be depending on Form1.

 

=====

Freeradical

 Hideo Yamada

=====
Freeradical
 Hideo Yamada
https://www.freeradical.jp
0 Likes
Message 3 of 10

JelteDeJong
Mentor
Mentor

Thank you for your reply but it did not get it to work. I used your code and created a new form (and did not change any thing on the form.) but it still does not resize. Do i need to change some properties of the form?

Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Blog: hjalte.nl - github.com

0 Likes
Message 4 of 10

HideoYamada
Advisor
Advisor

Hi,

 

I attached the source code and binary image to this post.

Try with this files and let me know it works properly or not.

 

=====

Freeradical

 Hideo Yamada

=====
Freeradical
 Hideo Yamada
https://www.freeradical.jp
Message 5 of 10

HideoYamada
Advisor
Advisor

The binary was compiled for Inventor 2020.

I recompiled for Inventor 2018 and attached to this post.

=====
Freeradical
 Hideo Yamada
https://www.freeradical.jp
0 Likes
Message 6 of 10

bradeneuropeArthur
Mentor
Mentor

Hi?

Have you tried the dockablewindowenents in inventor?

 

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 7 of 10

bradeneuropeArthur
Mentor
Mentor

Hi @JelteDeJong  I Think I found a solution for this.

Works at least for my dockableWindows.

Use the Inventor Application Events to set the Height for the Form or the Control in you DockableWindow!

 

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

Hope this explaining is sufficient?

Otherwise I will give you my complete code.

 

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 8 of 10

JelteDeJong
Mentor
Mentor

@bradeneuropeArthurI tryed your code and I tracked when the event is triggerd but it did not seem to be triggerd when the i tryed to resize the dockable window. So no luck with that event.

@HideoYamadaThank you for sending the example addin. Your example addin was also not resizing.

 

i discoverd that it is possible to resize my dockable window in the following way:

  • Undock the model browser
  • Put the model browser and my dockable window in the same frame.
  • Resize the model browser.
  • switch to my dockable window.
  • now its possible to resize......

that is far from how it is supposed to work. Im starting to wonder if the problem is my computer. (Also because the example of @HideoYamada does not work.) i will test this later on my job. If you have more ideas that they are still welcome. anyway i will keep you posted

 

Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Blog: hjalte.nl - github.com

0 Likes
Message 9 of 10

bradeneuropeArthur
Mentor
Mentor

Hi @JelteDeJong 

For me also that works.

I can take the DockableWindow (Floating) also this resizes correctly...

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 10

HideoYamada
Advisor
Advisor

Hi,

 


If you have more ideas that they are still welcome.

Have you already tried empty dockable window?

 

public void Activate(Inventor.ApplicationAddInSite addInSiteObject, bool firstTime)
{
    m_inventorApplication = addInSiteObject.Application;
    var inventor = m_inventorApplication;

    UserInterfaceManager uiMan = inventor.UserInterfaceManager;
    docableWin = uiMan.DockableWindows.Add("###############", "###############", "###############");

    docableWin.Title = "SheetOverView";
    docableWin.ShowTitleBar = true;
    docableWin.DisabledDockingStates = DockingStateEnum.kDockBottom | DockingStateEnum.kDockTop;
    docableWin.SetMinimumSize(200, 150);
    if (!docableWin.IsCustomized)
    {
        docableWin.DockingState = DockingStateEnum.kDockRight;
        docableWin.Visible = true;
    }
    docableWin.Visible = true;
}

Or, more simply :

public void Activate(Inventor.ApplicationAddInSite addInSiteObject, bool firstTime)
{
    m_inventorApplication = addInSiteObject.Application;
    var inventor = m_inventorApplication;

UserInterfaceManager uiMan = inventor.UserInterfaceManager; docableWin = uiMan.DockableWindows.Add("###############", "###############", "###############"); docableWin.Visible = true; }

 

Do you have other dockable window which you made and the client-id (first arg of Add Method) is same as test code ("###############") ?

 

=====

Freeradical

 Hideo Yamada

=====
Freeradical
 Hideo Yamada
https://www.freeradical.jp
0 Likes