求lisp程序
把画好的4张图a1.dwg、a2.dwg、b1.dwgb2.dwg,放进cad安装程序的support文件夹。然后新建一个cad图,比如说在图中输入命令a,空格后出现1、...
把画好的4张图 a1.dwg 、a2.dwg、b1.dwg b2.dwg,放进cad安装程序的support文件夹。
然后新建一个cad图,比如说在图中
输入命令a,空格后出现1、2两个选项,然后我输入1,选择插入点,则图“a1.dwg”插入此图中;
输入命令b,空格后出现1/2两个选项,然后我输入1,选择插入点,则图“b1.dwg”插入此图中...
请问这个lisp程序怎么编写啊?谢谢:)
要自己选择插入点。 展开
然后新建一个cad图,比如说在图中
输入命令a,空格后出现1、2两个选项,然后我输入1,选择插入点,则图“a1.dwg”插入此图中;
输入命令b,空格后出现1/2两个选项,然后我输入1,选择插入点,则图“b1.dwg”插入此图中...
请问这个lisp程序怎么编写啊?谢谢:)
要自己选择插入点。 展开
1个回答
展开全部
(defun c:a()
(vl-load-com)
(setq old (getvar "cmdecho")
path (strcat (Vlax-Get (Vlax-Get-Acad-Object) 'Path) "\\Support")
files (vl-directory-files path "*.dwg" 1)
)
(setvar "cmdecho" 0)
(command "_undo" "be")
(initget "1 2")
(setq wjh (getkword "\n1/2<1>:"))
(if (= wjh nil) (setq wjh "1"))
(setq wjm (strcat path "\\a" wjh ".dwg"))
(if (member (strcat "a" wjh ".dwg") files)
(if (setq pt (getpoint "\n插入点:"))
(progn
(command "_insert" wjm pt 1 1 1)
(command "_zoom" "e")
)
)
(alert (strcat wjm ", 不存在!"))
)
(command "_undo" "e")
(setvar "cmdecho" old)
(princ)
)
(defun c:b()
(vl-load-com)
(setq old (getvar "cmdecho")
path (strcat (Vlax-Get (Vlax-Get-Acad-Object) 'Path) "\\Support")
files (vl-directory-files path "*.dwg" 1)
)
(setvar "cmdecho" 0)
(command "_undo" "be")
(initget "1 2")
(setq wjh (getkword "\n1/2/<1>:"))
(if (= wjh nil) (setq wjh "1"))
(setq wjm (strcat path "\\b" wjh ".dwg"))
(if (member (strcat "b" wjh ".dwg") files)
(if (setq pt (getpoint "\n插入点:"))
(progn
(command "_insert" wjm pt 1 1 1)
(command "_zoom" "e")
)
)
(alert (strcat wjm ", 不存在!"))
)
(command "_undo" "e")
(setvar "cmdecho" old)
(princ)
)
(vl-load-com)
(setq old (getvar "cmdecho")
path (strcat (Vlax-Get (Vlax-Get-Acad-Object) 'Path) "\\Support")
files (vl-directory-files path "*.dwg" 1)
)
(setvar "cmdecho" 0)
(command "_undo" "be")
(initget "1 2")
(setq wjh (getkword "\n1/2<1>:"))
(if (= wjh nil) (setq wjh "1"))
(setq wjm (strcat path "\\a" wjh ".dwg"))
(if (member (strcat "a" wjh ".dwg") files)
(if (setq pt (getpoint "\n插入点:"))
(progn
(command "_insert" wjm pt 1 1 1)
(command "_zoom" "e")
)
)
(alert (strcat wjm ", 不存在!"))
)
(command "_undo" "e")
(setvar "cmdecho" old)
(princ)
)
(defun c:b()
(vl-load-com)
(setq old (getvar "cmdecho")
path (strcat (Vlax-Get (Vlax-Get-Acad-Object) 'Path) "\\Support")
files (vl-directory-files path "*.dwg" 1)
)
(setvar "cmdecho" 0)
(command "_undo" "be")
(initget "1 2")
(setq wjh (getkword "\n1/2/<1>:"))
(if (= wjh nil) (setq wjh "1"))
(setq wjm (strcat path "\\b" wjh ".dwg"))
(if (member (strcat "b" wjh ".dwg") files)
(if (setq pt (getpoint "\n插入点:"))
(progn
(command "_insert" wjm pt 1 1 1)
(command "_zoom" "e")
)
)
(alert (strcat wjm ", 不存在!"))
)
(command "_undo" "e")
(setvar "cmdecho" old)
(princ)
)
追问
高手啊,还是存在角度的问题啊。。插入后,图形和水平方向总是呈1°的角度。。。。怎么设置才能插入后和原图一样?
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
AiPPT
2024-09-19 广告
2024-09-19 广告
随着AI技术的飞速发展,如今市面上涌现了许多实用易操作的AI生成工具1、简介:AiPPT: 这款AI工具智能理解用户输入的主题,提供“AI智能生成”和“导入本地大纲”的选项,生成的PPT内容丰富多样,可自由编辑和添加元素,图表类型包括柱状图...
点击进入详情页
本回答由AiPPT提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询