HOOPS_Communicator views the dwg file, the font color is black

I want to view the dwg file in HOOPS_Communicator with a black background, the font display is the same color as autocad, and the font is white. How to achieve this? In other words, the viewing effect is consistent with Autocad.

HotelFloorplan.zip (708.5 KB)

Hello @rohagax695,

The SheetManager class has the method setSheetColors which makes it possible to set colors for the background, the sheet itself and the sheet shadow color.

As for the text nodes, that can be set using the function setNodesColors. Admittedly however, there is not a streamlined way to identify the text nodes and change the color. This would have to be a feature request.


1 Like

My question is, when using converter to convert a dwg file into an sc file, can I control the text to be set to white?


There are no converter command-line options that controls the text font color for drawings.


Hello, do you have any good ideas? Is there any way to quickly find the font color in the drawing and change black to white? Can you briefly describe the specific logic?

There is unfortunately no reliable way to identify text in the converted DWG file in the webviewer currently, as text is also rendered as mesh geometry and has no specific attributes attached to it. I agree with my colleague that support for this would be a feature request.

As previously mentioned, the text does not have an identifier to enable filtering only text.

That said, it’s possible to walk the entire tree and retrieve ALL the nodes for a given color, let’s say black. Here’s a quick code snippet to do that:

var blackArray = [];

async function walkNodes(nodeId) {
  var children = hwv.model.getNodeChildren(nodeId);

  for (var i = 0; i < children.length; i++) {
    if (hwv.model.getNodeType(children[i]) == 3) {
      var color = await hwv.model.getNodesEffectiveFaceColor([children[i]]);
      if (color[0].r == 0 && color[0].g == 0 && color[0].b == 0) {

    await walkNodes(children[i]);

async function walkAllNodes() {
  var rootId = hwv.model.getAbsoluteRootNode();
  await walkNodes(rootId);
  console.log("All nodes have been processed.");

  .then(() => {
    console.log("Done processing all nodes.");
  .catch((error) => {
    console.error("An error occurred:", error);

You can then set the desired new color for the nodes in blackArray.

1 Like

It can solve problem when drawings_mode is “3D” with setNodesColors and getNodeEffectiveLineColor, but when this mode is “2D” and viewing dwg with sheet, both getNodeEffectiveFaceColor and setNodesColors are invalid. And I found part of nodes are PMI type, but I set PMI color also invalid.
How to change nodes color and PMI color when the drawings_mode setting as “3D”?


Hello @slfeng612,

With respect to filtering PMI node types, you can make this small modification in the if statement:

if (hwv.model.getNodeType(children[i]) == 3) {

if (hwv.model.getNodeType(children[i]) == Communicator.NodeType.BodyInstance || hwv.model.getNodeType(children[i]) == Communicator.NodeType.PMI) {

More information on node types can be found in our docs.

Using HotelFloorPlan drawing (2D) that is part of the quickstart module, I’m able to use both getNodeEffectiveFaceColor and setNodesColors. Worth pointing out is that in my example, I only created an array for nodes with a black color. The method getNodeEffectiveFaceColor takes a node id and a face id. And setNodesColor takes a color map and not an array.

Maybe if you could share snippets of our code or even the drawing file, this would make it easier to diagnose the issue.

1 Like