mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 01:41:57 +00:00
If objects are not selected, export entire project to IFC
This commit is contained in:
@@ -151,6 +151,7 @@ def do_cut(process_data):
|
||||
|
||||
class IfcCutter:
|
||||
def __init__(self):
|
||||
self.time = None
|
||||
self.selector = ifcopenshell.util.selector.Selector()
|
||||
self.product_shapes = []
|
||||
self.background_elements = []
|
||||
@@ -212,8 +213,6 @@ class IfcCutter:
|
||||
self.sort_background_elements()
|
||||
|
||||
def profile_code(self, message):
|
||||
if not self.ifc_import_settings.should_import_with_profiling:
|
||||
return
|
||||
if not self.time:
|
||||
self.time = time.time()
|
||||
print('{} :: {:.2f}'.format(message, time.time() - self.time))
|
||||
|
||||
@@ -86,8 +86,9 @@ class IfcParser():
|
||||
if not self.projects:
|
||||
self.setup_project()
|
||||
self.projects = self.get_projects()
|
||||
|
||||
self.project = self.projects[0]
|
||||
if not selected_objects:
|
||||
selected_objects = self.get_all_objects_in_project(self.project['raw'])
|
||||
self.units = self.get_units()
|
||||
self.unit_scale = self.get_unit_scale()
|
||||
self.people = self.get_people()
|
||||
@@ -862,6 +863,13 @@ class IfcParser():
|
||||
})
|
||||
return results
|
||||
|
||||
def get_all_objects_in_project(self, collection):
|
||||
results = []
|
||||
results.extend(list(collection.objects))
|
||||
for child in collection.children:
|
||||
results.extend(self.get_all_objects_in_project(child))
|
||||
return results
|
||||
|
||||
def setup_project(self):
|
||||
bpy.ops.bim.quick_project_setup()
|
||||
for collection in bpy.data.collections:
|
||||
|
||||
Reference in New Issue
Block a user