Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X
Hi, how can i get a model item coordinate not using model item in vuforia studio but using only JS?
e.g. coordinates for model part 'model-1-/3/10'
Many thanks
Solved! Go to Solution.
tml3dRenderer.GetObject('model-1-/3').GetWidget().GetLocation().position.x
Found this solution
tml3dRenderer.GetObject('model-1-/3').GetWidget().GetLocation().position.x
Found this solution
HI @GianVal ,
only want to mentioned that this will definitely work in preview mode but I do not think that this will work on mobile device.(so far my tests in earlier releases - I did not test in the current version) So far I remember the GetWidget() will not work on mobile.
Alternative on mobile device you can use some techniques like meta data. But here is not meant thee default meta data when you load pvz file in studio. The data extracted by CreoViewRWEExtension https://github.com/mvonhasselbach/CreoViewRWExtension (also post https://community.ptc.com/t5/Vuforia-Studio/metadata-vuforia-experience-service/td-p/778822 ) will extract a json file which contains the location: (example)
... "__PV_SystemProperties" : {
"Display Name" : "COLUMN_ASSY.ASM",
"Part Path" : "/Illustration/MINI_MILL_ASSY.ASM/COLUMN_SPINDLE.ASM/COLUMN_ASSY.ASM",
"Child Count" : 48,
"Component Name" : "COLUMN_ASSY.ASM",
"Model Extents (mm)" : 589.1,
"Instance Location" : "0.0 0.0 0.0 0.0 0.0 0.0 ",
"Part Name" : "COLUMN_ASSY.ASM",
"Model Bounds" : "-0.1274 0 -0.397 0.095326185 0.5891 0",
"Direct Child Count" : 25,
"Instance Transformation" : "1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1",
"Model Transformation" : "1 0 0 0 0 1 0 0.096 0 0 1 -0.259 0 0 0 1",
"Model Location" : "0.0 0.0 0.0 0.0 0.096 -0.259 ",
"OL File Name" : "",
"Part Depth" : 3,
"Instance Type" : 0,
"Instance ID" : "2",
"Part ID Path" : "/0/2/2"
},
...
The model Location there contains the x,y,z,rx,ry and rz
Another possible option is to use a project which should prepare the data of the pvz. So you can open a pvz in preview mode , extract the data and load it to TWX repository as your own json format. Later in other projects you can use this data to the related pvz model file on mobile (respectively load the custom json from TWX filerepository.