414249149 发表于 2024-5-7 20:47:53

型材线密度如果刷属性文字

第一次发帖

在论坛找了一个计算线密度的lisp,得到的线密度数据刷不了属性文字,
1、希望大神改造一下 可以刷属性块内的属性文字
2、推出程序会出现错误提示,希望大神也升级一下
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANEAAACsCAYAAADlhknwAAAQ0klEQVR4Ae2cv4/cxhXHmR+OBdiJpCiOEri1YciOZSTnIN5DgHSJAceGnXTbuAlYpEuXJtn8AQFWndrrgiCFigAEAgQQrhegQoWKra52IXcpVEzwZvhm3swOeSSHyx1yvwccOOT8evOd95k3JHe3ePudd1UO/z87+1C99/4HWdiSgx6wIQ+/bJqHsw9/rt79yX3tr8VHH60U/qAAFBimAPFT3Hvv/WG1UQsKQAFF/BRvvXMPUkABKDBQAeIHEA0UD9WgACkAiOAHUCBRAUCUKCCqQwFABB+AAokKAKJEAVEdCgCisXygKtX5g91YraGdGSkAiHiyqlIVRakqOveA2KkH5/V1pdTuwbkqdSFTrigK1fZvy3I/OB5dAZqvJ0+eNNpBeVSm698AiMipClVM4h2VKqWT7vXZZEt9XdZlQFqVof7OFQUUB4uAaPdAnZ8/UDbeEHh7NrkOqrJwwLnLSB1ZAYLklVdvREFqy2syuz9E2pHO1Xknp+RujVO3+BsXdEcdGQIn9CKEDgvq/DxmS6S/WHuut0iK4QmPomjdJiKR0GQmyRgssWtdhtMbIlqhae/fb5WNOHWrdSYCXQddsy0N/dEC0AA/jSd+T8MQRQxGJIqIMp9LEhqZ7juCnhCRQ5ntDt03FHJrEzqoPQ+2ZLZOcF06d9h2dFQttqgGiBqvmw4ISr0907Y33+tYuBGJojMzp4sMT9P2rstY+kHkObe7f9AdWWjqbr3z0KkNQN7Krx3S3dh7gMZG0mZLIyyhHbGGeZso7n1EMXevVD9YsESJQnWyX7Ter48rh1dgcojCLY937kFTO6KNLoHzegCwUKJMNJ/LmaPXt/ZnuR0TbXnV6HodSb3r5oS3hwqRKKLO8i4xQHSU6b4j7RGJwu0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HoomHLZiNR8HABkehEHTfF6ceuyxAdJxJRdJL3RBSV+BG1iDj1PRGX1Q8f6qd2OUGESHSiQDNEx49EV+rKizIGonX9Hone/dDWzUYkfS/lnt55Dxm6vKg90P0T6zn2Yod7oowB5Uk/XiSK3SvN8xoiUcaOPvaqJttjiI4XieYJTNOiw3pKjcdIIxJlDChPepNT4Hp3yBGJMnb0MVaypjYYIkSi7rC0LSysZ5PeQ68jEmUMKE96m2MgrxtgiEQZO/rQ1atLPYaIIxGOaT/Wwnp20b5PGUSijAHlScdx3N+e6wNIl7KACBDZ3x44FVi7gNGnDCDKGKI+E4my/X/+dyzNABEgwg/aJ/oAIEoUcKzVDO0cL5Kkag+IABEiUaIPAKJEAVNXMdSfbwTiuQNEgAiRKNEHAFGigLwa4Tj/iDJ0DgERIEIkSvQBQJQo4NDVC/WWE7kAESBCJEr0AUCUKCAiynIiytC5BESACJEo0QcAUaKAQ1cv1FtOBLMQUQL/0AA+MMwH/g9yUz6tFCeWgwAAAABJRU5ErkJggg==

(defun c:mz ()
(prompt "\n*请选择对象*: ")
(setq ENT (car (entsel)))
(setq ent (vlax-ename->vla-object ent))
(setq area (vlax-get ent 'area))
(setq wei (* area 0.0027))
(setq wei1 (rtos wei 2 3))
(setq P4 (* 2.5 (getvar "dimscale")))
(princ "\n--->模图重量=")
(princ wei1)
(princ "kg/m " )
(princ "\n选择线密度值替换:")
(setq ss (entget (car (entsel))))
(setq ss (subst (cons 1 (strcat wei1 "kg/m")) (assoc 1 ss) ss))
(entmod ss)
(princ)
)


ssyfeng 发表于 2024-5-7 20:47:54

试试这个,直接选择属性文字


bai2000 发表于 2024-5-8 11:47:25

多个图形应该做成面域,计算面域面积

414249149 发表于 2024-5-8 11:47:55

ssyfeng 发表于 2024-5-8 09:58
试试这个,直接选择属性文字

很好用,论坛还是好人多;

昨天忘提1条需求了,默认刷文字,在刷文字的时候可否增加一个写文字的选项,不选写文字就默认刷米重文字

ssyfeng 发表于 2024-5-8 14:34:28

414249149 发表于 2024-5-8 11:47
很好用,论坛还是好人多;

昨天忘提1条需求了,默认刷文字,在刷文字的时候可否增加一个 ...

不明白你的意思.

414249149 发表于 2024-5-8 17:12:26

ssyfeng 发表于 2024-5-8 14:34
不明白你的意思.

        (princ "\n选择线密度值替换:")   就是在这步操作的时候增加一个写线密度值选型,但是默认是选择线密度值替换
页: [1]
查看完整版本: 型材线密度如果刷属性文字