I want to get and set viewpoint value using COM API.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am trying to make an independent programme (NOT PLUG-IN) taking a current viewpoint's xyz coordinates (Position and Look At in NW-Viewpoint Tab-Camera) and applying new-user-defined coordinate values (New Position and New Look At), by using COM API.
And I have reached this much as I could get the xyz coordinates of current viewpoint and current target point (Current View X,Y,Z + GetViewDir().data1,2,3 * FocalDistance), and apply new textbox's text value to each CurrnetView.ViewPoint.Camera.Position.data1,2,3 of an InwOpState,
BUT COULD NOT TO NEW LOOK AT whose code is like below.
using NavisworksAutomationAPI11;
using NavisworksIntegratedAPI11;
InwOpState10 NWState;
NWState.CurrentView.ViewPoint.Camera.Position.data1 = Convert.ToDouble(textBox1.Text); //Applied
NWState.CurrentView.ViewPoint.Camera.Position.data2 = Convert.ToDouble(textBox2.Text); //Applied
NWState.CurrentView.ViewPoint.Camera.Position.data3 = Convert.ToDouble(textBox3.Text); //Applied
NWState.CurrentView.ViewPoint.Camera.GetViewDir().data1 = Convert.ToDouble(textBox4.Text); //NOT Applied
NWState.CurrentView.ViewPoint.Camera.GetViewDir().data2 = Convert.ToDouble(textBox5.Text); //NOT Applied
NWState.CurrentView.ViewPoint.Camera.GetViewDir().data3 = Convert.ToDouble(textBox6.Text); //NOT Applied
I am kinda Beginner in Programming and API, so I need helps from GURUs LIKE YOU!!
Condition :
Win7 64bit, NW Sim 2014,