whilin Posted June 25, 2013 Share Posted June 25, 2013 I am trying to writing a small lisp to do following thing between two polylines: It must: select first polyline divide it in n parts -> get computed points. From each point, draw a segments perpendicular to the first polyline that stops at the second polyline. Every two segments, break the drawn segment in two parts and delete one part. I don't know how to start writing my lisp Thank you a lot. Quote Link to comment Share on other sites More sharing options...
whilin Posted June 25, 2013 Author Share Posted June 25, 2013 I FOUND this autolisp but it doesn't work in AUTOCAD 2014: (defun C:PLWEB () (command "_.undo" "_begin") (setq poly1 (car (entsel "\nSelect first Polyline: ")) poly2 (car (entsel "\nSelect second Polyline: ")) segs (getint "\nDivide first Polyline into how many segments? ") seglen ; length of segment along 1st Pline (/ (vlax-curve-getDistAtParam poly1 (vlax-curve-getEndParam poly1) ); end getDist segs ); end getDist and length1 inc 0 osm (getvar 'osmode) ); end setq (setvar 'osmode 0) (repeat (1+ segs) (command "_.line" (vlax-curve-getPointAtDist poly1 (* seglen inc); position along 1st Pline ); end getPoint "per" (vlax-curve-getClosestPointTo poly2 (getvar 'lastpoint) ); end getClosest "" ; end line ); end command (setq inc (1+ inc)) ); end repeat (setvar 'osmode osm) (command "_.undo" "_end") ); end defun This is the error: Specify first point: Specify next point or [undo]: per to No Endpoint found for specified point. Point or option keyword required. ; error: Function cancelled Specify next point or [undo]: Hope it helps. Thank you again Quote Link to comment Share on other sites More sharing options...
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.