mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 09:21:46 +00:00
Fix 3 bugs related to representations:
* Bug when switching representations when active object not selected. * Bug when switching to a non MODEL_VIEW body representation would load the MODEL_VIEW one instead all the time. * Add support for plan body representations.
This commit is contained in:
@@ -116,7 +116,7 @@ class SwitchRepresentation(bpy.types.Operator, Operator):
|
||||
def _execute(self, context):
|
||||
target = tool.Ifc.get().by_id(self.ifc_definition_id).ContextOfItems
|
||||
is_subcontext = target.is_a("IfcGeometricRepresentationSubContext")
|
||||
for obj in context.selected_objects:
|
||||
for obj in set(context.selected_objects + [context.active_object]):
|
||||
element = tool.Ifc.get_entity(obj)
|
||||
if not element:
|
||||
continue
|
||||
|
||||
@@ -174,7 +174,8 @@ class Geometry(blenderbim.core.tool.Geometry):
|
||||
settings = ifcopenshell.geom.settings()
|
||||
settings.set(settings.WELD_VERTICES, True)
|
||||
|
||||
if representation.ContextOfItems.ContextIdentifier == "Body":
|
||||
context = representation.ContextOfItems
|
||||
if context.ContextIdentifier == "Body" and context.TargetView == "MODEL_VIEW":
|
||||
if element.is_a("IfcTypeProduct"):
|
||||
shape = ifcopenshell.geom.create_shape(settings, representation)
|
||||
else:
|
||||
|
||||
@@ -153,7 +153,7 @@ class Usecase:
|
||||
elif self.settings["context"].ContextIdentifier == "Axis":
|
||||
return self.create_curve2d_representation()
|
||||
elif self.settings["context"].ContextIdentifier == "Body":
|
||||
pass
|
||||
return self.create_annotation2d_representation()
|
||||
elif self.settings["context"].ContextIdentifier == "Box":
|
||||
pass
|
||||
elif self.settings["context"].ContextIdentifier == "Clearance":
|
||||
|
||||
Reference in New Issue
Block a user