How to set a background color in 2D view of autodesk forge file to a specific Room on a floor or level using jquery
Change Background color of 2D sheets of Autodesk Forge using Javascript
606 views Asked by Carol Jones At
1
How to set a background color in 2D view of autodesk forge file to a specific Room on a floor or level using jquery
To set a background color in 2D, you have to two programmable options...
viewer.setBackgroundColor(...); viewerImp.toggleSwapBlackAndWhite(true/false);
You can find the API details for setBackgroundColor here: https://developer.autodesk.com/en/docs/viewer/v2/reference/javascript/viewer3d/
and line2191 toggle blackwhite here: autodeskviewer.com/viewers/latest/docs/src_application_Viewer3D.js.html
Here is a working example...
Open this URL in a recent version of chrome: https://autodeskviewer.com/viewers/latest/viewer3d.html?svf=https://lmv-models.s3.amazonaws.com/2d_model/primaryGraphics.f2d
Open up the debug console and type these two options:
NOP_VIEWER.impl.toggleSwapBlackAndWhite(true); NOP_VIEWER.setBackgroundColor(255,255,0,0,255,255);
The result should give you a clue to what is possible with just the api.
This is specific to the web viewer. Is that what you were looking for ?