mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 17:58:20 +00:00
See #3974. WIP review to ensure history removal in API.
This commit is contained in:
@@ -16,6 +16,9 @@
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with IfcOpenShell. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import ifcopenshell
|
||||
import ifcopenshell.util.element
|
||||
|
||||
|
||||
class Usecase:
|
||||
def __init__(self, file, product=None, pset=None):
|
||||
@@ -72,6 +75,12 @@ class Usecase:
|
||||
if enumeration and self.file.get_total_inverses(enumeration) == 1:
|
||||
self.file.remove(enumeration)
|
||||
self.file.remove(prop)
|
||||
history = self.settings["pset"].OwnerHistory
|
||||
self.file.remove(self.settings["pset"])
|
||||
if history:
|
||||
ifcopenshell.util.element.remove_deep2(self.file, history)
|
||||
for element in to_purge:
|
||||
history = getattr(element, "OwnerHistory", None)
|
||||
self.file.remove(element)
|
||||
if history:
|
||||
ifcopenshell.util.element.remove_deep2(self.file, history)
|
||||
|
||||
Reference in New Issue
Block a user