Message 1 of 3
Mass Insert - Insert all dwg files from folder - Help with Columns
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello All,
I have scrapped together the following from many sources. Currently I am able to insert all the dwg files from a folder with a specified distance between each insert. In this case 100.
What I am wanting to do is place these files in an array or grid pattern. Preferable with the option to define how many in the x and y directions.
(defun c:MASSINSERT (/ userFolder userList insertPT itm)
(setq userFolder (getfiled "Select folder" "" "dwg" 0)); path with dwg name
(setq userFolder (substr userFolder 1 (1+ (vl-string-position 92 userFolder 1 T)))); path without dwg name
(setq userList (vl-directory-files userFolder "*.dwg" 1))
(setq insertPT (list 0 0 0))
(foreach itm userList
(command "-insert" (strcat userFolder itm) insertPT "" "" "")
(setq insertPT
(list
(+ 100 (car insertPT));define x distance between inserts
(cadr insertPT)
(caddr insertPT)
)
)
)
)
I have tried to do something like define each point individually and then increment points as needed. Something like this:
(setq insertPT
(list
(+ 100 xPT)
(cadr insertPT)
(caddr insertPT)
)
)
The issue I have here is when I introduce multiple points. Also, I would prefer that once the "column" gets to 10, I ant to start a new row.
How can I insert the files in my list to a grid or array pattern specifying the number of columns?
Any help would be appreciated.
Jeremy Oakes
AutoCAD and REVIT
AutoCAD and REVIT