Skip to main content
15-Moonstone
February 16, 2022
Solved

metadata vuforia experience service

  • February 16, 2022
  • 2 replies
  • 4887 views

Hello, I'm using thingworx flow to get some pvz files from windchill ad upload them into vuforia experience service repository. The process works, but using these pvz into vuforia studio seems to not load the metadata automatically (as instead using thingworx repository does). How to solve this issue?
Can I extract the metadata of the gathered pvz and upload it as a separate file? How to do this into thingworx flow?

Many thanks

Best answer by sgreywilson

There is an external extension https://github.com/mvonhasselbach/CreoViewRWExtension that will create the meta data. I have not used this with Thingworx flow. The approach I took was Thingworx OData and wrapper services which work well. The link is to a Thingworx extension you will need to install and create a service

 

logger.debug("Entering GetJSONFromCreoViewFile ");

var params = {
FileRepository: RepoName /* THINGNAME */,
ReturnedProperties: (returnedProps || undefined) /* STRING */,
CreoViewFile: pvzFilePath /* STRING */,
JSONFormat: format /* STRING */

};

// result: JSON

var result = Resources["CreoViewRWHelper"].GetJSONFromCreoViewFile(params);

In my case I place the pvz and the meta.json in the same Thingworx Repo and provide the url to the pvz source. The meta.json file needs to be in the same relative location
 
I used a GUID for the pvz and meta,json file names as they need to be the same for example xxxx,pvz xxxx.metadata.json 
 
Does this help
 
 
 

2 replies

21-Topaz I
February 18, 2022

Hi @GianVal , 

I tried to answer to this topic  in the related post :https://community.ptc.com/t5/Vuforia-Studio/metadata-vuforia-experience-service/m-p/778822#M10621

 

16-Pearl
February 18, 2022

There is an external extension https://github.com/mvonhasselbach/CreoViewRWExtension that will create the meta data. I have not used this with Thingworx flow. The approach I took was Thingworx OData and wrapper services which work well. The link is to a Thingworx extension you will need to install and create a service

 

logger.debug("Entering GetJSONFromCreoViewFile ");

var params = {
FileRepository: RepoName /* THINGNAME */,
ReturnedProperties: (returnedProps || undefined) /* STRING */,
CreoViewFile: pvzFilePath /* STRING */,
JSONFormat: format /* STRING */

};

// result: JSON

var result = Resources["CreoViewRWHelper"].GetJSONFromCreoViewFile(params);

In my case I place the pvz and the meta.json in the same Thingworx Repo and provide the url to the pvz source. The meta.json file needs to be in the same relative location
 
I used a GUID for the pvz and meta,json file names as they need to be the same for example xxxx,pvz xxxx.metadata.json 
 
Does this help
 
 
 
21-Topaz I
February 18, 2022

Hi @sgreywilson ,

this seems to be a great extension which will add more meta data information as the Studio UI  functionality allows. This extension seems to create a   metadata json which will contain  the bound and the tranformation this  could be very helpful for some components operations. e.g.:

... "__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"
 },
...

 I am not sure if the UI will add  this info when we have a Windchill assembly (which are published from Windchill - possibly extended by some attribures) but I believe this TWX extension is more powerfull. Thanks

16-Pearl
February 18, 2022

Hi @RolandRaytchev 

 

It is very useful extension - I forgot to mention as with any extension there comes some risk of version support  but without it you can't do what you require! 

 

I have used the bounding box to position multiple models. 

 

   

 

PositionModel = function (modelname , offset) {

var boundingboxViaParams = $scope.app.params.CURRENT_BOUNDING_BOX;

$scope.view.wdg[modelname].visible=false;

try {

var boundingbox = $scope.app.mdl['WCHelper'].svc['GetRepresentations'].data.current['BoundingBox'];

if (boundingbox != null && boundingbox != "") {
/*
"BoundingBox": [
-0.379386, .................X1 (0)
-1.15892, .................Y1 (1)
-0.0983161, ...............Z1 (2)
0.379386, .................X2 (3)
-0.0766029, ...............Y2 (4)
0.740562 ..................Z2 (5)
],

*/


var loadedModelPosX = -1.0*(boundingbox.array[0] + boundingbox.array[3]) / 2.0;
var loadedModelPosZ = -1.0*(boundingbox.array[2] + boundingbox.array[5]) / 2.0;
var loadedModelPosY = -1.0* (boundingbox.array[1]);
$scope.view.wdg[modelname].y=loadedModelPosY;
$scope.view.wdg[modelname].z=loadedModelPosZ;


if (offset == true) {

let move = (Math.abs(boundingbox.array[0]) + Math.abs(boundingbox.array[3]) + (Math.abs(boundingbox.array[0]) + Math.abs(boundingbox.array[3]))*0.1 );
$scope.view.wdg[modelname].x=loadedModelPosX + move ;

} else {
$scope.view.wdg[modelname].x=loadedModelPosX ;
}

}

} catch (ex) {


}


$scope.view.wdg[modelname].visible=true;

}