Jamesjh1171 Posted June 10, 2016 Posted June 10, 2016 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. Quote
tzframpton Posted June 10, 2016 Posted June 10, 2016 You can create this layer in your Template instead. Quote
ReMark Posted June 10, 2016 Posted June 10, 2016 Could the OP be referring to already existing drawings? Quote
Dadgad Posted June 11, 2016 Posted June 11, 2016 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! 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! Quote
paulmcz Posted June 11, 2016 Posted June 11, 2016 Put this into your acaddoc.lsp file (if (tblsearch "layer" "DATA EXTRACTION") (command "-layer" "s" "DATA EXTRACTION" "") (command "-layer" "m" "DATA EXTRACTION" "") ) Quote
Jamesjh1171 Posted June 11, 2016 Author Posted June 11, 2016 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..... Quote
Jamesjh1171 Posted June 12, 2016 Author Posted June 12, 2016 errrrrrr where is my acaddoc lisp file???? Quote
paulmcz Posted June 12, 2016 Posted June 12, 2016 If you don't have one, take this one (attached) and place it in the support folder of your autocad installation acaddoc.lsp Quote
SLW210 Posted June 13, 2016 Posted June 13, 2016 You can actually place it anywhere as long as you have the location pathed in the support paths. The ACADDOC.LSP File From Lee Mac ACADDOC.lsp Creator Quote
Jamesjh1171 Posted June 13, 2016 Author Posted June 13, 2016 Hi I put the lisp in Support but it hasn't made any difference........ Quote
SLW210 Posted June 13, 2016 Posted June 13, 2016 What is the result of entering (findfile "acaddoc.lsp") on the command line? Quote
Jamesjh1171 Posted June 13, 2016 Author Posted June 13, 2016 'findfile' is not recognised as an internal or external command, operable program or batch file Quote
paulmcz Posted June 13, 2016 Posted June 13, 2016 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? Quote
Jamesjh1171 Posted June 13, 2016 Author Posted June 13, 2016 Yeah if i paste that in and press enter it creates the layer Quote
paulmcz Posted June 13, 2016 Posted June 13, 2016 '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? Quote
paulmcz Posted June 13, 2016 Posted June 13, 2016 Copy following line and paste it to command line and press Enter: (findfile "acaddoc.lsp") What happens when you do that? Quote
Jamesjh1171 Posted June 13, 2016 Author Posted June 13, 2016 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. Quote
Jamesjh1171 Posted June 13, 2016 Author Posted June 13, 2016 Command: (findfile "acaddoc.lsp") nil Quote
Recommended Posts
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.