Community
BIM 360 API Forum
Welcome to Autodesk’s BIM 360 API Forums. Share your knowledge, ask questions, and explore popular BIM 360 API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Converting from Forge externalId into IfcGuid [model-derivative-api]

0 REPLIES 0
Reply
Message 1 of 1
peter.kolbe
575 Views, 0 Replies

Converting from Forge externalId into IfcGuid [model-derivative-api]

peter.kolbe
Enthusiast
Enthusiast

References:

https://thebuildingcoder.typepad.com/blog/2009/02/uniqueid-dwf-and-ifc-guid.html

https://github.com/Autodesk-Forge/bim360appstore-model.derivative-nodejs-xls.exporter

https://gist.github.com/jsdbroughton/8ead390ad03f9e26658a80f461276472

 

Following the sample “bim360appstore-model.derivative-nodejs-xls.exporter” I’m able to export the metadata from a BIM360 model. Each forgeObject has a property “externalId” in format 8-4-4-4-12-8. I need to convert this into the IfcGuid (22 characters long).

When using Revit C# API I have to call

            Guid elemGuid = ExportUtils.GetExportId(element.Document, element.Id);

            String ifcGuid = IfcGuid.ToIfcGuid(elemGuid);

 

to get the ifcGuid. How can I do the same using JavaScript in Forge environment?

I tried it, using the JS code from J. Broughton from the references above, but the input data for function fromFullToCompressed() is a 8-4-4-4-12 value, and not the 8-4-4-4-12-8 externalId.

So how to do the first step converting from externalId to elemGuid?

0 Likes

Converting from Forge externalId into IfcGuid [model-derivative-api]

References:

https://thebuildingcoder.typepad.com/blog/2009/02/uniqueid-dwf-and-ifc-guid.html

https://github.com/Autodesk-Forge/bim360appstore-model.derivative-nodejs-xls.exporter

https://gist.github.com/jsdbroughton/8ead390ad03f9e26658a80f461276472

 

Following the sample “bim360appstore-model.derivative-nodejs-xls.exporter” I’m able to export the metadata from a BIM360 model. Each forgeObject has a property “externalId” in format 8-4-4-4-12-8. I need to convert this into the IfcGuid (22 characters long).

When using Revit C# API I have to call

            Guid elemGuid = ExportUtils.GetExportId(element.Document, element.Id);

            String ifcGuid = IfcGuid.ToIfcGuid(elemGuid);

 

to get the ifcGuid. How can I do the same using JavaScript in Forge environment?

I tried it, using the JS code from J. Broughton from the references above, but the input data for function fromFullToCompressed() is a 8-4-4-4-12 value, and not the 8-4-4-4-12-8 externalId.

So how to do the first step converting from externalId to elemGuid?

0 REPLIES 0

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report