emadageeb Posted May 9, 2011 Posted May 9, 2011 In my planning project lee mac lisp areatable help me a lot could you help me please by lisp (by multi selection adding points to every end point of lines and evry intersection of two lines and if there are two or three line begin from one point the lisp create only one point.I will be very thankful if you do it for me. Emad Quote
Lee Mac Posted May 9, 2011 Posted May 9, 2011 *shrug* was a fun one to code (defun c:LinePoints ( / i j ss e1 e2 p1 p2 p3 points ) (if (setq i -1 ss (ssget '((0 . "LINE")))) (progn (while (setq e1 (ssname ss (setq i (1+ i) j i))) (setq points (cons (setq p1 (cdr (assoc 10 (entget e1)))) (cons (setq p2 (cdr (assoc 11 (entget e1)))) points) ) ) (while (setq e2 (ssname ss (setq j (1+ j)))) (if (setq p3 (inters p1 p2 (cdr (assoc 10 (entget e2))) (cdr (assoc 11 (entget e2))))) (setq points (cons p3 points)) ) ) ) (while points (entmakex (list (cons 0 "POINT") (cons 10 (car points)))) (setq points (vl-remove-if '(lambda ( x ) (equal (car points) x 1e-) (cdr points)) ) ) ) ) (princ) ) Quote
emadageeb Posted May 9, 2011 Author Posted May 9, 2011 lee mac i am so glad for your help it work with me!! thank's thank's a lot emad 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.