本帖最后由 树櫴希德 于 2022-10-20 16:21 编辑
- ;|
- 将程序以ggcys.lsp存盘,在CASS中有appload命令加载此程序,
- 再一命令行中键入ggcys回车即可使用。输入颜色
- 变颜色的GC200块中高程文本即达到要求。
- |;
- ;
- (defun c:ggcys( / gcz zz 10zu)
- (vl-load-com)
- (setq cmd (getvar "cmdecho"))
- (setvar "cmdecho" 0)
- (command "_undo" "be")
- (if (setq col (getint "\n请输入颜色号[0~255]<0>:"))
- (if (<= 0 col 255)
- (if (setq ssa (ssget '((0 . "INSERT") (2 . "GC200") (-3 ("SOUTH" )))))
- (progn
- (setq n (sslength ssa) i 0)
- (repeat n
- (setq ent (entnext (ssname ssa i))
- 号,选择要改 vob (vlax-ename->vla-object ent)
- )
- (setq 10zu (assoc 10(entget(ssname ssa i) )))
- (setq gcz (last 10zu ))
- (setq zz (read(cdr(assoc 1(entget ent)))) )
- (if (equal gcz zz 0.0100) "YES! ! " (progn (vla-put-color vob col)
- (vla-update vob)
- (entmake (list '(0 . "CIRCLE") ; 图元形态
- '(8 . "ccgcd")
- '(62 . 1) ; 颜色
- 10zu ; 圆心
- '(40 . 10) ; 半径
- )
- )
- ) ;;;;
- )
-
-
- (setq i (1+ i))
- )
- )
- )
- )
- )
- (command "_undo" "e")
- (setvar "cmdecho" cmd)
- (princ)
- )
|