Navisworks API

Navisworks API

Reply
Active Contributor
ngombault
Posts: 45
Registered: ‎11-14-2012
Message 1 of 10 (267 Views)

dockpaneplugin: panel truncated if docked when the application starts

267 Views, 9 Replies
01-07-2013 11:14 PM

Hi,

 

I wrote a dockpaneplugin and its panel gets truncated if it was docked when navisworks started:

- when I first lauch the command the panel is displayed and everything works fine

- I can dock and undock it with anyother window, it works fine

- if I close the application with the panel docked, and re open Naviswork, then the panel is truncated of a couple centimeters, with no (sufficient) scroll bar to see it completly

 

I set all control on the panel to either dock or anchored to sides, the form is on Autosize, the plugin attributes are as follow:

 

<DockPanePlugin(310, 225, FixedSize:=False, AutoScroll:=True, MinimumWidth:=310, MinimumHeight:=225)>

 

What am I missing?

 

thanks

Nic

ADN Support Specialist
xiaodong.liang
Posts: 1,271
Registered: ‎06-12-2011
Message 2 of 10 (254 Views)

Re: dockpaneplugin: panel truncated if docked when the application starts

01-10-2013 10:57 PM in reply to: ngombault

Hi,

 

I used this line with the demo of my dock pane plugin, opened Navisworks and docked the window. And I closed Navisworks , reopened it. The dock pane window is same. not truncated.  

 

I also changed the size of the dock pane windows (assume the controls are anchored) intentionally, closed Navisworks and opened it. All works well.

 

Could you share a small demo project to show the problem?

 

In addition, I am testing with 2013. 



Xiaodong Liang
Developer Technical Services
Autodesk Developer Network

Active Contributor
ngombault
Posts: 45
Registered: ‎11-14-2012
Message 3 of 10 (249 Views)

Re: dockpaneplugin: panel truncated if docked when the application starts

01-11-2013 05:06 AM in reply to: xiaodong.liang

Here you go;

 

I am running Navis manage 2013 too.

 

I isolated only the piece of code you need to reproduce the issue; the panel gets truncated a bit less than the other one I have but still loses some space on the right.

 

so to reproduce:

- unzip docktest_dllfornavis and put it in Navis plugin folder

- start Navis, goto Addin, start "Display Name"

- see how the space between the comboboxes and the form borders is equal on both sides

- dock it, restart navis

-> the panel shold be truncated to the right

 

PS: I change the extension of the file from .rar to .bmp otherwise the forum wouldn't let me upload it; you need to change it back. Let me know if you'd rather have me paste the code in the text window (kind of anoying with dockpane plugin as it requires 3 classes)

 

Thanks,

-Nic

 

ADN Support Specialist
xiaodong.liang
Posts: 1,271
Registered: ‎06-12-2011
Message 4 of 10 (237 Views)

Re: dockpaneplugin: panel truncated if docked when the application starts

01-14-2013 02:15 AM in reply to: ngombault

Hi,

 

I setup an enviorment with VS2012 and Nw 2013. I built your plugin and it worked well. Could you check my test video?

http://sdrv.ms/13utRCp



Xiaodong Liang
Developer Technical Services
Autodesk Developer Network

Active Contributor
ngombault
Posts: 45
Registered: ‎11-14-2012
Message 5 of 10 (232 Views)

Re: dockpaneplugin: panel truncated if docked when the application starts

01-16-2013 01:31 AM in reply to: xiaodong.liang

Hi,

 

I think the panel is already truncated the first time you load Navis. Maybe you closed Navis with the panel docked already before you built your solution (started your video).

 

Try to:

1. Undock it > close it > then close Navis.

2. Rebuild the plugin > copy the dll like you did > Open Navis

You should have the exact same space between the combobox and the form borders on both side (your video shows the right border is touching the combobox)

 

3. Now dock the panel > close Navis

4. Reopen Navis

The panel is truncated on the right side (with this example, of only a few pixels, but I have another sample where I loose something like 15 to 25 pts on the right)

ADN Support Specialist
xiaodong.liang
Posts: 1,271
Registered: ‎06-12-2011
Message 6 of 10 (220 Views)

Re: dockpaneplugin: panel truncated if docked when the application starts

01-17-2013 11:47 PM in reply to: ngombault

Hi,

 

yes,  the first time I saw your dockpane window is  the right border is touching the combobox, but not truncted. And in the first time, it is NOT docked. So I just docked it and restart Navisworks to see if there is any difference. 

 

I do not remember clearly how it looks in the designer of VS. I will take a look at it soon.



Xiaodong Liang
Developer Technical Services
Autodesk Developer Network

Active Contributor
ngombault
Posts: 45
Registered: ‎11-14-2012
Message 7 of 10 (212 Views)

Re: dockpaneplugin: panel truncated if docked when the application starts

01-20-2013 02:07 PM in reply to: xiaodong.liang

Hi,

 

I investigated further, and the issue is linked to having control on the form that are anchored both sides; dock (fill, top, bottom...) works fine but anchor produce these truncated results.

 

So far I have on way around, it is to first put a docked split container with panel2.collapsed set to true, and put all my controls in panel1. I tried with a simple panel but it wasn't fixing the issue, the split container does the job.

 

Let me know if you find anything else.

 

-Nic

ADN Support Specialist
xiaodong.liang
Posts: 1,271
Registered: ‎06-12-2011
Message 8 of 10 (204 Views)

Re: dockpaneplugin: panel truncated if docked when the application starts

01-21-2013 09:19 PM in reply to: ngombault

Hi,

 

I spent some time to test.

 

Firstly, to clarify: using your plugin, in VS designer of the user control, the right border is not touching the ComboBox. When I tested last time, in the first launching, the right border has started to touch the ComboBox, i.e. the distance between the border and ComboBox became much smaller than designer,  but still not truncated (that was why I have a memory the border is touching the BomboBox). While in the second time, it the status is same. So I thought no change.

 

After I removed plugin, rebuilt and re-deployed, I can obviously see the problem you saw. I cannot see what I tested last time any more :-( I also found:  without Anchoring to right, the issue does not occur. However this means the ComboBox will not resize when window changing size. This is not what you expected.

 

Since in the first message I cannot reproduce with SDK sample, I turned to dig into it. It is written in C#. I tried to add Anchoring like you code. I also tried to create a VB.NET project with your codes. The result is same: the ComboBox does not resize when window changing size.  As the two are built in VS2010 (.NET framework 4.0), I started to suspect the framework. So I switched your VS2012 project from 4.5 to 4.0. The result is same to VS2010, i.e. the ComboBox does not resize when window changing size anymore.

 

Sorry I did not find a solution so far. It is time to report these behaviors with our engineer team.

 



Xiaodong Liang
Developer Technical Services
Autodesk Developer Network

New Member
alital
Posts: 1
Registered: ‎03-04-2013
Message 9 of 10 (149 Views)

Re: dockpaneplugin: panel truncated if docked when the application starts

03-04-2013 03:44 PM in reply to: ngombault

I just wanted to add if you've tried adding all the form contents to a table layout panel? I usually add a tabled layout panel which is docked to the usercontrol and never had any issues with resizing whether docked or not

Active Contributor
ngombault
Posts: 45
Registered: ‎11-14-2012
Message 10 of 10 (146 Views)

Re: dockpaneplugin: panel truncated if docked when the application starts

03-04-2013 04:01 PM in reply to: alital

Thanks for the reply.

 

I didn't know about the TableLayoutPanel, I gave it a short try, but I find the layout functionality too restrictive compare to simple Panels.

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.