Add SavedView using API

Add SavedView using API

JanneTS
Contributor Contributor
945 Views
4 Replies
Message 1 of 5

Add SavedView using API

JanneTS
Contributor
Contributor

Is it possible to add a SavedView using API? Tried the code below but it crashes NavisWorks

 

           ComApi.InwOpState10 oState = ComApiBridge.ComApiBridge.State;

           object CView = oState.CurrentView.Copy();

           oState.SavedViews().Add(CView);

0 Likes
946 Views
4 Replies
Replies (4)
Message 2 of 5

JanneTS
Contributor
Contributor

OK, got it

 

SavedViews().Add wants an InwOpView, not an InwOpAnonView

0 Likes
Message 3 of 5

JanneTS
Contributor
Contributor

Creating the SavedView and setting the ViewPoint of the InwOpAnonView work OK.

However,

ClippingPlanes().Add(InwLPlane3f)

of the InwOpAnonView creates an exception

"<<NavisWorks Error - Not implemented>>"

 

what does this mean?

 

0 Likes
Message 4 of 5

JanneTS
Contributor
Contributor
Seems to me that adding a section plane using API is just impossible. Can anybody confirm this, that would help a lot?
0 Likes
Message 5 of 5

Anonymous
Not applicable

Hi

 

Did you have any success with this? I think we are tackling the same issue.

 

//gets current View
nw.InwOpAnonView view = _state.CurrentView.Copy() as nw.InwOpAnonView;

//how to apply this view?
_state.ApplyView(view); //this fails as it wants a InwOpView

 

 

0 Likes