Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

layout to dwg mac2013

15 REPLIES 15
Reply
Message 1 of 16
Fiete_Rohde
700 Views, 15 Replies

layout to dwg mac2013

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

15 REPLIES 15
Message 2 of 16
hmsilva
in reply to: Fiete_Rohde

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

EESignature

Message 3 of 16
Fiete_Rohde
in reply to: hmsilva

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

 

Message 4 of 16
hmsilva
in reply to: Fiete_Rohde


@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

EESignature

Message 5 of 16
Fiete_Rohde
in reply to: hmsilva

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

Message 6 of 16
hmsilva
in reply to: Fiete_Rohde


@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

EESignature

Message 7 of 16
hmsilva
in reply to: Fiete_Rohde

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

EESignature

Message 8 of 16
Fiete_Rohde
in reply to: hmsilva

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"

 

 

 

 

 

 

Message 9 of 16
hmsilva
in reply to: Fiete_Rohde

Try the attached one, the command is test

 

Henrique

EESignature

Message 10 of 16
maxim_k
in reply to: Fiete_Rohde

Hi Fiete,

If you want to use Textedit application for creating editing LSP files, you need to convert them to Plain text before saving. Use menu Format -> Make Plain Text to accomplish this.

Maxim

Do you find the posts helpful? "LIKE" these posts!
Have your question been answered successfully? Click 'ACCEPT SOLUTION' button.


Maxim Kanaev
Architect
MARSS

MacACAD | Linkedin

Etiquette and Ground Rules of Autodesk Community
Message 11 of 16
Fiete_Rohde
in reply to: maxim_k

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

 

Message 12 of 16
hmsilva
in reply to: Fiete_Rohde

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

EESignature

Message 13 of 16
Fiete_Rohde
in reply to: hmsilva

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

 

http://forums.autodesk.com/t5/AutoCAD-for-Mac-General/Export-layout-to-model-in-AutoCAD-2013-for-MAC...

 

Is there still an opportunity or is it a dead end.

 

Best, Fiete

Message 14 of 16
hmsilva
in reply to: Fiete_Rohde

I'm not a AC for Mac user, but see this ???

Perhaps only exists in AutoCAD 2014 for Mac...

 

HTH

Henrique

EESignature

Message 15 of 16
maxim_k
in reply to: Fiete_Rohde

Hi Fiete,
EXPORTLAYOUT command doesn't exists in AutoCAD for Mac, as I mentioned in the topic you are referring.
But I have a question: what is your final goal when you want to export Layout to Model space in separate drawing? Are you going to edit it? Or just want to send to somebody? Or...

Maxim

Do you find the posts helpful? "LIKE" these posts!
Have your question been answered successfully? Click 'ACCEPT SOLUTION' button.


Maxim Kanaev
Architect
MARSS

MacACAD | Linkedin

Etiquette and Ground Rules of Autodesk Community
Message 16 of 16
Fiete_Rohde
in reply to: maxim_k

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

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost