mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-18 03:19:53 +00:00
IfcGrid - add placement by default to avoid invalid IFC
This commit is contained in:
@@ -20,6 +20,7 @@ import bpy
|
||||
import ifcopenshell.api
|
||||
import ifcopenshell.api.grid
|
||||
import bonsai.tool as tool
|
||||
import bonsai.core.geometry
|
||||
import bonsai.core.root
|
||||
from bpy.types import Operator
|
||||
from bpy.props import FloatProperty, IntProperty
|
||||
@@ -38,6 +39,10 @@ def add_object(self: "BIM_OT_add_object", context: bpy.types.Context) -> None:
|
||||
grid = tool.Ifc.get_entity(obj)
|
||||
assert grid
|
||||
|
||||
# Requirement in IFC4+.
|
||||
if tool.Ifc.get_schema() != "IFC2X3":
|
||||
bonsai.core.geometry.edit_object_placement(tool.Ifc, tool.Geometry, tool.Surveyor, obj)
|
||||
|
||||
for i in range(0, self.total_u):
|
||||
verts = [
|
||||
Vector((-2, i * self.u_spacing, 0)),
|
||||
|
||||
Reference in New Issue
Block a user