cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X

Metadata JSON navigation

GianVal
15-Moonstone

Metadata JSON navigation

I want to navigate the metadata JSON file as I do with regular JSON files like the example below

 

myjson["/0/1/0"]["InnerField1"]["DetailExample"]

 

but I want to do this with metadata Vuforia API. How to? 

Many thanks

ACCEPTED SOLUTION

Accepted Solutions
pandersson
14-Alexandrite
(To:GianVal)
2 REPLIES 2
pandersson
14-Alexandrite
(To:GianVal)

Once you have executed say for example PTC.Metadata.fromId  as shown below you can use just like standard json but the functions provided in the link by @pandersson might be easier 

 

$scope.$on('userpick', function (event, targetName, targetType, eventData) {

var pathid = JSON.parse(eventData).occurrence;

try {
PTC.Metadata.fromId(targetName).then((metadata) => {

var displayName = metadata.get(pathid, 'Display Name');

CURRENT_OCCURANCE = pathid;

resetHighlight();
var itemArray = [];
itemArray.push(targetName+'-'+pathid);
SELECTED_ITEMS.push(targetName + '-' + pathid);

//hilite(itemArray,true);
setColor(itemArray, HIGHLIGHT_COLOR);

doPopup(displayName, pathid);

});

} catch (err) {

console.log(err);
}

});

 

sgreywilson_0-1641389536118.png

 

Announcements

Top Tags