如何从AutoCad Core Console 2016运行AutoLisp例程(ATTOUT)

时间:2015-08-11 09:27:54

标签: autocad autolisp

我想在.dwg文件的所有块上运行ATTOUT例程,使用Core Console自动化应用程序..

我使用默认" attout.lsp"在我的AutoCAD 2016安装的Express文件夹中,因为我想在所有块上使用它而不需要选择特定的块。

我试过了:

accoreconsole.exe /i C:/<pathing_to_my_dwg_file>/sample1.dwg /s test-attout.scr

test-attout.scr是:

(load "attout.lsp" "/omg it"s not working)

结果如下:

`Redirect stdout (file: C:\Users\lboey\AppData\Local\Temp\accc64962).
AutoCAD Core Engine Console - Copyright Autodesk, Inc 2009-2013.
Regenerating layout.

Regenerating model.
..
**** System Variable Changed ****
1 of the monitored system variables has changed from the preferred value. Use SY
1 of the monitored system variables has changed from the preferred value. Use SY
SVARMONITOR command to view changes.


Command:
Command:

Command:
Command: (load "attout" "omg it's not loading")_quit


Command:`

我是AutoCAD中的noobie,非常感谢任何建议。

感谢所有!!

3 个答案:

答案 0 :(得分:2)

此命令(ATTOUT)将显示一个对话框,这就是它无法在Console上运行的原因。此外,任何使用COM的LISP都不会工作(vl-load-com)

答案 1 :(得分:0)

我会回答我自己的问题:

  1. 创建my_script.scr文件
  2. (load "C:\\Program Files\\...\\my_routine.lsp")> 
    att-out
    
    1. 创建一个AutoLisp例程文件my_routine.lsp
    2.   

      (defun c:att-out()(load&#34; attout&#34;)(setq out(strcat(getvar&gt;   &#34; dwgprefix&#34;)(acet-filename-path-remove(acet-filename-ext-remove&gt;   (getvar&#34; dwgname&#34;)))。txt&#34; ))(setq ss(ssget&#34; X&#34;&#39;((0。&#34; INSERT&#34;)   (66.1))))(bns_attout out ss))

      1. 使用acad.exe调用脚本
      2.   

        acad.exe C:\ Program Files ... \ a_simple_dwg.dwg / b my_script.scr

        Autocad Core Console现在处于早期开发阶段,因此自动化一系列操作的最简单方法是使用AutoLisp。

答案 2 :(得分:-1)

my_routine.lsp 适用于Autocad 2011并进行小幅调整

(defun c:att-out () (load "attout") (setq out (strcat (getvar "dwgprefix") (acet-filename-path-remove (acet-filename-ext-remove (getvar "dwgname"))) ".txt" )) (setq ss (ssget "X" '((0 . "INSERT") (66 . 1)))) (bns_attout out ss))

Thanx @ user3336544

相关问题