WPF ViewControl Error

WPF ViewControl Error

Anonymous
Not applicable
834 Views
2 Replies
Message 1 of 3

WPF ViewControl Error

Anonymous
Not applicable

Hi,

 

I'm brand new to NavisWorks development and I'm having an issue getting the ViewControl to work in a WPF application. I've tried to use the sample app in the SDK and also build my own from scratch. Both give the following error:-

 

The name "ViewControl" does not exist in the namespace "clr-namespace:Autodesk.Navisworks.Api.Controls;assembly=Autodesk.Navisworks.Controls". 

 

I'm using Windows 10 64 bit with the anniversary update and the 2017 version of the SDK.

 

Does anyone have any ideas?

 

Thanks,

 

Geoff

0 Likes
835 Views
2 Replies
Replies (2)
Message 2 of 3

xiaodong_liang
Autodesk Support
Autodesk Support
Hi Geoff,

I guess you hit a the related issue that is mentioned in the other post, i.e. Viewer control in release 2017 cannot work. The issue has been addressed and a fix would be probably available with SP1.
http://forums.autodesk.com/t5/navisworks-api/confusing-navisworks-api-not-licensed-error/td-p/643067...

In another word, it should not be a problem with WPF, but Viewer control itself.
Message 3 of 3

Anonymous
Not applicable

hi please Try this:

use in xml code :

 

<WindowsFormsHost x:Name="mFormsHost" >

<!--<NwControls:ViewControl x:Uid="viewControl"
x:Name="viewControl"
Dock="Fill" />-->

</WindowsFormsHost>

 

and in c# code:

after

InitializeComponent();


var viewControl = new Autodesk.Navisworks.Api.Controls.ViewControl();
viewControl.Name = "viewControl";
viewControl.Dock= System.Windows.Forms.DockStyle.Fill;
mFormsHost.Child = viewControl;
viewControl.DocumentControl = " your Document for example oDoc"

0 Likes