Jump to content

save each layer in a separate file


Guest x.bonnet

Recommended Posts

This example complies save settings

(setenv "DefaultFormatForSave" "48") ; AutoCAD 2010
 (while (setq layer (tblnext "layer" (not layer)))
   (setq lname (cdr (assoc 2 layer)))
   (if
     (setq ss (ssget "X" (list (cons 8 lname) (cons 410 "Model"))))
     (command "WBLOCK"
              (strcat (getvar 'dwgprefix) lname ".dwg")
              ""
              '(0.0 0.0 0.0)
              ss
              ""
              "OOPS"
     )
   )
 )

Link to comment
Share on other sites

Stefan BMR, read phrases:

"changing this setting before running the script does not save as set earlier version! "

Did you check your code at AutoCAD 2013 / 2014?

Link to comment
Share on other sites

Stefan BMR, read phrases:

"changing this setting before running the script does not save as set earlier version! "

Did you check your code at AutoCAD 2013 / 2014?

Yes, I did... Did you?

 

dwg.jpg

I use AutoCAD 2014

Link to comment
Share on other sites

  • 1 year later...

Hi!

 

I am very new to scripting/lisp and have a job where customer wants singel dwg from multilayer dwg. It is an electrical schematic dwg consisting of n number of layers

Layer 0 is the plotframe

Layer 1 to n is the electric drawing

 

I am searching for a script to automate this.

Say the file name is 415.dwg

I want the resulting dwg saved to original folder:

Layer 0 + Layer 1 to be saved as filename 415-001.dwg

Layer 0 + Layer 2 to be saved as filename 415-002.dwg

Layer 0 + Layer n to be saved as filename 415-n.dwg

 

It would be really great to get some help...

 

Thanks!

Edited by biben
spelling
Link to comment
Share on other sites

  • 1 year later...
  • 6 years later...

I know this is a thing, but I do wonder if a single post, referencing a link to a thread that is 11 years old is an AI bot trying to work out how people respond to questions that have been solved in the thread

 

(obviously waiting the new member to reply "No I am not")

Edited by Steven P
  • Funny 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...