Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] How to use IfcRepresentation from original IFC file in newly created IFC file #489

Open
milojevicA opened this issue Feb 10, 2023 · 1 comment

Comments

@milojevicA
Copy link

Hi, I'm trying to keep original IfcRepresentation from IFC file in my newly exported file.

I tried to use InsertCopy, but it throws an Exception ("Cross model entity assignment").
InsertCopy copies Entity Tags also, and I think that is a problem also.

Is it possible to do use that original entities to create entities with all sub-entites, but with new Entity Tags?

@martin1cerny
Copy link
Member

This exception is thrown when you try to assign entity from model A to a property of entity from model B. I assume that by Entity Tags you mean IPersistEntity.EntityLabel? If that is the case, then there is an option to use new entity labels for the copied entities. That is why you need to use the entity map in InsertCopy, so we know which entities from model A are copies of which entities in model B to avoid graph expansion and potential infinite insertion loops.

Make sure you always only assign entities within one model.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants