Dear all,I use Autocad Mac 2013. Question: How can I export a layout to dwg? Is there a .lisp for Autocad Mac 2013? THANKS
Hello Fiete_Rohde and welcome to the Autodesk Community!
I'm not a "mac" guy, and if your question is to export the layout to model space at the same dwg, this is not the answer you expect, and isn't a lisp...
You can try: Application menu > Save As > Save Layout As A Drawing, or right-click the layout tab, and click Export Layout To Model, or command EXPORTLAYOUT, will create a new dwg with all objects from the layout.
HTH
Henrique
Dear Henrique,
Thank you for your answer and your Welcome!
Unfortunatly this doesn´t solve the problem. Saving the Layout as a drawing only saves the layout and not the modelspace shown on the paperspace.
As i do have a Layout wiht including viewports, which need to be written in a new separate file on the modellspace, the only command i know to execute this, is "layouttodwg".
But this one doesn´t work on autocad2013 for mac so far. Thats why iam asking for a lisp to do that.
I already found a lisp for "layouttodwg", but as far as i can say its made for pc-use because i get error reports in the commandline, when i execute the"layouttodwg"-command.
This is the lisp for "layouttodwg" (only PC ??? ) which i found in a forum. But it doesn´t work so far.
http://www.jtbworld.com/lisp/layoutstodwgs.htm
Does somebody has an Idea? Is there a solution to this problem?
Fiete
@Fiete_Rohde wrote:
Dear Henrique,
Thank you for your answer and your Welcome!
Unfortunatly this doesn´t solve the problem. Saving the Layout as a drawing only saves the layout and not the modelspace shown on the paperspace.
As i do have a Layout wiht including viewports, which need to be written in a new separate file on the modellspace, the only command i know to execute this, is "layouttodwg".
But this one doesn´t work on autocad2013 for mac so far. Thats why iam asking for a lisp to do that.
I already found a lisp for "layouttodwg", but as far as i can say its made for pc-use because i get error reports in the commandline, when i execute the"layouttodwg"-command.
This is the lisp for "layouttodwg" (only PC ??? ) which i found in a forum. But it doesn´t work so far.
http://www.jtbworld.com/lisp/layoutstodwgs.htm
Does somebody has an Idea? Is there a solution to this problem?
Fiete
You're welcome, Fiete.
Doesn't work on MAC, because Mac doesn't support ActiveX API, therefore no Visual Lisp...
I think the program could be rewritten using only AutoLISP, since the code is under Copyright, try to contact Jimmy Bergmark at JTB World.
Henrique
Thank you Henrique for your answer!
I will try to get in contact with Jimmy Bergmark at JTB World.
And if i do get a solution to that Problem i will post it here.
Fiete
@Fiete_Rohde wrote:
Thank you Henrique for your answer!
I will try to get in contact with Jimmy Bergmark at JTB World.
And if i do get a solution to that Problem i will post it here.
Fiete
You're welcome, Fiete.
It's not to hard to modify the code, but it's from Jimmy Bergmark, not mine.
I don't have AutoCAD in this laptop, this evening I'll try something...
Henrique
Fiete,
this is not a finalized program, nor intended to be, it's only a "demo/test", as I'm not a AutoCAd for Mac guy, I asked maxim_k to do some brief tests and he needed to put an additional (command "_.undo" "_M") statement before the foreach loop to get the expeted result from the code.
Many thanks Maxim!
As this is only a "demo/test" code, and for caution, try the code with a copy from your dwg!
;; A quick one, minimally tested, no error handling, no... (defun c:test (/ FNAME LAYTLST NAME PATH) (setvar 'CMDECHO 0) (setq laytlst (layoutlist) path (getvar 'DWGPREFIX) name (getvar 'DWGNAME) name (substr name 1 (- (strlen name) 4)) ) (command "_.undo" "_M");added by maxim_k to allow to run from the first execution (foreach layt laytlst (command "_.undo" "_M") (foreach layt1 laytlst (if (/= layt1 layt) (command "_.-layout" "_Delete" layt1) );; if );;foreach (setvar 'TILEMODE 1) (command "_.ucs" "_w") (setvar 'TILEMODE 0) (setq fname (strcat path name "-" layt ".dwg")) (if (findfile fname) (command "_.-wblock" fname "_Y" "*") (command "_.-wblock" fname "*") );; if (command "_.undo" "_B") );; foreach (setvar 'CMDECHO 1) (princ) )
HTH
Henrique
Dear Henrique,
Dear maxim_k,
Thank you very much for your joint efforts.
Unfortunatly I think i did something wrong, because i get an syntax error.
laytlist.lsp successfully loaded.
Command: ; error: syntax error
1. I took your text (without ";; A quick one, minimally tested, no error handling, no...")
2. Put it into a textedit file (.rtf) save it under under the name laytlist
3. Renamed the .rtf to a .lsp
4 "apploaded" it
Did I maybe do something wrong by copying the text?
It would be realy great if you could have a look to it.
Fiete
Jimmy Bergmark from JTB World answered me to the question too:
"Hi Fiete,
Unfortunately AutoCAD for MAC is limited when it comes to AutoLISP so these specific functionalities are not supported.
Jimmy Bergmark"
Dear Henrique,
dear Maxim,
Thank you so much for helping!
The .lsp works!!!! This .lsp writes separate files for each layout, sothat in the new created file, there is only one layout and in the modelspace and there is still the whole drawing. Thats great so far.
But it doesn´t do,as far as I know, what the actual command layouttodwg normaly does.
Because i was searching for a command that brings everthing that is seen in the layout-window (including what is senn in the viewports) to the modelspace of a new drawing.
I don´t know if you could have another look into this, but it would be really great.
Best, Fiete
You're welcome, Fiete.
"But it doesn´t do,as far as I know, what the actual command layouttodwg normaly does."
It's "layouttodwg" an AutoCAD core command?
At message #2 I did mentioned the command EXPORTLAYOUT, a core command that exports all the layout content, including the model objects that are seen through the viewports, to a new dwg at the model space...
HTH
Henrique
Henrique,
it seems i made a mistake.
I could´t find the layouttodwg command in the core commands of Autocad,
and the command i was looking for was probably the "exportlayout" command.
I was searching for a command that put everything seen in a layout to a new file in modellspace.
I´ve seen Karim already answered this question in a different threat
Is there still an opportunity or is it a dead end.
Best, Fiete
Dear Maxim,
Dear Henrique,
Thank you for your answers!
The Export Layout to Model Space unfortunatly doesn´t exist in autocad 2013.
My goal is to export the Layout to Modelspace to send it to the client and several different planners. They get a pdf with it too.
But they do need the layout including what is seen in the viewport saved to a .dwg file where everything is shown in modelspace.
Further more it is necessary that everything what has been in the model-space before is gone!
By using the .lsp (layouttodwg)which you and Henrique made, the whole modell is still in the drawing.
As i do have dozens of files and dozens of layouts in each one of them, it takes me days to clean every modellspace, copy the layout to modelspace and clean and purge everything in the new made file.
Do you see a way to work around that? I think the export layout which isn´t available in autocad2013 for mac would do exactly what is need in my case.
Have a nice weekend
Thank you
Best Fiete