Creating Arcs: Interesting Problem, why?
-
I'm creating a few arcs, as will be shown in the example pic, with this code:
c1 = Pt(0) 'cen r1 = Pt(1) 'rad sa = Pt(2) ea = Pt(3) wshShell.SendKeys "centerpoint = Geom;;Point3d.new" & "{(}" & c1 & "{)}" & vbCr wshShell.SendKeys "vector = Geom;;Vector3d.new 0,0,1" & vbCr wshShell.SendKeys "vector2 = Geom;;Vector3d.new 1,0,0" & vbCr wshShell.SendKeys "vector3 = vector.normalize!" & vbCr wshShell.SendKeys "model = Sketchup.active_model" & vbCr wshShell.SendKeys "entities = model.active_entities" & vbCr wshShell.SendKeys "edges = entities.add_arc " & "centerpoint," & "vector2, vector3," & r1 & "," & sa & "," & ea & vbCr
(That code runs through 4 arcs in an array, pt changing per entity to be created.)
The oddity is, a certain arc wants to reverse the orientation, all driven from the same code, all in the same overall loop of points. Just
one arc does this, all the time. Same problem if I reverse the sa and ea.
Any idea why this is happening?
Thanks
-
does it work if just use ruby?
john
-
sa and ea should be angles not points in the .add_arc arguments.
calculate the arc normal
vector3=c1.vector_to(sa)*c1.vector_to(ea)
Advertisement