找回密码
 [加入论坛]
查看: 1641|回复: 2

[转帖]毋须EXplode,编辑属性块中属性的小工具

[复制链接]
2443725 发表于 2004-12-15 19:18 | 显示全部楼层 |阅读模式
<FONT face=宋体>毋须EXplode,编辑属性块中属性的小工具. 此代码只是实现基本功能, 请大家试用!
(defun c:test ()
(vl-load-com)
(setq att (getstring "\nChange attribute [Angle/Color/Height/Layer/Position/Style/Value/Tagstring]: "))
(setq obj (car (nentsel "\nSelect an Attribute: ")))
(setq obj (vlax-ename-&gt;vla-object obj))
(cond
((= (strcase att) "A")
(setq ang (getstring t "\nNew Angle: "))
(vlax-put-property obj 'rotation ang))
((= (strcase att) "C")
(setq col (getstring "\nNew Color Number: "))
(vlax-put-property obj 'color col))
((= (strcase att) "H")
(setq ohei (vlax-get-property obj 'height))
(setq hei (getdist (strcat "\nNew Height &lt;" (rtos oh 2 2) "&gt;:")))
(if (= hei "")(setq hei ohei))
(vlax-put-property obj 'height hei))
((= (strcase att) "L")
(setq lay (getstring "\nNew Layer:"))
(if (not (tblsearch "LAYER" lay))
(alert (strcat "\nLayer " (strcase lay) " doesn't exist!"))
(vlax-put-property obj 'layer lay)
))
((= (strcase att) "")
(setq pos (getpoint "\nNew Position:"))
(vlax-put-property obj 'textalignmentpoint (vlax-3d-point pos)))
((= (strcase att) "S")
(setq sty (getstring "\nNew Style: "))
(if (not (tblsearch "STYLE" sty))
(alert (strcat "\nThe style " (strcase sty) " doesn't exist!"))
(vlax-put-property obj 'stylename sty)
))
((= (strcase att) "V")
(setq val (getstring t "\nNew value: "))
(vlax-put-property obj 'textstring val))
);c
(princ)
);defun</FONT>
tianshan 发表于 2004-12-16 17:09 | 显示全部楼层
不错
回复 顶 踩

使用道具 举报

hxg372 发表于 2004-12-16 19:22 | 显示全部楼层
<>不是友专门得命令吗,ATTEDIT就是专门编辑块属性得,无需EXPLOD.大家可以试一下。</P>
回复 顶 踩

使用道具 举报

您需要登录后才可以回帖 登录 | [加入论坛]

本版积分规则

手机版|化工技术网- 赠人玫瑰 手有余香 ( 苏ICP备14035884号 )

GMT+8, 2026-12-1 17:47

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表