本帖最后由 e2002 于 2019-10-13 23:47 编辑
这么个小玩意,不需要付费的。
实际上面都把最核心功能的那几句都贴出来了。
完整程序如下(需要用到 Doslib , 在 wiki.mcneel.com下载最新版):
- ;;================================================================================
- ;; 批量输出Layouts到Model
- ;; Revision :
- ;; R0.0.1 2013/01/25 初始版本
- ;; R0.0.2 2013/01/28 改进程序流程,修正 sDwgName 去除最后的".dwg" 字符
- ;; R0.0.2.1 2013/02/06 增加 (vl-arx-import 'layoutlist) 用于编译
- (defun C:lkpt_Layouts_Export2Model ( / sDwgFolder sDwgName iLen sTab lsLayouts
- sFolder oldvar1 oldvar2 sItem sDwgOut
- )
- (setq sDwgFolder (getvar "DWGPREFIX")
- sDwgName (getvar "DWGNAME")
- iLen (- (strlen sDwgName) 4)
- sDwgName (substr sDwgName 1 iLen)
- sTab (getvar "CTAB")
- )
- (vl-arx-import 'layoutlist)
- (if (and (setq lsLayouts (dos_multilist "Layout输出到Model" "选择需要输出到Model的Layout" (layoutlist)))
- (setq sFolder (dos_getdir "输出目的文件夹" sDwgFolder "选择输出目的文件夹" T))
- )
- (progn
- (setq oldvar1 (getvar "FILEDIA")
- oldvar2 (getvar "CMDECHO")
- )
- (setvar "FILEDIA" 0)
- (setvar "CMDECHO" 0)
- (foreach sItem lsLayouts
- (setvar "CTAB" sItem)
- (setq sDwgOut (strcat sFolder sDwgName "_" sItem))
- (vl-cmdf "_.exportlayout" sDwgOut)
- )
- (setvar "CTAB" sTab)
- (setvar "FILEDIA" oldvar1)
- (setvar "CMDECHO" oldvar2)
- )
- );fi
- (princ)
- );end defun C:lkpt_Layouts_Export2Model
|