Arno Gau
Arno Gau

Reputation: 49

Elements in a Navis works file

Similar to how rvt files use [\d+] appended to a name to indicate elements, are there any special properties or indicators that a particular node in the Autodesk-forge viewer objectTree of a nw* file is an element?

Upvotes: 1

Views: 209

Answers (1)

Eason Kang
Eason Kang

Reputation: 7070

You can use the ExternalId to indicate elements in Forge Viewer. In Revit is the Element.UniqueId of the Revit API as I know, but I have no idea about what this stands for in the Navisworks. You can obtain the ExternalId from the property object of a specific element (dbId) like this:

viewer.getProperties( dbId,
    function( result ) {
        console.log( result.externalId );
    },
    function( status, message, data ) {
        console.warn( status, message, data );
    });

And you can also retrieve dbId from a ExternalId:

viewer.model.getExternalIdMapping(
    function( map ) {
        console.log( map[externalId] );
    },
    function( error ) {
        console.warn( error );
    });

Upvotes: 0

Related Questions