Code snippet:
- Code: Select all
sel.each{|e|
tr = e.transformation
ip = tr.origin
xa = tr.xaxis
ya = tr.yaxis
a_vector = Geom::Vector3d.new(a_center.x-ip.x, a_center.y-ip.y, 1)
if(@@axis == "X")
obj_axis = xa # I've tried with this...
obj_axis = Geom::Vector3d.new(xa) # ...this...
obj_axis = Geom::Vector3d.new(xa.to_a) # ...and this
elsif(@@axis == "Y")
#obj_axis = ya
obj_axis = Geom::Vector3d.new(ya.to_a)
end#if
angle = a_vector.angle_between obj_axis ### ArgumentError: Cannot convert argument to Geom::Vector3d
# do more stuff here...
}