mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-13 19:07:57 +00:00
See #3682. You can now add symbols and multisymbols (i.e. one vertex per symbol) annotations. New default symbols for setout points in demo library.
This commit is contained in:
@@ -146,6 +146,9 @@ class LibraryGenerator:
|
||||
self.create_type("IfcDoorType", "DT01", {"model_body": "Door", "plan_body": "Door-Plan"})
|
||||
self.create_type("IfcFurnitureType", "BUN01", {"model_body": "Bunny", "plan_body": "Bunny-Plan"})
|
||||
|
||||
self.create_symbol_type("SETOUT-POINT", "setout-point")
|
||||
self.create_symbol_type("CONTROL-POINT", "control-point")
|
||||
self.create_symbol_type("TRAVERSE-POINT", "traverse-point")
|
||||
self.create_line_type("DASHED", "dashed")
|
||||
self.create_line_type("FINE", "fine")
|
||||
self.create_line_type("THIN", "thin")
|
||||
@@ -161,6 +164,12 @@ class LibraryGenerator:
|
||||
|
||||
self.file.write("IFC4 Demo Library.ifc")
|
||||
|
||||
def create_symbol_type(self, name, symbol):
|
||||
element = ifcopenshell.api.run("root.create_entity", self.file, ifc_class="IfcTypeProduct", name=name)
|
||||
element.ApplicableOccurrence = "IfcAnnotation/SYMBOL"
|
||||
pset = ifcopenshell.api.run("pset.add_pset", self.file, product=element, name="EPset_Annotation")
|
||||
ifcopenshell.api.run("pset.edit_pset", self.file, pset=pset, properties={"Symbol": symbol})
|
||||
|
||||
def create_line_type(self, name, classes):
|
||||
element = ifcopenshell.api.run("root.create_entity", self.file, ifc_class="IfcTypeProduct", name=name)
|
||||
element.ApplicableOccurrence = "IfcAnnotation/LINEWORK"
|
||||
|
||||
Reference in New Issue
Block a user