我在尝试使用AutoCAD MEP 2017导入DGN并保存DWG时遇到了此LISP文件的问题。当我运行脚本时,它显示以下错误:
这发生在CAD中显示任何类型的活动之前,所以我假设这发生在文件中的第一个(command-s)上。知道这是什么原因吗?我使用的代码基于m.Moolhuysen的版本。
编辑:可能值得注意的是,我重新启动了CAD,现在似乎是在第一次延迟之后发生的,我根本没有更改代码。
- (defun C:KURCONV (/ fil tx1 tx2 tx3 tx5)
- (setq tx1 "C:\\Users\\mgreathouse\\Desktop\\DGN to DWG\\dgnlist.txt" ;; list of file names to be imported
- tx2 "C:\\Users\\mgreathouse\\Desktop\\DGN to DWG\\Input DGNs\" ;; input folder.
- tx3 "C:\\Users\\mgreathouse\\Desktop\\DGN to DWG\\Output DWGs\" ;; output folder.
- )
- (setq fil (open tx1 "r"))
- (setq tx5 (read-line fil))
- ; repeats program until all lines from tx1 have been read in
- (while tx5
- (command-s "_-DGNIMPORT" (strcat tx2 tx5) "" "" "")
- (command-s "._DELAY" 1000)
- (command-s "_Z" "e")
- (command-s "_-LAYOUT" "set" "20x29")
- (command-s "_MVIEW" "L" "ALL" "OFF" "")
- (command-s "_.MSPACE")
- (command-s "_Z" "e")
- (command-s "_.PSPACE")
- (command-s "_MVIEW" "L" "ALL" "ON" "")
- (setq tx5 (substr tx5 1 (- (strlen tx5) 4)))
- (command-s "_SAVEAS" "" (strcat tx3 tx5))
- (command-s "._DELAY" 1000)
- (command-s "_-LAYOUT" "set" "model")
- (command-s "_DELETE" "all" "")
- (setq tx5 (read-line fil))
- )
- (close fil)
- )
|