garbing DWG file name and save the new files as same layout name

garbing DWG file name and save the new files as same layout name

mohamad-alimam
Explorer Explorer
966 Views
3 Replies
Message 1 of 4

garbing DWG file name and save the new files as same layout name

mohamad-alimam
Explorer
Explorer

hello

I am trying to export from one AutoCAD file layout sheet to separate dwg file the problem is, I am trying to make a try to save the new file without marge dwg file with layout name I want the only layout file name the forums:

 

(defun c:exportmodelspace ( / BASE LST OLD_DIA)
(setq old_dia (getvar 'FILEDIA)
base (strcat (getvar 'DWGPREFIX) (vl-filename-base (getvar 'DWGNAME)))
)
(setvar 'FILEDIA 0)
(setq lst (layoutlist))
(foreach l lst
(command "_.ctab"
l
"exportlayout"
(strcat base "-" l)
)
)
(setvar 'FILEDIA old_dia)
(princ)
)

Accepted solutions (1)
967 Views
3 Replies
Replies (3)
Message 2 of 4

devitg
Advisor
Advisor

it work ok for me 

0 Likes
Message 3 of 4

mohamad-alimam
Explorer
Explorer

 Thank you for your trying

it works like the old same what I need is only export layout to dwg and have only layout name without dwg name 

0 Likes
Message 4 of 4

pbejse
Mentor
Mentor
Accepted solution
(defun c:exportmodelspace (/ base lst old_dia)
  (setq old_dia (getvar 'filedia))
  (setvar 'filedia 0)
  (setq lst (layoutlist))
  (foreach l lst    
    (command "_.ctab" l "exportlayout" (strcat (getvar 'dwgprefix) l))
  )
  (setvar 'filedia old_dia)
  (princ)
)