明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1914|回复: 1

请问如何使用AutoLISP在AutoCAD上开启新档案

[复制链接]
发表于 2005-8-3 17:32 | 显示全部楼层 |阅读模式

请问如何使用AutoLISPAutoCAD上开启新档案,本来以为使用(command "new")就可以实现这个功能,可是会出现错误讯息。请问该怎么作才好?

发表于 2005-8-3 23:38 | 显示全部楼层

[I]just an info form net[/I]


Dave,
I got this code from here, some time ago, it works great. You need to preload the
LISP befor use the button.
Here is my toolbar button:


C^C(AE_NEWDWG "C:/HOME/ACAD2000/Mytemplate.d-wt" T);
-------------
for MDI only
and the code:
-------------
 (defun AE_NEWDWG ( template status / ae-acad-object newdwg )
    (vl-load-com)
    (setq ae-acad-object (vlax-get-acad-object))
    (if (not template)
      (setq newdwg (vla-add (vla-get-documents ae-acad-object)))
      (setq newdwg (vla-add (vla-get-documents ae-acad-object) template))
    )
    (if (not status)
      (princ "\nNew drawing created\n")
      (vla-put-activedocument ae-acad-object newdwg)
    )
    (princ)
 )
------------------
Cheers,
Louis

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-4-30 16:32 , Processed in 0.188985 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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