heschr Posted January 29, 2014 Share Posted January 29, 2014 Hello, after reading along for quite some time (and profiting alot), here comes my first post: I needed a routine to create a lot of polylines with all the same starting point. I got tired of always have to move the first point back to the right starting point. Here is my solution, kind of an copy-strech mix. Could this be achieved in a more elegant way? (defun c:cfp ( / i ss plist_o ss_n elist_t plist_t pcount bpoint) (vl-load-com) ;get points of original polyline (setq ss (car(entsel "\nSelect Polyline to copy.")) plist_o (vl-remove-if-not (function (lambda (pt) (= (car pt) 10))) (entget ss) ) ) ;get userinput on how many points should be fixed and basepoint for multiple copies (initget 4) (setq pcount (getint "\nHow many points should be fixed? <1>")) (if (= pcount nil) (setq pcount 1)) (setq bpoint (getpoint "\nSelect basepoint")) (while (not nil) ;perform copy and get the points of the temporal polyline (command "_copy" ss "" bpoint pause) (setq ss_n (entlast) elist_t (entget ss_n) plist_t (vl-remove-if-not (function (lambda (pt) (= (car pt) 10))) (entget ss_n) ) ) ;change the fixed points of the temporal polyline back to the ;original points and draw the final polyline (setq i 0) (repeat pcount (setq elist_t (subst (nth i plist_o) (nth i plist_t) elist_t ) ) (setq i (1+ i)) ) (entmod elist_t) ) ) 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.