Hi:
Now I’ve found out how to modify Jim’s plugin to add the Z value and PC Name to each cube. How can I add a label to the front face of the cube with the device name? It is stored in an array so I set the name like this
inst.name = String(@@s[i][3])
inside the instance creation code
for i in 0…@@num_desks do
vec = Geom::Vector3d.new(@@s[i].x,@@s[i].y,@@s[i].z)
trans = Geom::Transformation.translation(vec)
inst = Sketchup.active_model.entities.add_instance(@@compdef,trans)
inst.layer = layer
inst.name = String(@@s[i][3])
I’ve just “solved” it. It is not as I’d like on the face and tends to orient itself to the camera, so I don’t know if it is too bad. I will test yours, meanwhile I’ve added this line to your code
text = Sketchup.active_model.entities.add_text String(@@s[i][3]), [@@s[i].x+10,@@s[i].y+10,@@s[i].z+25]
What is the last part of your line? The [1,0,0]? I will read it anyways