跪求一个命令做好建立指定块名的块、重新建立定块名的块,重复插入块的功能
请大师帮帮忙,帮我在以下程序中增加个重新建立块的可选项,我的用途是建立指定块名的块并可以重复插入此块,我想将这个程序有这样的功能,当文件中有了C1块是,当文件中没有c1块时,此命令建立C1块,当有文件中有C1块时,提示((C)重新建C2块)的可选项,用C唤醒此功能,若不用重建就点取插入点,
请大师帮帮忙,学生在这里谢谢了!
(defun c:c1 (/ pt ss)
(if (tblsearch "block" "C1")
(progn
(setq pt (getpoint "\nInsert point: "))
(command "_insert" "C1" "non" pt "" "" "")
)
(progn
(princ "\n请选择创建块C1的图元: ")
(setq ss (ssget)
pt (getpoint "\nBase point: ")
)
(command "_block" "C1" "non" pt ss "")
(command "_insert" "C1" "non" pt "" "" "")
)
)
(princ)
)
(defun c1 (msg blk)
(princ msg)
(setq ss (ssget)
pt (getpoint "\nBase point: ")
)
(command "_block" blk "non" pt ss "")
(command "_insert" blk "non" pt "" "" "")
)
(defun c:c1 (/ pt ss)
(if (tblsearch "block" "C1")
(progn
(initget 1 "C")
;; 提示((C)重新建C2块)的可选项
(setq pt (getpoint "\nInsert point or (C)重新建C2块: "))
(cond
((= pt "C") (c1 "重新建C2块: " "C2"))
(T
(command "_insert" "C1" "non" pt "" "" "")
))
)
(c1 "\n请选择创建块C1的图元: " "C1")
)
(princ)
) 谢谢楼主
这个程序有这样的功能,当文件中有了C1块是,当文件中没有c1块时,此命令建立C1块,
当有文件中有C1块时,提示((C)重新建C1块)的可选项,用C唤醒此功能,若不用重建就点取插入点,
这样呢,该如何编写。 谢谢Andyhon楼主 还需麻烦大师。
(defun c1 (msg blk)
(princ msg)
(setq ss (ssget)
pt (getpoint "\nBase point: ")
)
(command "_block" blk "non" pt ss "")
(command "_insert" blk "non" pt "" "" "")
)
(defun c:c1 (/ pt ss)
(if (tblsearch "block" "C1")
(progn
(initget 1 "C")
;; 提示((C)重新建C1块)的可选项
(setq pt (getpoint "\nInsert point or (C)重新建C1块: "))
(cond
((= pt "C") (c1 "重新建C1块: " "C1"))
(T
(command "_insert" "C1" "non" pt "" "" "")
))
)
(c1 "\n请选择创建块C1的图元: " "C1")
)
(princ)
)
这样可以Insert point or (C)重新建C1块:
命令: *取消*
命令:
命令: _.erase 找到 1 个
命令: c1
Insert point or (C)重新建C1块: c 重新建C1块:
选择对象: 找到 1 个
选择对象:
Base point:
请回答“是”或“否”。
函数被取消是否重定义?[是(Y)/否(N)] <N>: y 指定插入基点:
选择对象: 找到 1 个
选择对象:
块“c1”已重定义 我已经写好了,就是不知道怎么制作块镜像的可选项。 有老师帮忙写一下下吗。。 1# 当有文件中有C1块时,提示((C)重新建C2块)的可选项,用C唤醒此功能
3# 当有文件中有C1块时,提示((C)重新建C1块)的可选项,用C唤醒此功能
8# 我已经写好了....
晕眩中 ...