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
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