试试这个:
- (defun c:b2p(/ sBl cLay bSet)
- (if(and
- (setq sBl(entsel "\nPick sample block > "))
- (setq cLay(cdr(assoc 8(entget(car sBl)))))
- (setq bSet(ssget "_X" (list '(0 . "INSERT")(cons 8 cLay))))
- ); end and
- (progn
- (princ(strcat "\n"(itoa(sslength bSet)) " blocks found. "))
- (sssetfirst nil bSet)
- (initget 1 "Yes No")
- (setq cAns(getkword "\nAdd points? [Yes/No]: "))
- (if(= "Yes" cAns)
- (mapcar '(lambda(x)(command "_.point"
- (cdr(assoc 10(entget x)))))
- (vl-remove-if 'listp
- (mapcar 'cadr(ssnamex bSet))))
- ); end if
- ); end progn
- ); end if
- (princ)
- ); end of c:b2p
|