Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi!
Trying to work out a way to select and erase lines/polylines of the same angle, for example an exploded hatch.
I found this old LISP routine from 2008, but I can't get it to work. When apploading it returns:
too few arguments in SETQ: (SETQ LINEDATA (ENTGET (CAR (ENTSEL "\nSelect Line at angle of those to be removed:\n"))) ANG1 (ANGLE (CDR (ASSOC 10 LINEDATA)) (CDR (ASSOC 11 LINEDATA))) ANG2 (IF (>= ANG1 PI) (- ANG1 PI) (+ ANG1 PI)) LINESET (SSGET "_X" (QUOTE ((0 . "LINE")))) ANGSET (SSADD) SELECTION SET OF LINES AT THAT ANGLE).
(defun c:ANGLEDEL (/ linedata ang1 ang2 lineset
angset edata eang)
(setq
linedata (entget (car
(entsel "\nSelect Line at angle of those to be removed:
")))
ang1 (angle (cdr (assoc 10 linedata)) (cdr (assoc 11
linedata)))
ang2 (if (>= ang1 pi) (- ang1 pi) (+ ang1
pi)); opposite direction too
lineset (ssget "_X" '((0 .
"LINE"))); gather all Lines
angset (ssadd); base for
selection set of Lines at that angle
); end setq
(while
(> (sslength lineset) 0)
(setq
edata (entget (ssname lineset 0)); get
data about first Line in set
eang (angle (cdr
(assoc 10 edata)) (cdr (assoc 11 edata))); get its angle
); end setq
(if (or (equal eang ang1 0.001) (equal eang
ang2 0.001)); if it runs in the right
direction
(ssadd (ssname lineset 0) angset);
put it in the set of Lines at that angle
); end
if
(ssdel (ssname lineset 0) lineset); take it out of the
set of all Lines
); end while - go back and check the next
one
(command "_.erase" angset)
); end defun
Solved! Go to Solution.