mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-14 19:34:34 +00:00
pset.unshare_pset - fix bug where it would leaving an orphaned pset
It was leaving an orphaned pset if 'products' was a list of all elements pset is assigned to. Then it would create a new pset for each element leaving original pset orphaned.
This commit is contained in:
@@ -21,7 +21,6 @@ import ifcopenshell.api.pset
|
||||
import ifcopenshell.guid
|
||||
import ifcopenshell.util.element
|
||||
import ifcopenshell.util.selector
|
||||
from typing import Union
|
||||
from logging import Logger
|
||||
|
||||
|
||||
@@ -79,7 +78,7 @@ class Patcher:
|
||||
new_psets = []
|
||||
for pset, elements in psets.items():
|
||||
# Let the first element to keep the original property set.
|
||||
elements = list(elements)[1:]
|
||||
elements = list(elements)
|
||||
new_psets.extend(ifcopenshell.api.pset.unshare_pset(self.file, elements, pset))
|
||||
|
||||
print(f"{len(new_psets)} new psets were created.")
|
||||
|
||||
Reference in New Issue
Block a user