各位大神看一下,输入tt点击块,把块属性的这个值写到边上
各位大神看一下,输入tt点击块,把块属性的这个值写到边上,最好可以批量看看效果:
ssyfeng 发表于 2023-8-14 18:06
看看效果:
就是这个效果 ssyfeng 发表于 2023-8-14 18:06
看看效果:
大佬,总是那么的牛叉
ssyfeng 发表于 2023-8-14 18:06
看看效果:
666呀 无聊玩一下
(defun c:NM (/ i p1 p2 pt s1 ss text)
(setq i -1)
(if(setq ss (ssget ":S"(list '(0 . "INSERT")'( 66 . 1) )))
(while(and(setq s1 (ssname ss (setq i (1+ i)))))
(setq text(cdar(MJ:GetAttributes s1))
pt(xj-9pt s1 6)
p1(xj-9pt s1 1)
p2(xj-9pt s1 4)
)
(BF-ent-maketext text pt (distance p1 p2) 0 0.8 0 12)
)
)
(princ)
)
(defun MJ:GetAttributes (ent / blkref lst)
(if (= (vla-Get-ObjectName
(setq blkref (vlax-Ename->vla-Object ent))
)
"AcDbBlockReference"
)
(if (vla-Get-HasAttributes blkref)
(mapcar
'(lambda (x)
(setq
lst (cons
(cons (vla-Get-TagString x) (vla-Get-TextString x))
lst
)
)
)
(vlax-safearray->list
(vlax-variant-value (vla-GetAttributes blkref))
)
)
)
)
(reverse lst)
)
xj6019 发表于 2023-8-16 09:35
无聊玩一下
6666厉害兄弟 (defun c:tt (/ e ee i ms p s xx)
(if (setq s (ssget '((0 . "INSERT"))))
(progn
(setq ms (vla-get-modelSpace (vla-get-ActiveDocument (vlax-get-acad-object))))
(setq i -1)
(while (setq e (ssname s (setq i (1+ i))))
(if (and (setq e (vlax-ename->vla-object e))
(vla-get-HasAttributes e)
(setq p (vla-get-InsertionPoint e))
(setq ee (vlax-safearray->list (vlax-variant-value (vla-GetAttributes e))))
)
(foreach x ee
(if (and (= "A" (vla-Get-TagString x))
(setq xx (vla-Get-TextString x))
(read xx)
)
(vla-Move(vla-AddText ms xx p 300) (vlax-3D-point 0 0 0)(vlax-3D-point 300 0 0))
)
)
)
)
)
)
) 波总的代码记录一下 ssyfeng 发表于 2023-8-14 18:06
看看效果:
大哥可以上个码看看不 xj6019 发表于 2023-8-16 09:35
无聊玩一下
加载试了下,显示缺少函数?Error: no function definition: XJ-9PT
页:
[1]