马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
 - (defun c:GetLwClsd (/ ss) ; Notice that *flag_def* is not localised, as it is a global variable
-
- (or *flag_def* (setq *flag_def* "Open")) ;; Set first-time default
-
- (initget "Open Closed") ; Only allow these values, allow enter also
-
- (setq *flag_def*
- (cond ((getkword
- (strcat "\nLooking for [O]pen or [C]losed LWPolylines? <" *flag_def* "> : ")))
- ;; Either a keyword has been entered, hence set it as the new default
-
- (t *flag_def*))) ;; Else use the original default
-
- (if (setq ss
- (ssget "_X"
- (list (cons 0 "LWPOLYLINE")
- (cons 8 (getvar "CLAYER"))
- (cons -4 "<OR")
- (cons 70 (cond ((eq *flag_def* "Open") 0) (t 1)))
- (cons 70 (cond ((eq *flag_def* "Open") 128) (t 129)))
- (cons -4 "OR>"))))
-
- (progn
- (foreach ent (mapcar 'cadr (ssnamex ss))
- (setq lay (tblsearch "LAYER" (cdr (assoc 8 (entget ent)))))
- (if (or (eq 1 (logand 1 (cdr (assoc 70 lay))))
- (eq 4 (logand 4 (cdr (assoc 70 lay)))))
- (ssdel ent ss)))
- (princ (strcat "\n" (itoa (sslength ss)) " found."))
- (sssetfirst nil ss))
- (princ "\n<< nothing found >>"))
- (princ))
- (textscr) ; bring text-window to front and inform user
- (princ "\nSearching LW-Polylines at curent layer.
- Note: splines, curved fit, and 3D plines
- will not work\nStart with mit << GetLwClsd >>")
|