块就像是人,属性就像衣服,你可以穿一件或者多件,也可以一丝不挂。一丝不挂就是普通块,没带属性
厉害,一听就懂 weimeng555 发表于 2024-5-12 01:06
测试了下,麻烦没反应呢?大佬能否解毒一波,选择块后没反应了,提示:选择对象: #
用attman查看也没有增 ...
你进入块编辑器里就会发现,其实是添加进去属性了 执行命令 ATTSYNC 更新一下图块就可以 (defun c:addatt(/ doc obj vbj blocks
blockname block ipoint insertionpoint
attheight attmode attpromptatttag attvalue
)
(setq doc (vla-get-ActiveDocument (vlax-get-acad-object)))
(setq obj (car (entsel)))
(setq vbj (vlax-ename->vla-object obj))
(setq blocks (vla-get-blocks DOC))
(setq blockname (vla-get-name vbj))
(setq block (vla-item blocks blockname))
(setq ipoint (cdr (assoc 10 (entget obj))))
(setqinsertionPoint (apply 'vlax-3d-point ipoint)
attHeight 1
attMode acAttributeModeVerify
attPrompt "提示"
attTag "标记"
attValue "好喜欢菜卷鱼"
)
(vla-AddAttribute
block attHeight attMode attPrompt insertionPoint attTag attValue)
;;;手动去attsync
(vl-cmdf ".ATTSYNC" "S"obj "Y")
)
页:
1
[2]