
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi ,
I am looking for some help. I am trying to modify this layout export script from ahsattarian3 (see link https://forums.autodesk.com/t5/autocad-forum/export-multiple-layout-tabs-at-one-time-to-another-dwg/...
(prompt "\n Type : LXA ") (defun c:lxa () (setq layouts (layoutlist)) (setq layouts (acad_strlsort layouts)) (setq ad (getvar "dwgprefix")) (setq layfol (strcat ad "Layouts")) (vl-mkdir layfol) (setq f (strcat layfol "\\lxa.scr")) (setq ff (open f "w")) (write-line "model" ff) (foreach layout layouts (write-line "layout set" ff) (write-line (strcat "\"" layout "\"") ff) (setq adname (strcat (chr 34) layfol "\\" layout (chr 34))) (write-line "exportlayout" ff) (write-line adname ff) ) (write-line "model" ff) (close ff) (command "script" f) )
)
Instead of the script saving the the cad file names as their "layout names", I would like to save them as their drawing number (which is a mtext in the paperspace of each layout and in the same coordinates on each sheet/layout) I think I need to do a ssget and window to get the txt string? and I assume it is AD definition that has been used? the coordinates are top right to bottom left in a window. x 775 y 25.34, x 740 y 17.3
I cant seem to get it to work at all and im sure a long way off but figured you might know how to do it efficiently. This is what I have below.
(defun c:lxa ()
(setq layouts (layoutlist))
(setq layouts (acad_strlsort layouts))
(setq ad (if (ssget "_C"
'(775 25.34 0.0)
'(740 17.3 0.0)
'((0 . "*TEXT"))))
(setq layfol (strcat ad "Layouts"))
(vl-mkdir layfol)
(setq f (strcat layfol "\\lxa.scr"))
(setq ff (open f "w"))
(write-line "model" ff)
(foreach layout layouts
(write-line "layout set" ff)
(write-line layout ff)
(setq adname (strcat (chr 34) layfol "\\" layout (chr 34)))
(write-line "exportlayout" ff)
(write-line adname ff)
)
(write-line "model" ff)
(close ff)
(command "script" f)
)
thankyou!!
Solved! Go to Solution.