Hi , TIG & Dan
thank you for you reply , to confirm this is not the problem of decimal place , i've removed all the decimal place from the array, but it still hang. I found the major problem is the diameter of cicle , if i change it to 50mm it will hang. (but if you run "followme" manually , it won't hang even you set the diameter to 100mm)
#======================================================
def draw_all_object_0001
model = Sketchup.active_model
entities = model.active_entities
pts = []
pts[0] = [393 , 512 , 0]
pts[1] = [383 , 490 , 0]
pts[2] = [385 , 482 , 0]
pts[3] = [323 , 369 , 0]
pts[4] = [331 , 365 , 0]
pts[5] = [322 , 350 , 0]
pts[6] = [235 , 398 , 0]
pts[7] = [304 , 522 , 0]
pts[8] = [340 , 502 , 0]
pts[9] = [356 , 531 , 0]
p2vector = [0,1,0]
ptvertex = pts[0]
vectorX = Geom::Vector3d.new p2vector
vectorX2 = vectorX.normalize!
edgesX = entities.add_circle ptvertex, vectorX2, 20.mm , 8 # change to 50.mm will hang
faceX = entities.add_face edgesX
curve = entities.add_curve pts
begin
status = faceX.followme curve #sketchup hang here
rescue
UI.messagebox $!.message
end
end
UI.menu("PlugIns").add_item("Draw -- myshape") {
draw_all_object_0001
view = Sketchup.active_model.active_view
new_view = view.zoom_extents
}
#=========================================================