How to filter model views and retrieve data in the embedded Tandem Viewer?
After successfully initializing and starting the Autodesk Tandem Viewer, I can load and display the entire model. Based on a previous REST API call and user selection, I receive a twinId and a viewId.
Question 1: How can I display only the view (associated with the sViewId), not the entire model?
Question 2: How can I retrieve the data associated with the view (e.g., like the inventory table shown in the Tandem Viewer)?
Below is the relevant part of my current implementation:
displayFacility: function (sTwin, sViewId) {
const app = this.oApp;
return new Promise((resolve, reject) => {
app.getCurrentTeamsFacilities()
.then((facilitiesSharedWithMe) => {
app.getUsersFacilities()
.then((myFacilities) => {
const aFacilities = [].concat(facilitiesSharedWithMe, myFacilities);
const matchingFacility = aFacilities.find(facility => facility.twinId === sTwin);
if (!matchingFacility) {
const msg = `Facility with twinId '${sTwin}' not found.`;
console.error(msg);
reject(new Error(msg));
return;
}
const currentFacility = app.displayFacility(matchingFacility, false, this.oViewer);
resolve();
});
});
});
}