Retrieve Element from externalId Autodesk Forge

I am not sure if getElementById() exist in Forge or where it is documented.

If you would like to set colors of an object in your model, you need to use dbId instead of externalId. Fortunately, there is a really nice function to get dbId from externalId which is called getExternalIdMapping().

You can find it here in the documentation:

Returns an object with key values being dbNodeIds and values externalIds. 
Useful to map LMV node ids to Fusion node ids.

Example usage could be:

viewer.model.getExternalIdMapping(data => console.log(data))

With this you can retrieve dbId to set its color.

Read more here: Source link