mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 01:41:57 +00:00
typing
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user