Jump to content

LISP for create new layer on open dwg


Recommended Posts

Hi I've been looking for a LISP that will create a new layer with a given name ("DATA EXTRACTION") every time I open up a dwg (unless that layer already exists) and make that layer current. I have found a couple of similar LISP routines but they don't do just that.

Any help much appreciated.

Link to comment
Share on other sites

  • Replies 23
  • Created
  • Last Reply

Top Posters In This Topic

  • Jamesjh1171


  • paulmcz


  • tzframpton


  • SLW210


Welcome to CADTutor James. :)


A lisp could certainly do this, but you would do well to look at the following lisp from Lee Mac's wonderful website.




Thanks Lee! :beer:


I have this placed in my start up lisp folder, so that it is always running in the background.

Anybody who doesn't follow suit is doing themselves and their company a huge disservice.

They are wasting time, energy and by extension money.


As with most things in life, and especially in technical drawings, there is much to be said for consistency.

Everything getting placed on the appropriate layers automagically, even if the layers don't exist, without the need to create or even monitor the current layer?

What's not to like?

Being accurate?


Take it around the block, you'll be glad you did!

Link to comment
Share on other sites

Put this into your acaddoc.lsp file

(if (tblsearch "layer" "DATA EXTRACTION")
   (command "-layer" "s" "DATA EXTRACTION" "")
   (command "-layer" "m" "DATA EXTRACTION" "")

Link to comment
Share on other sites

Thanks I will try that lisp tomorrow and let you know how it goes.

I have used Lee Mac's lisps including the layer director. It is a great timesaver if you are designing stuff but for me I'm mainly manipulating architect or structural dwgs and extracting data for setting out. I'm very impressed by anyone who can produce a lisp routine because I haven't got a scooby how they work.....:D

Link to comment
Share on other sites

Hi I put the lisp in Support but it hasn't made any difference........


What happens when you copy the code from my previous post, paste it to the command line and hit Enter?

Link to comment
Share on other sites

'findfile' is not recognised as an internal or external command, operable program or batch file


Did you include the parentheses with the findfile function call on command line?

Link to comment
Share on other sites

Copy following line and paste it to command line and press Enter:


(findfile "acaddoc.lsp")


What happens when you do that?

Link to comment
Share on other sites

no i didn't, here is a copy:


Command: findfile Unknown command "FINDFILE". Press F1 for help.

Command: "acaddoc.lsp"

Unknown command "LSP"". Press F1 for help.

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.

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...