0
$\begingroup$

How to reference a wall of an Archimesh room using Python API?

Specifically I would like to create a window panel for a specific Wall Using Python API

I printed out the children names of object 'room' but could not find [Ww]all*. It seems to me like 'Wall' is not an object in Archimesh.

Then I printed out the data for the 'room' object (particularly the vertices (attached below), but could not interpret them properly.I am wondering if the first four vertices would correspond to the geometry of Wall1, etc. Please help confirm my understanding and the meaning or orders of these vertices.

Upon examining the output list of vertices. I noticed there are 22 of them. I had defined 6 walls. This should bring the total of vertices to 12. Why so many? Is it possible that Archimesh include the vertices of the children of the 'room' object as well

>>> for child in room_object.children:
...     print (child.name)
...     
Baseboard
Ceiling
Door_Group
Door_Group.001
Door_Group.003
Door_Group.004
Floor
Window_Group
Window_Group.001
Window_Group.002
Window_Group.004
Window_Group.005
Window_Group.006
Window_Group.007
Window_Group.008


>>> room_object = bpy.data.objects['Room']
>>> 
>>> # Access the object data of the room object
>>> room_data = room_object.data
>>> 
>>> vertices = room_data.vertices
>>> for vertex in vertices:
...     # Do something with the vertex
...     print("Vertex coordinates:", vertex.co)
...     
Vertex coordinates: <Vector (0.0000, 0.0000, 4.0000)>
Vertex coordinates: <Vector (0.0000, 0.0000, 0.0000)>
Vertex coordinates: <Vector (0.0000, 10.0000, 4.0000)>
Vertex coordinates: <Vector (0.0000, 10.0000, 0.0000)>
Vertex coordinates: <Vector (0.0000, 20.0000, 0.0000)>
Vertex coordinates: <Vector (0.0000, 20.0000, 4.0000)>
Vertex coordinates: <Vector (-7.5000, 20.0000, 4.0000)>
Vertex coordinates: <Vector (-7.5000, 20.0000, 0.0000)>
Vertex coordinates: <Vector (-15.0000, 20.0000, 0.0000)>
Vertex coordinates: <Vector (-15.0000, 20.0000, 4.0000)>
Vertex coordinates: <Vector (-17.4749, 17.5251, 4.0000)>
Vertex coordinates: <Vector (-17.4749, 17.5251, 0.0000)>
Vertex coordinates: <Vector (-19.9497, 15.0503, 0.0000)>
Vertex coordinates: <Vector (-19.9497, 15.0503, 4.0000)>
Vertex coordinates: <Vector (-19.9497, 10.0503, 4.0000)>
Vertex coordinates: <Vector (-19.9497, 10.0503, 0.0000)>
Vertex coordinates: <Vector (-19.9497, 5.0503, 0.0000)>
Vertex coordinates: <Vector (-19.9497, 5.0503, 4.0000)>
Vertex coordinates: <Vector (-17.4749, 2.5754, 4.0000)>
Vertex coordinates: <Vector (-17.4749, 2.5754, 0.0000)>
Vertex coordinates: <Vector (-15.0000, 0.1005, 0.0000)>
Vertex coordinates: <Vector (-15.0000, 0.1005, 4.0000)>
```
$\endgroup$

0

You must log in to answer this question.

Browse other questions tagged .