@jsaayman wrote:
.... I want to be able to select all the points at the top and all the points at the bottom and then the program must match the points and draw a line between them.
If you're talking about Point entities, here's another way [lightly tested]:
(defun C:LJPVA (/ ptss n ptlist ptA ptB); = Lines Joining Points Vertically Aligned
(if (setq ptss (ssget '((0 . "POINT"))))
(progn ; then
(repeat (setq n (sslength ptss)); make into list of point lists
(setq ptlist (cons (cdr (assoc 10 (entget (ssname ptss (setq n (1- n)))))) ptlist))
); repeat
(repeat (1- (length ptlist))
(setq ptA (car ptlist) ptlist (cdr ptlist))
(foreach ptB ptlist
(if (equal (list (car ptA) (cadr ptA)) (list (car ptB) (cadr ptB)) 1e-4)
(command "_.line" "_none" ptA "_none" ptB "")
); if
); foreach
); repeat
); progn
); if
(princ)
); defun
It works from one selection of Point entities resulting in one list of point locations, not two. If you have some reason to want to select two separate sets of Points at top and bottom, I assume that can be accommodated, but it's not necessary.
Kent Cooper, AIA