也谢谢我
你不喜欢吗?如果是这样,我可以改变它。
试试下面的程序,让我知道结果。
- (defun c:test (/ s sel nm lst ss)
- ;; Tharwat 26.Mar.2014 ;;
- ;; Hide Block name by Selection ;;
- (or doc (setq doc (vla-get-activedocument (vlax-get-acad-object))))
- (princ "\n Select Blocks to hide all with the same name ...")
- (if (setq s (ssget "_:L" '((0 . "INSERT"))))
- (progn (vlax-for x (setq sel (vla-get-activeselectionset doc))
- (if (not (member (setq nm (vla-get-effectivename x)) lst))
- (setq lst (cons nm lst))
- )
- )
- (vla-delete sel)
- (if (setq ss (ssget "_X"
- (list '(0 . "INSERT")
- (cons 410 (getvar 'CTAB))
- (cons 2 (strcat "`*U*," (apply 'strcat (mapcar '(lambda (u) (strcat u ",")) lst))))
- )
- )
- )
- (progn (vlax-for x (setq sel (vla-get-activeselectionset doc))
- (if (member (setq nm (vla-get-effectivename x)) lst)
- (vl-catch-all-apply 'vla-put-visible (list x :vlax-false))
- )
- )
- )
- (vla-delete sel)
- )
- )
- )
- (princ)
- )
- (vl-load-com)
|