mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-24 10:06:57 +00:00
Support invalid IfcGrid elements coming from Revit. See #1133.
This commit is contained in:
@@ -787,8 +787,10 @@ class IfcImporter:
|
|||||||
collection.children.link(u_axes)
|
collection.children.link(u_axes)
|
||||||
v_axes = bpy.data.collections.new("VAxes")
|
v_axes = bpy.data.collections.new("VAxes")
|
||||||
collection.children.link(v_axes)
|
collection.children.link(v_axes)
|
||||||
self.create_grid_axes(grid.UAxes, u_axes, element_matrix)
|
if grid.UAxes: # Revit is known to create invalid grids
|
||||||
self.create_grid_axes(grid.VAxes, v_axes, element_matrix)
|
self.create_grid_axes(grid.UAxes, u_axes, element_matrix)
|
||||||
|
if grid.VAxes: # Revit is known to create invalid grids
|
||||||
|
self.create_grid_axes(grid.VAxes, v_axes, element_matrix)
|
||||||
if grid.WAxes:
|
if grid.WAxes:
|
||||||
w_axes = bpy.data.collections.new("WAxes")
|
w_axes = bpy.data.collections.new("WAxes")
|
||||||
collection.children.link(w_axes)
|
collection.children.link(w_axes)
|
||||||
@@ -1903,8 +1905,11 @@ class IfcImporter:
|
|||||||
return self.place_object_in_spatial_tree(container, obj)
|
return self.place_object_in_spatial_tree(container, obj)
|
||||||
elif element.is_a("IfcGrid"):
|
elif element.is_a("IfcGrid"):
|
||||||
grid_collection = bpy.data.collections.get(obj.name)
|
grid_collection = bpy.data.collections.get(obj.name)
|
||||||
self.spatial_structure_elements[container.GlobalId]["blender"].children.link(grid_collection)
|
if grid_collection:
|
||||||
grid_collection.objects.link(obj)
|
self.spatial_structure_elements[container.GlobalId]["blender"].children.link(grid_collection)
|
||||||
|
grid_collection.objects.link(obj)
|
||||||
|
else: # Revit can create invalid grid objects
|
||||||
|
self.spatial_structure_elements[container.GlobalId]["blender"].objects.link(obj)
|
||||||
else:
|
else:
|
||||||
self.spatial_structure_elements[container.GlobalId]["blender"].objects.link(obj)
|
self.spatial_structure_elements[container.GlobalId]["blender"].objects.link(obj)
|
||||||
elif hasattr(element, "Decomposes") and element.Decomposes:
|
elif hasattr(element, "Decomposes") and element.Decomposes:
|
||||||
|
|||||||
Reference in New Issue
Block a user