mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-06 07:51:47 +00:00
Implement assigning annotation representation. See #1222.
This commit is contained in:
@@ -91,7 +91,7 @@ class Usecase:
|
||||
|
||||
def create_plan_representation(self):
|
||||
if self.settings["context"].ContextIdentifier == "Annotation":
|
||||
if self.settings["is_text"]:
|
||||
if isinstance(self.settings["geometry"], bpy.types.TextCurve):
|
||||
return self.create_text_representation()
|
||||
shape_representation = self.create_geometric_curve_set_representation(is_2d=True)
|
||||
shape_representation.RepresentationType = "Annotation2D"
|
||||
@@ -291,3 +291,12 @@ class Usecase:
|
||||
|
||||
def convert_si_to_unit(self, co):
|
||||
return co / self.settings["unit_scale"]
|
||||
|
||||
def create_geometric_curve_set_representation(self, is_2d=False):
|
||||
geometric_curve_set = self.file.createIfcGeometricCurveSet(self.create_curves(is_2d=is_2d))
|
||||
return self.file.createIfcShapeRepresentation(
|
||||
self.settings["context"],
|
||||
self.settings["context"].ContextIdentifier,
|
||||
"GeometricCurveSet",
|
||||
[geometric_curve_set],
|
||||
)
|
||||
|
||||
@@ -58,3 +58,6 @@ class BIM_PT_class(Panel):
|
||||
if props.ifc_predefined_type == "USERDEFINED":
|
||||
row = self.layout.row()
|
||||
row.prop(props, "ifc_userdefined_type")
|
||||
if bpy.context.active_object.data:
|
||||
row = self.layout.row()
|
||||
row.prop(bpy.context.scene.BIMProperties, "contexts")
|
||||
|
||||
Reference in New Issue
Block a user