I have drawn a random mesh in blender like so:
Found this script wich gets the coordinates from the mesh:
import bpy, bmesh
obj = bpy.context.active_object
if obj.mode == 'EDIT':
# this works only in edit mode,
bm = bmesh.from_edit_mesh(obj.data)
verts = [vert.co for vert in bm.verts]
else:
# this works only in object mode,
verts = [vert.co for vert in obj.data.vertices]
# coordinates as tuples
plain_verts = [vert.to_tuple() for vert in verts]
print(plain_verts)
It returns a list of coordinates
... truncated[(9.0, 0.0, 0.0), (9.0, 7.0, 0.0), (5.0, 7.0, 0.0), (5.0, 8.0, 0.0), (0.0, 8.0, 0.0), (0.0, 0.0, 0.0), (-2.0, 4.0, 0.0)]
I would like these coordinates to place IfcWallType instances from the IFC4 Demo Library,
When creating a new IFC project I see the following command
bpy.ops.bim.assign_class( obj="Wall",
ifc_class="IfcWall",
ifc_representation_class="IfcExtrudedAreaSolid/IfcArbitraryClosedProfileDef")
Which places a wall instance at the origin point. I can't find programmaticaly how to place a lot of walltype instances with this list of coordinates, or if it's even possible? How would the script now where to place the wall? I take it from each vertice coordinates? Then how would the script know where to stop?