maahee Posted June 1 Posted June 1 (edited) (defun c:maahee () (setq p1 (getpoint "\nEnter start point: ")) (setq p2 (getpoint p1 "\nSelect second point: ")) (setq dist (getint "\nEnter number: ")) (setq inc (/ (distance p1 p2) dist)) (setq i 0) (while (<= i dist) (setq stpt-b (polar p1 (angle p1 p2) (* i inc))) (setq stpt-f (polar p1 (angle p1 p2) (+ (* i inc) 0.5))) (setq vertpt-b (polar stpt-b (+ (/ pi 2) (angle p1 p2)) 2.00)) (setq vertpt-f (polar stpt-f (+ (/ pi 2) (angle p1 p2)) 2.00)) (setq ssdl1 (ssadd)) ; create blank / empty selection set (command "line" stpt-b vertpt-b"") ;; Draw the connect point (ssadd (entlast) ssdl1) (setq ssdl (ssadd)) ; create blank / empty selection set (command "line" stpt-f vertpt-f"") ;; Draw the connect point (ssadd (entlast) ssdl) (setq ss1 (ssadd)) ; create blank / empty selection set (command "line"p1 p2"") (ssadd (entlast) ss1) (command "_.offset" 2 ss1 vertpt-f"") (setq c1 (polar stpt-b (angle p1 p2) 0.25)) (setq c2 (polar vertpt-b (angle p1 p2) 0.25)) (command _trim"" ssdl1 ssdl"" "f" c1 c2"") (setq i (+ i 1)) ) ) Trim function not work in loop (command _trim"" ssdl1 ssdl"" "f" c1 c2"") please help for solve issuepre widget Edited June 5 by maahee Quote
mhupp Posted June 1 Posted June 1 (edited) Check all your command line's need to have space between variables and "quotes" ;bad (command _trim"" ssdl1 ssdl"" "f" c1 c2"") ;good (command _trim "" ssdl1 ssdl "" "f" c1 c2 "") space space space I counted about 5 lines that need space --edit Its also a good idea to add "_non" when feeding points into command line because they do snap to entity's that are close depending on zoom level. even if osnap is toggled off. (command "line" "_non" p1 "_non" p2 "") --edit -- edit just looked at the code a bit more and move all the creating of the blank selection sets outside of the loop you only need to do that once. and it might clear out the selection set. Edited June 1 by mhupp 1 1 Quote
maahee Posted June 2 Author Posted June 2 (edited) (command "pline" vertpt-b stpt-b stpt-f vertpt-f "c") Trim all object present inside the all pline trim at one time which is created by while loop function it is more effective than trim single object process Edited June 2 by maahee Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.