This commit is contained in:
Andrej730
2025-03-14 10:43:47 +05:00
parent 10ecac33b8
commit 0e8810c1f5
118 changed files with 869 additions and 1203 deletions
@@ -30,9 +30,7 @@ def add_parameterized_profile(file: ifcopenshell.file, ifc_class: str) -> ifcope
:param ifc_class: The subclass of IfcParameterizedProfileDef that you'd
like to create.
:type ifc_class: str
:return: The newly created element depending on the specified ifc_class.
:rtype: ifcopenshell.entity_instance
Example:
@@ -42,6 +40,4 @@ def add_parameterized_profile(file: ifcopenshell.file, ifc_class: str) -> ifcope
ifc_class="IfcCircleProfileDef")
circle.Radius = 1.
"""
settings = {"ifc_class": ifc_class}
return file.create_entity(settings["ifc_class"])
return file.create_entity(ifc_class)
@@ -35,11 +35,10 @@ def remove_profile(file: ifcopenshell.file, profile: ifcopenshell.entity_instanc
circle = 1.
ifcopenshell.api.profile.remove_profile(model, profile=circle)
"""
settings = {"profile": profile}
is_ifc2x3 = file.schema == "IFC2X3"
subelements = set()
for attribute in settings["profile"]:
for attribute in profile:
if isinstance(attribute, ifcopenshell.entity_instance):
subelements.add(attribute)
@@ -56,6 +55,6 @@ def remove_profile(file: ifcopenshell.file, profile: ifcopenshell.entity_instanc
for pset in profile_psets:
ifcopenshell.api.pset.remove_pset(file, product=profile, pset=pset)
file.remove(settings["profile"])
file.remove(profile)
for subelement in subelements:
ifcopenshell.util.element.remove_deep2(file, subelement)