Reputation: 41
I load multiple models from multiple converted revit files in the viewer. In each of these models I put points associated to selected element. To be able to reuse these points later, I need:
Main issue is the 2nd point, How to set model.getDocumentNode when loading multiple models in the viewer?
Thank you,
Upvotes: 0
Views: 447
Reputation: 9942
You could collect the document URN and the model GUID during the loading process:
function load(urn) {
viewerApp.loadDocument(
'urn:' + urn,
function onDocumentLoadSuccess(doc) {
const viewables = viewerApp.bubble.search({ 'type': 'geometry' });
if (viewables.length > 0) {
const path = doc.getViewablePath(viewables[0].data);
const viewer = viewerApp.getCurrentViewer();
const options = { /* your options */ };
viewer.loadModel(path, options, function onModelLoadSuccess(model) {
model._myURN = urn;
model._myGUID = viewables[0].data.guid;
});
}
}
);
}
Upvotes: 1