Interacting with IFC GUIDs
to interact with the viewer you will need to use objectids when the model is processed objects are given unique objectids these objectids are guaranteed to be unique within the model and across revisions this is done because ifc guids are unique to each object which may exist in multiple models and/or revisions however, you may find you need to interact with the viewer using ifc guids for this you will need to translate between ifc guids and objectids translate ifc guids to objectids 1\ invoke the query method provide the ifc guids you want to get the objectids for const query = { "attributes globalid" { $in \["ifc guid 1", "ifc guid 2"], }, }; const objectids = viewer3d query(query); 2\ use the returned objectids the query method returns an array of objectids that match the specified ifc guids you can then use these objectids to interact with the viewer translate objectids to ifc guids 1\ invoke the getproducts method provide the objectids of the objects you want to get the ifc guids for const objectids = \["object id 1", "object id 2"]; const products = viewer3d getproducts(objectids); 2\ extract the ifc guids from the returned products the ifc guid is the value of the globalid attribute for each object \[ { ifctype "ifcwall", modelid "model id", objectid "object id 1", attributes { globalid { ifctype "ifcgloballyuniqueid", type "string", value "2 tmt90td0x9tjstsytb1j", }, }, }, { ifctype "ifcdoor", modelid "model id", objectid "object id 2", attributes { globalid { ifctype "ifcgloballyuniqueid", type "string", value "2 let78tf0x5tdsrsyht5k", }, }, }, ];