参考:
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
按照示例“bim360appstore-model.derivative-nodejs-xls.exporter”,我可以从 BIM360 模型中导出元数据。每个 forgeObject 都有一个格式为 8-4-4-4-12-8 的属性“externalId”。我需要将其转换为 IfcGuid(22 个字符长)。
使用 Revit C# API 时,我必须调用
Guid elemGuid = ExportUtils.GetExportId(element.Document, element.Id);
String ifcGuid = IfcGuid.ToIfcGuid(elemGuid);
获取 ifcGuid。如何在 Forge 环境中使用 JavaScript 做同样的事情?
我试过了,使用上面参考资料中 J. Broughton 的 JS 代码,但函数 fromFullToCompressed() 的输入数据是 8-4-4-4-12 值,而不是 8-4-4-4- 12-8 外部标识。
那么如何进行从 externalId 到 elemGuid 的第一步转换呢?