+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Junior Member fozzie's Avatar
    Using
    Architecture 2010
    Join Date
    Oct 2005
    Posts
    11

    Default LISP routine for auto layer creation.

    Registered forum members do not see this ad.

    Hi all,
    What I am trying to accomplish is a single command that will create several default layers all with similar names.
    EG.
    BLD_GROUND_AREA
    BLD_GROUND_TEXT

    I want to add a number for each type of building that is in the drawing.
    i could have several buildings in the drawing. 02145, 18657 and 02254 for example.
    what i want to do is put the number after "BLD_"
    EG.
    BLD_02145_GROUND_AREA etc...

    Is there anyway of running a command that would ask for the number then insert it into the right place and create the layers?
    There could be up to 35+ layers on some drawings and its is tiresome to create all the layers via the layer manager.
    any help is appreciated, whether its is possible or not.
    Thanks

  2. #2
    Forum Deity
    Using
    Civil 3D 2008
    Join Date
    Sep 2006
    Location
    Pittsburgh, PA, USA
    Posts
    3,581

    Default

    Here's a start
    Code:
    (defun c:bl ()
    (setq bldg# (getstring "Enter Building No.: ")
             layname1 (strcat "BLDG_" bldg# "_GROUND_AREA")
             layname2 (strcat "BLDG_" bldg# "_GROUND_TEXT")
    );setq
    (command "-layer" "m" layname1 "")
    (command "-layer" "m" layname2 "")
    );defun

  3. #3
    Full Member
    Using
    AutoCAD 2004
    Join Date
    Aug 2007
    Posts
    80

    Default

    This should do it. its a spread sheet and requires that you save and close the document that you wish to add the layers to but. its short and simple

    layer maker.zip
    ...And someday, they will have computers the size of houses, with millions of vacuum tubes, doing thousands of computations per minute...!!!

  4. #4
    Junior Member fozzie's Avatar
    Using
    Architecture 2010
    Join Date
    Oct 2005
    Posts
    11

    Laughing

    Registered forum members do not see this ad.

    Quote Originally Posted by lpseifert View Post
    Here's a start
    Code:
    (defun c:bl ()
    (setq bldg# (getstring "Enter Building No.: ")
             layname1 (strcat "BLDG_" bldg# "_GROUND_AREA")
             layname2 (strcat "BLDG_" bldg# "_GROUND_TEXT")
    );setq
    (command "-layer" "m" layname1 "")
    (command "-layer" "m" layname2 "")
    );defun
    Awesome! Exactly what I needed.
    Thanks!

Similar Threads

  1. Looking for a LISP routine...
    By tzframpton in forum AutoLISP, Visual LISP & DCL
    Replies: 8
    Last Post: 6th Aug 2013, 01:54 pm
  2. m2s lisp routine
    By neilma in forum AutoCAD 3D Modelling & Rendering
    Replies: 19
    Last Post: 30th Sep 2010, 04:14 pm
  3. lisp routine
    By iain9876 in forum AutoLISP, Visual LISP & DCL
    Replies: 7
    Last Post: 13th Oct 2006, 04:39 pm
  4. topology creation thru lisp
    By vivekgrs in forum AutoLISP, Visual LISP & DCL
    Replies: 1
    Last Post: 19th Aug 2006, 10:01 am
  5. Run a LISP ROUTINE
    By CADken in forum AutoCAD Beginners' Area
    Replies: 2
    Last Post: 9th Aug 2006, 12:02 am

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts