Create sequencial layers automatically

Hi,
I need to create about 500 layers and I'd rather not do it manually.
They need to have a specific name with a unique sequencial number in
the name. Also, the colors need to alternate between about 4 colors.
Is there such a free lisp tool or one that I can buy? TIA.
Reply to
Anonymous
Loading thread data ...
try
formatting link
rod
Reply to
rod cohen
Or just write one yourself. It might look something like this:
(setq count 1) (while (< count 11)(setq pad (+ count 1000)) (setq newlayer (strcat "mylayer" (itoa pad))) (command "layer" "make" newlayer "" "" "" "" "") (setq count (1+ count)))
I think there's an error there somewhere - but lisp really isn't my forte.
Reply to
strawberry
Hi,
I need to create about 500 layers and I'd rather not do it manually. They need to have a specific name with a unique sequencial number in the name. Also, the colors need to alternate between about 4 colors. Is there such a free lisp tool or one that I can buy? TIA.
Reply to
Mason
I spent 2 hours today looking for them. I found none. You mind telling me where you know the where abouts?
Reply to
Anonymous
2 hours! I don't know about 'loads of them' but a two-minute search over at cadalyst.com pulled up this description:
;;;CADALYST 05/04 Tip1951: ARCHLAYERS.LSP Layer List (c) 2004 Theodorus Winata
;;; Command name: ALA ;;; The command generates Architectural layers. ;;; To meet your drawings layering names, edit ;;; ARCHLAYERS.csv.
Haven't tried it but it sounds like it could do what you want.
Reply to
strawberry
give me ur email and i'll try to send you an lsp that i modify. it creates 500 layers with 4 colors but the colors changes alternately only at every 125 layers
Reply to
v-las
snipped-for-privacy@yahoo.com
Thanx!
Reply to
Anonymous
Strawberry,
I downloaded ACHLAYERS.LSP and I can't wait to try it out! If I can create the layers in Xcel and bring them into Autocad, that would be perfect!! Thank you!!!!!!!!!!!!!!!!!!!!!!!!!
Reply to
Boll Weevil
1. Add the contents of the ARCHLAYER.LSP into your acad2006.lsp file. 2. Create a Xcel sheet with the following info: column 1 - layer name plus 0001 and so on column 2 - color 1 red 5 blue 2 yellow 6 magenta 3 green 7 white 4 cyan column 3 - the linetype (use CN for Continuous) column 4 - the status of the plot style (just put Y) Example: | test001 | 1 | CN | Y | 3. Create new sequencial layer name in Xcel by selecting your first layer name in column one and then dragging downward the bottom right corner of the cell. This will automatically create the new sequencial layer name. 4. Save the file as a NEWLAYERS.CSV file. Example: test0001,1,CN,Y test0002,2,CN,Y test0003,3,CN,Y test0004,4,CN,Y test0005,6,CN,Y test0006,1,CN,Y test0007,2,CN,Y test0008,3,CN,Y test0009,4,CN,Y test0010,6,CN,Y 5. Get rid of hidden character in the Xcel file and as the final CSV file. Open the NEWLAYERS.CSV file with Microsoft Word. Select all the text and then paste it into Note Pad and save the file as ARCHLAYERS.csv into your autocad support directory(ex: C:\Program Files\Autocad 2006\support). 6. Import the new layers. In autocad, issue the command: Command: ala Architectural Layers Loaded...! If you made a mistake in your CSV file, you will get the options prompt instead. If you have other layers in the drawing, this tool will only add the new layers into the drawing. -----------------------------------------------------------------------------------
;;;CADALYST 05/04 Tip1951: ARCHLAYERS.LSP Layer List ;;; (c) 2004 Theodorus Winata ;;; ;;; ;;; Command name: ALA ;;; The command generates Architectural layers. ;;; To meet your drawings layering names, edit ;;; ARCHLAYERS.csv. ;;; ;;; ;;; Developed by Theodorus Winata ;;; March 2003 ;;; 1024-89 Avenue SW ;;; Calgary, AB. T2V 0W4 ;;; CANADA ;;; ;;; (defun C:ALA (/ CHAR CME CNT COL LAY LLS LTP PLT RGM RLI) (defun *error* (msg) (princ msg)) (setq CME (getvar "CMDECHO") RGM (getvar "REGENMODE") CNT 0 LLS (findfile "ARCHLAYERS.csv") LAY "" COL "" LTP "" PLT "" );;setq (setvar "CMDECHO" 0) (setvar "REGENMODE" 0) (if LLS (setq LLS (open LLS "R")) (alert "\nLayers List not found!") );;if (if LLS (while (setq RLI (read-line LLS)) (setq CNT 1 CHAR t );;setq (while CHAR (setq CHAR (substr RLI CNT 1)) (if (/= CHAR ",") (setq LAY (strcat LAY CHAR)) (setq CHAR nil) );;if (setq CNT (1+ CNT)) );;while (setq CHAR t) (while CHAR (setq CHAR (substr RLI CNT 1)) (if (/= CHAR ",") (setq COL (strcat COL CHAR)) (setq CHAR nil) );;if (setq CNT (1+ CNT)) );;while (setq CHAR t) (while CHAR (setq CHAR (substr RLI CNT 1)) (if (not (or (= CHAR ",") (= CHAR ""))) (setq LTP (strcat LTP CHAR)) (setq CHAR nil) );;if (setq CNT (1+ CNT)) );;while (setq CHAR t) (while CHAR (setq CHAR (substr RLI CNT 1)) (if (not (or (= CHAR ",") (= CHAR ""))) (setq PLT (strcat PLT CHAR)) (setq CHAR nil) );;if (setq CNT (1+ CNT)) );;while (if (= LTP "CN") (setq LTP "Continuous") );;if (if (= PLT "Y") (setq PLT "Plot") );;if (command ".-layer" "make" LAY "color" COL LAY "ltype" LTP LAY "P" PLT LAY "") (setq LAY "" COL "" LTP "" PLT "") );;while );; if LLS (command "-layer" "set" "0" "") (close LLS) (setvar "CMDECHO" CME) (setvar "REGENMODE" RGM) (princ "\t\tArchitectural Layers Loaded...!") (princ) );;C:ALA
Reply to
Anonymous

PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.