mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-23 09:32:46 +00:00
black .
This commit is contained in:
@@ -155,18 +155,26 @@ class AddProfileDef(bpy.types.Operator, tool.Ifc.Operator):
|
|||||||
obj = context.scene.BIMProfileProperties.object_to_profile
|
obj = context.scene.BIMProfileProperties.object_to_profile
|
||||||
if obj:
|
if obj:
|
||||||
if len(obj.data.polygons) != 1:
|
if len(obj.data.polygons) != 1:
|
||||||
self.report({"WARNING"}, "This mesh is invalid to create a profile. Select a flat mesh with no more then one face.")
|
self.report(
|
||||||
|
{"WARNING"},
|
||||||
|
"This mesh is invalid to create a profile. Select a flat mesh with no more then one face.",
|
||||||
|
)
|
||||||
return
|
return
|
||||||
for v in obj.data.polygons[0].vertices:
|
for v in obj.data.polygons[0].vertices:
|
||||||
vert = obj.data.vertices[v]
|
vert = obj.data.vertices[v]
|
||||||
if vert.co.z > 0:
|
if vert.co.z > 0:
|
||||||
self.report({"WARNING"}, "This mesh is invalid to create a profile. Select a flat mesh with all its vertices at z=0")
|
self.report(
|
||||||
|
{"WARNING"},
|
||||||
|
"This mesh is invalid to create a profile. Select a flat mesh with all its vertices at z=0",
|
||||||
|
)
|
||||||
return
|
return
|
||||||
obj_points.append((vert.co.x, vert.co.y))
|
obj_points.append((vert.co.x, vert.co.y))
|
||||||
if obj_points:
|
if obj_points:
|
||||||
obj_points.append(obj_points[0])
|
obj_points.append(obj_points[0])
|
||||||
obj_points = [(v[0] - obj_points[0][0], v[1] - obj_points[0][1]) for v in obj_points] # Make sure the first point is (0, 0)
|
obj_points = [
|
||||||
|
(v[0] - obj_points[0][0], v[1] - obj_points[0][1]) for v in obj_points
|
||||||
|
] # Make sure the first point is (0, 0)
|
||||||
|
|
||||||
props = context.scene.BIMProfileProperties
|
props = context.scene.BIMProfileProperties
|
||||||
profile_class = props.profile_classes
|
profile_class = props.profile_classes
|
||||||
if profile_class == "IfcArbitraryClosedProfileDef":
|
if profile_class == "IfcArbitraryClosedProfileDef":
|
||||||
|
|||||||
@@ -72,7 +72,9 @@ class BIMProfileProperties(PropertyGroup):
|
|||||||
description="Check to only show IfcProfileDefs attached to IfcMaterialProfiles",
|
description="Check to only show IfcProfileDefs attached to IfcMaterialProfiles",
|
||||||
update=lambda self, context: bpy.ops.bim.load_profiles(),
|
update=lambda self, context: bpy.ops.bim.load_profiles(),
|
||||||
)
|
)
|
||||||
object_to_profile: PointerProperty(name="Object to profile", type=bpy.types.Object, description="Object to copy the mesh to a profile")
|
object_to_profile: PointerProperty(
|
||||||
|
name="Object to profile", type=bpy.types.Object, description="Object to copy the mesh to a profile"
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def generate_thumbnail_for_active_profile():
|
def generate_thumbnail_for_active_profile():
|
||||||
|
|||||||
@@ -2503,7 +2503,6 @@ class ClearMeasurement(bpy.types.Operator):
|
|||||||
def poll(cls, context):
|
def poll(cls, context):
|
||||||
return len(context.scene.BIMPolylineProperties.measurement_polyline) > 0
|
return len(context.scene.BIMPolylineProperties.measurement_polyline) > 0
|
||||||
|
|
||||||
|
|
||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
context.scene.BIMPolylineProperties.measurement_polyline.clear()
|
context.scene.BIMPolylineProperties.measurement_polyline.clear()
|
||||||
MeasureDecorator.uninstall()
|
MeasureDecorator.uninstall()
|
||||||
|
|||||||
Reference in New Issue
Block a user