Community Tip - You can change your system assigned username to something more personal in your community settings. X
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
Solved! Go to Solution.
You can find descriptions in the help pages http://support.ptc.com/help/vuforia/studio/en/#page/Studio_Help_Center%2Fcad_metadata_api.html
You can find descriptions in the help pages http://support.ptc.com/help/vuforia/studio/en/#page/Studio_Help_Center%2Fcad_metadata_api.html
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);
}
});