Community
Navisworks API
Welcome to Autodesk’s Navisworks API Forums. Share your knowledge, ask questions, and explore popular Navisworks API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

GPS model positioning

2 REPLIES 2
Reply
Message 1 of 3
FredericBautista
672 Views, 2 Replies

GPS model positioning

We are working with Navisworks, and have one question :

Would it be possible with the API to code a plug-in that would change the position of the 3d model depending on the GPS coordinates ?

The aim is to load the 3D model at the right place on a Win8 PC/Tab depending on the GPS location.

 

Regards,

Frederic

2 REPLIES 2
Message 2 of 3
deanlyon
in reply to: FredericBautista

From my experience, you can move the model to a new location but any Appends you do will always be at 0,0,0.  So you havea to move the model back to origin in order to bring in a new model then move it back.

 

Some code I used to do this with Navisworks 2010.

 

'move the currnet model so that the
' new model will come in correct relative location, then
' move the model back
'The files that end in NID_MOV move west
'The files that end in U6SCR_MOV move west and south
'The files that end in U7SCR_MOV move west and north

If InStr(FileName,"NID") > 0 THEN
roamer.state.CurrentSelection.SelectAll
Set sel = roamer.state.CurrentSelection
point = roamer.State.GetEnum("eObjectType_nwLVec3f")
Set origin = roamer.State.ObjectFactory(point)
tran = roamer.State.GetEnum("eObjectType_nwLTransform3f")
Set transPoint = roamer.State.ObjectFactory(tran)
'-182’-5”,0,0
'converting to inches
'xVert = 182.4166666666667
xVert = 2189
yVert = 0
zVert = 0
origin.SetValue xVert,yVert,zVert
transPoint.MakeTranslation(origin)
roamer.state.OverrideTransform sel, transPoint

'MsgBox FileName & " NID Translated"
roamer.AppendFile(FileName)

roamer.state.CurrentSelection.SelectAll
Set sel = roamer.state.CurrentSelection
point = roamer.State.GetEnum("eObjectType_nwLVec3f")
Set origin = roamer.State.ObjectFactory(point)
tran = roamer.State.GetEnum("eObjectType_nwLTransform3f")
Set transPoint = roamer.State.ObjectFactory(tran)
'moving model back
xVert = -1 * xVert
yVert = -1 * yVert
zVert = -1 * zVert
origin.SetValue xVert,yVert,zVert
transPoint.MakeTranslation(origin)
roamer.state.OverrideTransform sel, transPoint

Message 3 of 3
piotr_jarosz
in reply to: deanlyon

Do You have example how to rotate model?

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Rail Community


Autodesk Design & Make Report