mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-10 14:07:43 +00:00
Users can now specify what objects to cut for documentation with presets
This commit is contained in:
@@ -71,6 +71,7 @@ except ImportError:
|
|||||||
|
|
||||||
import ifcopenshell
|
import ifcopenshell
|
||||||
import ifcopenshell.geom
|
import ifcopenshell.geom
|
||||||
|
import ifcopenshell.util.selector
|
||||||
|
|
||||||
cwd = os.path.dirname(os.path.realpath(__file__))
|
cwd = os.path.dirname(os.path.realpath(__file__))
|
||||||
this_file = os.path.join(cwd, 'cut_ifc.py')
|
this_file = os.path.join(cwd, 'cut_ifc.py')
|
||||||
@@ -164,6 +165,7 @@ class IfcCutter:
|
|||||||
self.cut_pickle_file = 'cut.pickle'
|
self.cut_pickle_file = 'cut.pickle'
|
||||||
self.should_recut = True
|
self.should_recut = True
|
||||||
self.should_recut_selected = True
|
self.should_recut_selected = True
|
||||||
|
self.cut_objects = ''
|
||||||
self.selected_global_ids = []
|
self.selected_global_ids = []
|
||||||
self.should_extract = True
|
self.should_extract = True
|
||||||
self.diagram_name = None
|
self.diagram_name = None
|
||||||
@@ -291,8 +293,8 @@ class IfcCutter:
|
|||||||
with open(shape_pickle, 'rb') as shape_file:
|
with open(shape_pickle, 'rb') as shape_file:
|
||||||
shape_map = pickle.load(shape_file)
|
shape_map = pickle.load(shape_file)
|
||||||
|
|
||||||
# TODO: This should perhaps be configurable, e.g. spaces cut to show zones in the drawing
|
selector = ifcopenshell.util.selector.Selector()
|
||||||
products.extend(ifc_file.by_type('IfcElement'))
|
products.extend(selector.parse(ifc_file, self.cut_objects))
|
||||||
|
|
||||||
include_elements = []
|
include_elements = []
|
||||||
for i, product in enumerate(products):
|
for i, product in enumerate(products):
|
||||||
|
|||||||
@@ -2080,6 +2080,10 @@ class CutSection(bpy.types.Operator):
|
|||||||
ifc_cutter.data_dir = bpy.context.scene.BIMProperties.data_dir
|
ifc_cutter.data_dir = bpy.context.scene.BIMProperties.data_dir
|
||||||
ifc_cutter.diagram_name = self.diagram_name
|
ifc_cutter.diagram_name = self.diagram_name
|
||||||
ifc_cutter.background_image = bpy.context.scene.render.filepath
|
ifc_cutter.background_image = bpy.context.scene.render.filepath
|
||||||
|
if camera.data.BIMCameraProperties.cut_objects == 'CUSTOM':
|
||||||
|
ifc_cutter.cut_objects = camera.data.BIMCameraProperties.cut_objects_custom
|
||||||
|
else:
|
||||||
|
ifc_cutter.cut_objects = camera.data.BIMCameraProperties.cut_objects
|
||||||
ifc_cutter.leader_obj = None
|
ifc_cutter.leader_obj = None
|
||||||
ifc_cutter.stair_obj = None
|
ifc_cutter.stair_obj = None
|
||||||
ifc_cutter.dimension_obj = None
|
ifc_cutter.dimension_obj = None
|
||||||
|
|||||||
@@ -416,6 +416,13 @@ class BIMCameraProperties(PropertyGroup):
|
|||||||
view_name: StringProperty(name="View Name")
|
view_name: StringProperty(name="View Name")
|
||||||
diagram_scale: EnumProperty(items=getDiagramScales, name='Diagram Scale')
|
diagram_scale: EnumProperty(items=getDiagramScales, name='Diagram Scale')
|
||||||
is_nts: BoolProperty(name='Is NTS')
|
is_nts: BoolProperty(name='Is NTS')
|
||||||
|
cut_objects: EnumProperty(items=[
|
||||||
|
('.IfcWall|.IfcSlab|.IfcCurtainWall|.IfcStair|.IfcStairFlight|.IfcColumn|.IfcBeam|.IfcMember|.IfcCovering',
|
||||||
|
'Overall Plan / Section', ''),
|
||||||
|
('.IfcElement', 'Detail Drawing', ''),
|
||||||
|
('CUSTOM', 'Custom', '')
|
||||||
|
], name='Cut Objects')
|
||||||
|
cut_objects_custom: StringProperty(name='Custom Cut')
|
||||||
|
|
||||||
|
|
||||||
class BIMTextProperties(PropertyGroup):
|
class BIMTextProperties(PropertyGroup):
|
||||||
|
|||||||
@@ -855,6 +855,12 @@ class BIM_PT_camera(Panel):
|
|||||||
row = layout.row()
|
row = layout.row()
|
||||||
row.operator('bim.resize_text')
|
row.operator('bim.resize_text')
|
||||||
|
|
||||||
|
row = layout.row()
|
||||||
|
row.prop(props, 'cut_objects')
|
||||||
|
if props.cut_objects == 'CUSTOM':
|
||||||
|
row = layout.row()
|
||||||
|
row.prop(props, 'cut_objects_custom')
|
||||||
|
|
||||||
row = layout.row(align=True)
|
row = layout.row(align=True)
|
||||||
row.prop(props, 'diagram_scale', text='')
|
row.prop(props, 'diagram_scale', text='')
|
||||||
row.operator('bim.cut_section')
|
row.operator('bim.cut_section')
|
||||||
|
|||||||
Reference in New Issue
Block a user