Jump to content

Recommended Posts

Posted

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.

  • Replies 23
  • Created
  • Last Reply

Top Posters In This Topic

  • Jamesjh1171

    11

  • paulmcz

    7

  • tzframpton

    2

  • SLW210

    2

Posted

Could the OP be referring to already existing drawings?

Posted

Yes it is with existing drawings.

Posted

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.

 

http://www.lee-mac.com/layerdirector.html

 

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!

Posted

Put this into your acaddoc.lsp file

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

Posted

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

Posted

errrrrrr where is my acaddoc lisp file????

Posted

If you don't have one, take this one (attached) and place it in the support folder of your autocad installation

acaddoc.lsp

Posted

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

Posted

What is the result of entering (findfile "acaddoc.lsp") on the command line?

Posted

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

Posted
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?

Posted

Yeah if i paste that in and press enter it creates the layer

Posted
'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?

Posted

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

 

(findfile "acaddoc.lsp")

 

What happens when you do that?

Posted

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.

Posted

Command: (findfile "acaddoc.lsp")

nil

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