本帖最后由 llsheng_73 于 2018-6-29 13:07 编辑
 - (Defun STB(TAB / d a)
- (While(SetQ a(TblNext TAB(not d)))
- (SetQ d(Cons a d)))
- d)
- (defun Selectbylayer(dxf code f / ly)
- (setq ly(mapcar'(lambda(x)(cons(assoc 370(entget(tblobjname"layer"(cdadr x))))x))(STB"Layer")))
- (ssget"X"(if code(append dxf(list(cons -4(strcat"<"f)))
- (vl-remove'nil(apply'append(mapcar'(lambda(x)(list'(-4 . "<or")x
- '(-4 . "<and")(assoc(car x)'((62 . 256)(6 . "Bylayer")))
- (cons 8(apply'strcat(mapcar'(lambda(x)(strcat(cdaddr x)","))
- (vl-remove-if-not'(lambda(y)(member x y))ly))))
- '(-4 . "and>")'(-4 . "or>")))code)))
- (list(cons -4(strcat f">"))))
- dxf)))
(command"chprop"(SELECTBYLAYER'((0 . "*")) '((62 . 2))"AND")"""c"1"") |