mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-10-02 13:04:49 +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
|
||||||
import ifcopenshell.api.grid
|
import ifcopenshell.api.grid
|
||||||
import bonsai.tool as tool
|
import bonsai.tool as tool
|
||||||
|
import bonsai.core.geometry
|
||||||
import bonsai.core.root
|
import bonsai.core.root
|
||||||
from bpy.types import Operator
|
from bpy.types import Operator
|
||||||
from bpy.props import FloatProperty, IntProperty
|
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)
|
grid = tool.Ifc.get_entity(obj)
|
||||||
assert grid
|
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):
|
for i in range(0, self.total_u):
|
||||||
verts = [
|
verts = [
|
||||||
Vector((-2, i * self.u_spacing, 0)),
|
Vector((-2, i * self.u_spacing, 0)),
|
||||||
|
|||||||
Reference in New Issue
Block a user