修改块名求助
怎么加上那个对话框啊(defun c:xgkm (/ blkselect )(setq blkselect (entget(car(entsel "\n选择块: ")))
blkname (cdr(assoc 2 blkselect)) )
(princ (strcat "->>> " (cdr (assoc 2 blkselect)) " <<<-" ))
(setq blknew (getstring t "\n输入新块名: "))
(command "_.rename" "_block" blkname blknew)
(princ)
)
xgkm:dialog{label="修改块名";
:boxed_column{label="选项";
:edit_box{label ="块名: ";key ="e1";allow_accept = true;}
spacer_1;
}
spacer_1;
ok_cancel;
}不知道怎么驱动对话框O(∩_∩)O谢谢
到http://bbs.mjtd.com/thread-96336-1-1.html八楼去研究一下 程序未经调试。
(defun c:xgkm (/ blkselect )
(if (and (setq blkselect (entget(car(entsel "\n选择块: ")))
(setq blkname (cdr(assoc 2 blkselect)) )) (progn
(if (> (setq dcl_id (load_dialog "xgkm")) 0) (progn
(if (new_dialog "xgkm" dcl_id) (progn
(action_tile "e1" "(readata) (done_dialog 1)")
(action_tile "accept" "(readata) (done_dialog 1)")
(action_tile "cancel" "(done_dialog 0)")
(setq re (start_dialog))
)
(princ "\n无法显示对话框!")
)
(unload_dialog dcl_id)
)
(princ "\n无法加载对话框!")
)
(if (and (= re 1) (/= blkname blknew))
(command "_.rename" "_block" blkname blknew)
)
))
(princ)
)
缺个函数
(defun readata ()
(setq blknew (read_tile "el))
) 谢谢啊去试试 命令: ; 错误: 输入的字符串有缺陷
页:
[1]