mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-10-02 21:12:07 +00:00
If objects are not selected, export entire project to IFC
This commit is contained in:
@@ -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