mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-18 14:31:39 +00:00
Minor fix
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.util.type
|
||||||
import ifcopenshell.util.schema
|
import ifcopenshell.util.schema
|
||||||
import ifcopenshell.util.element
|
import ifcopenshell.util.element
|
||||||
|
|
||||||
@@ -79,12 +80,12 @@ class Usecase:
|
|||||||
element.PredefinedType = "USERDEFINED"
|
element.PredefinedType = "USERDEFINED"
|
||||||
element.ObjectType = self.settings["predefined_type"]
|
element.ObjectType = self.settings["predefined_type"]
|
||||||
if element.is_a("IfcTypeProduct"):
|
if element.is_a("IfcTypeProduct"):
|
||||||
for typed_element in ifcopenshell.util.element.get_types(element) or []:
|
for occurrence in ifcopenshell.util.element.get_types(element) or []:
|
||||||
ifc_class = self.settings["ifc_class"].removesuffix("Type").removesuffix("Style")
|
ifc_class = ifcopenshell.util.type.get_applicable_entities(self.settings["ifc_class"])[0]
|
||||||
ifcopenshell.api.run(
|
ifcopenshell.api.run(
|
||||||
"root.reassign_class",
|
"root.reassign_class",
|
||||||
self.file,
|
self.file,
|
||||||
product=typed_element,
|
product=occurrence,
|
||||||
ifc_class=ifc_class,
|
ifc_class=ifc_class,
|
||||||
predefined_type= self.settings["predefined_type"]
|
predefined_type= self.settings["predefined_type"]
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -95,7 +95,6 @@ class TestEditPset(test.bootstrap.IFC4):
|
|||||||
element = ifcopenshell.api.run("root.create_entity", self.file, ifc_class="IfcWall")
|
element = ifcopenshell.api.run("root.create_entity", self.file, ifc_class="IfcWall")
|
||||||
pset = ifcopenshell.api.run("pset.add_pset", self.file, product=element, name="Pset_WallCommon")
|
pset = ifcopenshell.api.run("pset.add_pset", self.file, product=element, name="Pset_WallCommon")
|
||||||
ifcopenshell.api.run("pset.edit_pset", self.file, pset=pset, properties={"Reference": "Foo"})
|
ifcopenshell.api.run("pset.edit_pset", self.file, pset=pset, properties={"Reference": "Foo"})
|
||||||
print("test")
|
|
||||||
ifcopenshell.api.run("pset.edit_pset", self.file, pset=pset, properties={"Reference": None}, should_purge=True)
|
ifcopenshell.api.run("pset.edit_pset", self.file, pset=pset, properties={"Reference": None}, should_purge=True)
|
||||||
pset = element.IsDefinedBy[0].RelatingPropertyDefinition
|
pset = element.IsDefinedBy[0].RelatingPropertyDefinition
|
||||||
assert len(pset.HasProperties) == 0
|
assert len(pset.HasProperties) == 0
|
||||||
|
|||||||
Reference in New Issue
Block a user