xBimTeam / XbimEssentials

A .NET library to work with data in the IFC format. This is the core component of the Xbim Toolkit
https://xbimteam.github.io/
Other
485 stars 172 forks source link

[QUESTION] Create entity with predefined EntityLabel #498

Open bschorno opened 1 year ago

bschorno commented 1 year ago

Is it possible to create an new entity (e.g. IfcWall) and assign the EntityLabel by myself? Or otherwhise is it possible to change the EntityLabel of a given entity?

martin1cerny commented 1 year ago

This is possible but certainly not suggested as entity label is used as a stable internal unique key in many places. Why do you need to change it?

bschorno commented 1 year ago

I don't realy want to change the label afterwards, but rather set it when I create the entity, so to don't mix up the connections. The case I have is hard to explane, but I want to add new entities to an existing model from a dataset which already provides the entity labels. The labels I get are also unique and wont overlap with the existing ones in the model.

martin1cerny commented 1 year ago

Our IModel.InsertCopy() method takes an argument which allows you to keep the original labels if you can guarantee they won't clash.