mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-26 18:21:59 +00:00
black format after #5172
This commit is contained in:
@@ -70,15 +70,13 @@ class Scheduler:
|
|||||||
elif infile.endswith("xlsx"):
|
elif infile.endswith("xlsx"):
|
||||||
self.schedule_xlsx(infile, outfile)
|
self.schedule_xlsx(infile, outfile)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def parse_css(self, infile):
|
def parse_css(self, infile):
|
||||||
stylesheet_path = os.path.splitext(infile)[0] + ".css"
|
stylesheet_path = os.path.splitext(infile)[0] + ".css"
|
||||||
if not os.path.exists(stylesheet_path):
|
if not os.path.exists(stylesheet_path):
|
||||||
stylesheet_rel_path = getattr(bpy.context.scene.DocProperties, "schedules_stylesheet_path")
|
stylesheet_rel_path = getattr(bpy.context.scene.DocProperties, "schedules_stylesheet_path")
|
||||||
ifc_file_path = os.path.dirname(IfcStore.path)
|
ifc_file_path = os.path.dirname(IfcStore.path)
|
||||||
stylesheet_path = ifc_file_path + "\\" + stylesheet_rel_path
|
stylesheet_path = ifc_file_path + "\\" + stylesheet_rel_path
|
||||||
if not os.path.exists(stylesheet_path):
|
if not os.path.exists(stylesheet_path):
|
||||||
stylesheet_path = os.path.join(bpy.context.scene.BIMProperties.data_dir, "assets", "schedule.css")
|
stylesheet_path = os.path.join(bpy.context.scene.BIMProperties.data_dir, "assets", "schedule.css")
|
||||||
with open(stylesheet_path, "r") as stylesheet:
|
with open(stylesheet_path, "r") as stylesheet:
|
||||||
css = stylesheet.read()
|
css = stylesheet.read()
|
||||||
|
|||||||
@@ -354,7 +354,9 @@ class WallPolylineDecorator:
|
|||||||
last_point = Vector((0, 0, 0))
|
last_point = Vector((0, 0, 0))
|
||||||
|
|
||||||
if is_input_on:
|
if is_input_on:
|
||||||
snap_vector = Vector((float(cls.input_panel["X"]), float(cls.input_panel["Y"]), default_container_elevation))
|
snap_vector = Vector(
|
||||||
|
(float(cls.input_panel["X"]), float(cls.input_panel["Y"]), default_container_elevation)
|
||||||
|
)
|
||||||
else:
|
else:
|
||||||
snap_vector = Vector((snap_prop.x, snap_prop.y, default_container_elevation))
|
snap_vector = Vector((snap_prop.x, snap_prop.y, default_container_elevation))
|
||||||
|
|
||||||
|
|||||||
@@ -105,11 +105,12 @@ class SnapMousePoint(PropertyGroup):
|
|||||||
z: bpy.props.FloatProperty(name="Z")
|
z: bpy.props.FloatProperty(name="Z")
|
||||||
snap_type: bpy.props.StringProperty(name="Snap Type")
|
snap_type: bpy.props.StringProperty(name="Snap Type")
|
||||||
|
|
||||||
|
|
||||||
class PolylinePoint(PropertyGroup):
|
class PolylinePoint(PropertyGroup):
|
||||||
x: bpy.props.FloatProperty(name="X")
|
x: bpy.props.FloatProperty(name="X")
|
||||||
y: bpy.props.FloatProperty(name="Y")
|
y: bpy.props.FloatProperty(name="Y")
|
||||||
z: bpy.props.FloatProperty(name="Z")
|
z: bpy.props.FloatProperty(name="Z")
|
||||||
|
|
||||||
|
|
||||||
class BIMModelProperties(PropertyGroup):
|
class BIMModelProperties(PropertyGroup):
|
||||||
ifc_class: bpy.props.EnumProperty(items=get_ifc_class, name="Construction Class", update=update_ifc_class)
|
ifc_class: bpy.props.EnumProperty(items=get_ifc_class, name="Construction Class", update=update_ifc_class)
|
||||||
|
|||||||
@@ -397,9 +397,7 @@ class DrawPolylineWall(bpy.types.Operator):
|
|||||||
# TODO Use ALT key to give the user the option to choose between the two results.
|
# TODO Use ALT key to give the user the option to choose between the two results.
|
||||||
# TODO Create decorator for this
|
# TODO Create decorator for this
|
||||||
try:
|
try:
|
||||||
snap_point_vector = Vector(
|
snap_point_vector = Vector((snap_point[0].x, snap_point[0].y, snap_point[0].z))
|
||||||
(snap_point[0].x, snap_point[0].y, snap_point[0].z)
|
|
||||||
)
|
|
||||||
snap_point_axis_1 = (
|
snap_point_axis_1 = (
|
||||||
Vector((snap_point[0].x + 1000, snap_point[0].y, default_container_elevation)),
|
Vector((snap_point[0].x + 1000, snap_point[0].y, default_container_elevation)),
|
||||||
Vector((snap_point[0].x - 1000, snap_point[0].y, default_container_elevation)),
|
Vector((snap_point[0].x - 1000, snap_point[0].y, default_container_elevation)),
|
||||||
@@ -410,11 +408,11 @@ class DrawPolylineWall(bpy.types.Operator):
|
|||||||
)
|
)
|
||||||
snap_angle_axis = (axis_start, axis_end)
|
snap_angle_axis = (axis_start, axis_end)
|
||||||
result_1 = tool.Cad.intersect_edges(snap_angle_axis, snap_point_axis_1)
|
result_1 = tool.Cad.intersect_edges(snap_angle_axis, snap_point_axis_1)
|
||||||
result_1 = Vector((result_1[0].x, result_1[0].y, default_container_elevation))
|
result_1 = Vector((result_1[0].x, result_1[0].y, default_container_elevation))
|
||||||
distance_1 = (result_1 - snap_point_vector).length
|
distance_1 = (result_1 - snap_point_vector).length
|
||||||
|
|
||||||
result_2 = tool.Cad.intersect_edges(snap_angle_axis, snap_point_axis_2)
|
result_2 = tool.Cad.intersect_edges(snap_angle_axis, snap_point_axis_2)
|
||||||
result_2 = Vector((result_2[0].x, result_2[0].y, default_container_elevation))
|
result_2 = Vector((result_2[0].x, result_2[0].y, default_container_elevation))
|
||||||
distance_2 = (result_2 - snap_point_vector).length
|
distance_2 = (result_2 - snap_point_vector).length
|
||||||
|
|
||||||
if distance_1 < distance_2:
|
if distance_1 < distance_2:
|
||||||
@@ -519,8 +517,8 @@ class DrawPolylineWall(bpy.types.Operator):
|
|||||||
dwg = DumbWallGenerator(relating_type).generate(True)
|
dwg = DumbWallGenerator(relating_type).generate(True)
|
||||||
if dwg:
|
if dwg:
|
||||||
for wall1, wall2 in zip(dwg, dwg[1:] + [dwg[0]]):
|
for wall1, wall2 in zip(dwg, dwg[1:] + [dwg[0]]):
|
||||||
print(wall1['obj'], wall2['obj'])
|
print(wall1["obj"], wall2["obj"])
|
||||||
DumbWallJoiner().join_V(wall1['obj'], wall2['obj'])
|
DumbWallJoiner().join_V(wall1["obj"], wall2["obj"])
|
||||||
|
|
||||||
def modal(self, context, event):
|
def modal(self, context, event):
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user