【问题标题】:How to run an AutoLisp routine (ATTOUT) from AutoCad Core Console 2016如何从 AutoCad Core Console 2016 运行 AutoLisp 例程 (ATTOUT)
【发布时间】:2015-08-11 09:27:54
【问题描述】:

我想在 .dwg 文件的所有块上运行 ATTOUT 例程,使用核心控制台自动化应用程序。

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

我试过了:

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 的菜鸟,非常感谢任何建议..

谢谢大家!!

【问题讨论】:

    标签: autocad autolisp


    【解决方案1】:

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

    【讨论】:

    • ATTOUT 命令不起作用,它不是为 AutoCAD 控制台设计的...您可能需要模仿此功能,无需 UI 要求 (acet-ui-)
    【解决方案2】:

    我会回答我自己的问题:

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

    (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) )

    1. 使用 acad.exe 调用脚本

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

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

    【讨论】:

      【解决方案3】:

      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))
      

      感谢@user3336544

      【讨论】:

        猜你喜欢
        • 2016-06-25
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2017-04-18
        • 1970-01-01
        • 2015-10-11
        • 2010-12-15
        • 2018-06-10
        相关资源
        最近更新 更多