We are trying to retrieve the Room colors (based on Views with Revit Color Scheme) from Sheets viewed in the 2D Viewer:
Color Scheme in Revit
For this purpose I retrieve all the rooms and get their materials:
const tree = model.getInstanceTree();
const frags = model.getFragmentList();
const getRoomsId = new Promise((resolve, reject) => {
obj.model.search('Rooms', function (dbIds) {
dbIds.some(dbId => {
if (tree.getNodeName(dbId) === 'Rooms') {
resolve(dbId)
return true
}
})
})
})
getRoomsId.then(function (roomsId) {
tree.enumNodeChildren(roomsId,
function (childId) {
tree.enumNodeFragments(childId, function (fragid) {
const material = frags.getMaterial(fragid);
console.log('Room: ', childId, ' / ', tree.getNodeName(childId), ' Fragment: ', fragid, ' Material: ', material.uuid)
})
}
)
})
Unfortunately they all seem to have the same material as shown in the log below, so I have no idea where the colors are coming from:
tree.enumNodeChildren(childId)
doesn't retrieve anything so I wonder if somehow it is using an overlay to display the colors.
Any help is very much appreciated.