
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I have 20 dwg files, each one containing one page of a projet (all the pages are the same size). I would like to combine them all into a single dwg file. Right now, in AutoCAD 2012, I manually insert the dwg and manually (with the mouse) position them in a row. Then I save and everything is fine.
Now, I have 500 dwg files to combine this way. I want to create a LISP script to automate the process. Right now I have the following, but it doesn't work. This is my first lisp script and I am more a C++ guy 😉
(defun C:MyInsert ()
(vl-load-com)
(setq x 0)
(foreach path (vl-directory-files "C:/Users/My folder/" "*.dwg")
(command "-insert" path "x,0,0" "" "" "")
(setq x (+ x 100))
)
My goal is to insert every dwg files in the folder, but to with an offset of 100 in x with regard to the last one inserted.
To test my function, in the LISP console:
But is returns "nil" twice.
So, if anyone could help me understand this...
Regards,
Solved! Go to Solution.