mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-26 10:11:46 +00:00
copy_class to prevent duplicating profiles #6261
This commit is contained in:
@@ -17,6 +17,7 @@
|
|||||||
# along with IfcOpenShell. If not, see <http://www.gnu.org/licenses/>.
|
# along with IfcOpenShell. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import ifcopenshell
|
import ifcopenshell
|
||||||
|
import ifcopenshell.api.material
|
||||||
import ifcopenshell.api.root
|
import ifcopenshell.api.root
|
||||||
import ifcopenshell.api.system
|
import ifcopenshell.api.system
|
||||||
import ifcopenshell.api.geometry
|
import ifcopenshell.api.geometry
|
||||||
@@ -159,9 +160,7 @@ class Usecase:
|
|||||||
inverse.RelatedObjects = [to_element]
|
inverse.RelatedObjects = [to_element]
|
||||||
elif inverse.is_a("IfcRelAssociatesMaterial") and "Set" in inverse.RelatingMaterial.is_a():
|
elif inverse.is_a("IfcRelAssociatesMaterial") and "Set" in inverse.RelatingMaterial.is_a():
|
||||||
inverse = ifcopenshell.util.element.copy(self.file, inverse)
|
inverse = ifcopenshell.util.element.copy(self.file, inverse)
|
||||||
inverse.RelatingMaterial = ifcopenshell.util.element.copy_deep(
|
inverse.RelatingMaterial = ifcopenshell.api.material.copy_material(self.file, inverse.RelatingMaterial)
|
||||||
self.file, inverse.RelatingMaterial, exclude=["IfcMaterial"]
|
|
||||||
)
|
|
||||||
inverse.RelatedObjects = [to_element]
|
inverse.RelatedObjects = [to_element]
|
||||||
else:
|
else:
|
||||||
for i, value in enumerate(inverse):
|
for i, value in enumerate(inverse):
|
||||||
|
|||||||
Reference in New Issue
Block a user