这将使您的ATT不可见:
- (defun c:invis (/ ent obj)
- (vl-load-com)
- (while (setq ent (car (nentsel "\nSelect Attribute: ")))
- (if (eq "ATTRIB" (cdr (assoc 0 (entget ent))))
- (vlax-put (setq obj (vlax-ename->vla-object ent)) 'invisible -1)))
- (princ))
或者,作为一种不同的功能,这将使列出名称的所有标记可见/不可见:
选择时
- (defun c:am1 (/ tag ss att obj)
- (vl-load-com)
- (setq tag "TAG1")
- (while (setq ss (ssget "_+.:E:S" '((0 . "INSERT") (66 . 1))))
- (foreach att (append (vlax-invoke (setq obj (vlax-ename->vla-object (ssname ss 0))) 'GetAttributes)
- (vlax-invoke obj 'GetConstantAttributes))
- (if (eq tag (strcase (vla-get-TagString att)))
- (vlax-put att 'Invisible (~ (vlax-get att 'Invisible))))))
- (princ))
所有区块:
[code](定义c:am2(/标签ss sel)(vl load com)(setq标签“TAG1”);; |