I' doing a BIM project using autodesk forge viewer ( I'm using viewer version 6*).
I want color different objects in different color according to the completion status .
Check the below image .
Objects are already colored I tried using setThemingColor but it does not work. I do not want to use setSelectionColor since my object is to show the color without selecting a specific object.
ex: in the below image, i want to color circled objects with the respective color.
update :
here is the code snippet I'm using
function changeObjectColor(modelId, status){
var color ;
switch (status) {
case 'Green':
color = new THREE.Vector4(0, 0.5, 0, 0.5);
break;
case 'Red':
color = new THREE.Vector4(1, 0, 0, 0.5);
break;
}
viewerApp.getCurrentViewer().setThemingColor(modelId,color);
}
the result result after setting the color
i also use isolate and select methods as well , but even after removing those two method calls still the color won't change for a specific object
new try outs :
So i managed to set/hide object texture ( just gray color) following this tutorial. But then I tried using the setThemingColor method but still the objects wont show the expected color
viewerApp.getCurrentViewer().setThemingColor(modelId, color, null, true);
viewerApp.getCurrentViewer().impl.invalidate(true, true, false);
What am I missing here ?
The setThemingColor method is available in v6 and should be working fine. Consider posting the snippet of your code that's responsible for setting the color.
Here's an example of how the method is used in the Forge Digital Twin demo.