请教如何制作:线长度随字长变化的动态块
天正里有个图名标注,输入文字,下方线长度会自动跟随文字长度而变化,但转T3就会炸开,想请教下,用CAD动态块可以实现这样的操作么,或者其他方法
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgMAAAD2CAYAAABLG4TUAAAHqklEQVR4nO3aXXLbOBCFUXLKS5r9r2D2pHlySnHZtMQfsBv3nKdUJRXBaBD+JHtdluWxAACx/rl7AQDAvcQAAIQTAwAQTgwAQDgxAADhxAAAhBMDABBODABAODEAAOHEAACEEwMAEE4MAEA4MQAA4cQAAIQTAwAQTgwAQDgxAADhxAAAhBMDABBODABAODEAAOHEAACEEwMAEE4MAEA4MQAA4cQAAIQTAwAQTgwAQDgxAADhxAAAhBMDABBODABAODEAAOHEAACEEwMAEE4MAEA4MQAA4cQAAIQTAwAQTgwAQDgxAADhxAAAhBMDABBODABAODEAAOHEAACEEwMAEE4MAEA4MQAA4cQAAIQTAwAQTgwAQDgxAADhxAAAhBMDABBODABAODEAAOHEAACEEwMAEE4MAEA4MQAA4cQAAIQTAwAQTgwAQDgxAADhxAAAhBMDABBODABAODEAAOHEAACEEwMAEE4MAEC4j7sXMLPH47Gs6zrstb4a9do/vf6rRq7zXSNn+Pl6X939+q+qOsezZjjb3tx91qhFDFzkyMWx5zW+e4h/+/szHfn/R67zHSNm+PV1ZpjjrDOc4YxXOmvUIgaaeuXdzvPfj36H+44u67zCjHOsvMa7VJjhTGeN8/mdgQtUfIjWdR32TveIKuscMcM9r1Flf7ZUWWPF53BZ7tmfWc8a5xEDDVW95M6ScAmZYbaR+zP7WeMcYuBkVz94R/7/Thf0nWutfnl2maMZbuswxw5r5Bxi4EQuoP6q/njgK3P8WYfncBRnjVeJgUbSLrkZLyEz5NmV+5N21jhGDJyk04Pngv5epxnyPTOEfcRAEy65/s6eYZeo67LOmaSeNfYTAyfwjbo/M+zPDGE/MXBQl184+6pL6Y9Yp28i17t6jp1n2OVZZG5iAADCiYEDOr8bWRbvSJZl3Ayveh0z7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vEQAMebACuJAYoRfj0Z4bb7A8Vfdy9ALYlXByPx+PPn2f9WmefY8IMjxi5P7OfNa4hBhp4vkiucMbFcWSNKRfXzHNMmGGnM97hrFHLuizLtacGACjN7wwAQDgxAADhxAAAhBMDABBODABAODEAAOHEAACEEwMAEE4MAEA4MQAA4cQAAIQTAwAQTgwAQDgxAADhxAAAhBMDABBODABAODEAAOHEAACEEwMAEO7j7gVU8d/dCwAI8+/dC+APnwwAQDgxAADhxAAAhBMDABBODABAODEAAOHEAACEEwMAEE4MAEA4MQAA4cQAAIQTAwAQbl2W5XH3IgCA+/hkAADCiQEACCcGACCcGACAcGIAAMKJAQAIJwYAIJwYAIBwYgAAwokBAAgnBgAgnBgAgHBiAADCiQEACCcGACCcGACAcGIAAMKJAQAIJwYAIJwYAIBwYgAAwokBAAgnBgAgnBgAgHBiAADCiQEACCcGACCcGACAcGIAAMKJAQAIJwYAIJwYAIBwYgAAwokBAAgnBgAgnBgAgHBiAADCiQEACCcGACCcGACAcGIAAMKJAQAIJwYAIJwYAIBwYgAAwokBAAgnBgAgnBgAgHD/A9GWLV7SlmRiAAAAAElFTkSuQmCC
可以用反应器,字变化以后,用包围盒获取新的单行文字的长度,然后更新下划线长度。 可以加一个%%U,但是不知道怎么调整下划线线宽。
(defun c:xhx(/ ss n )
;下划线
(setq ss (ssget '((0 . "*text"))))
(while(setq n (ssname ss 0))
(progn
(setq ss (ssdel n ss))
(vlax-put-property (vlax-ename->vla-object n) "TextString"
(strcat "%%U" (Vlax-Get (Vlax-Ename->Vla-Object n) 'TextString )))
)
)
) 本帖最后由 zyz398298804 于 2022-7-13 16:04 编辑
foolishzy 发表于 2022-7-13 09:51
可以加一个%%U,但是不知道怎么调整下划线线宽。
想要个块 跟天正图名标注那样 就是转T3不会打散 ,自己做了个动态块但是下划线需要手动拉伸,比例也要自己移动位置 :(
效果像附件展示的这样子 我也在找,没找到。。应该是这种效果 我用反应器做过一个,不好用,还挺麻烦 之前找过,没找到,现在都是自己加 双下划线,和文字长度自动变化 sandyvs 发表于 2022-7-12 19:09
我也在找,没找到。。应该是这种效果
嗯 就是找下划线事先做好的能随字体长度变化 不用后期生成的 tiancao100 发表于 2022-7-13 10:32
双下划线,和文字长度自动变化
就是这个效果 不知道怎么实现:loveliness:
页:
[1]
2