Jump to content

Recommended Posts

Posted

:) 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

Posted

*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)
)

Posted

lee mac :D i am so glad for your help it work with me!!

thank's thank's a lot

emad

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...