I am trying to fill in room with color on a revit converted file's 2d viewer.
I have a Revit file that has "rooms" defined. The Revit file also has sheets defined "Floor one", "Floor two". When I convert it using the Forge API
I get a svf for the Revit 3D view and f2d files for "Floor one" and "Floor Two" sheets.
For the svf I was able to get fragid from dbids other post
Now Im trying to do the same for the f2d files.
I am able to change the color of the room walls if I know the wall shapes dbid by using
viewer.setThemingColor(dbid, new THREE.Vector4(0, 1, 1,1));
What I want to do now is be able to get the fragid of the shape on 2d so that I can get the start and stop vertices of the lines it uses. I want to know these vertices so I can build a custom mesh and fill it in with color for room "hatching".
My problem is that I do not know the f2d format. It seems it is all one mesh and lets the shader control the color of the lines. Can anyone give me any pointers on how to the the fragment list of the room?
This is what I used for the 3d svf
function getFragIdFromDbId(viewer, dbid) {
var returnValue;
var it = viewer.model.getData().instanceTree;
it.enumNodeFragments(dbid, function (fragId) {
//console.log("dbId: " + dbid + " FragId : " + fragId);
returnValue = fragId;
}, false);
return returnValue;
}
What can I use for f2d to do the same when the f2d has viewer.model.getData().instanceTree = undefined?