XbimWebUI
XbimWebUI copied to clipboard
ID of element.
Hello everybody, I have loaded 2 IFC files. I have 2 the same IDs of specific items in these 2 different models. I would like to difference beetwen these IDs- it means, I will select one element and I wanna have properties of a current element. But in this sample it is not possible, because we have 2 different elements with the same IDs in our canvas. Is it possible to difference beetwen IDs of models? Best regards, jo5zek
P.S. Part of code:
xbimviewer.on("click", function (args) {
xbimviewer.resetStates();
var id = args.id;
});
@martin1cerny
Mayby we could use globalIDs in form of GUID rather then #number of element?

I moved this to the viewer project as it is not related to the geometry engine. Yes, it is possible to distinguish between the two models. Just use the args.model property. When you listen to the viewer.on('loaded', args => { ... }) event, you get the model ID of the model. We use local int key instead of the global ID as we need to render it. Also, you would have the same issue once you wanted to load two versions of the same model. We use args.model identifier ourselves in our applications where we handle multiple models in the same view.
Hello @martin1cerny and thank you for explanation above. Can you please tell me, how to get whole structure for current global ID? I mean, all properties, values etc. Thank you.
Hi @krosoftware , you need to use the API to get properties and other information.