GeometryGym / GeometryGymIFC

C# classes to generate and parse OpenBIM IFC files
Other
269 stars 97 forks source link

Possibility to remove entries from DatabaseContainer #40

Closed hu-stefan closed 3 years ago

hu-stefan commented 3 years ago

Hi there,

I try to change the base beometry of a BuildingElemntProxy. First i add an RectangleProfile, but later i want to update the RectangleProfile into an CircleProfile. So i end up with an orphaned RectangleProfile. Is it possible to remove this entry from the database container?

My coding: Screenshot 2021-01-21 152522

best regards Stefan

jmirtsch commented 3 years ago

There are two strategies for handling this.

The first strategy for removing identified orphaned elements is a method called "Dispose". This has an argument for whether to also call on the dispose method for nested attributes (ie if the profile is an arbitrary profile, to call dispose on the curve(s) that define it).

This can get a bit tricky if there are common references to a nested attribute.

The alternative strategy is to "duplicate" the project entity. This will generate a new IFC database anew, and only live entities in the hierarchy will get duplicated, anything orphaned will be filtered out. This is a preferred method, but I'm wondering if some aspects of this might be in the closed source portion of the toolkit. If you try it and have problems, let me know and I'll review and improve it.

hu-stefan commented 3 years ago

Ah thank you! The first one works perfect.