Macro or autolisp ?

Discussion in 'AutoCAD' started by Lon Jafraty, Jan 23, 2005.

  1. Lon Jafraty

    Lon Jafraty Guest

    What I want to do is set up a button to allow me to add about 15 layers, 7
    texts styles, 2 dimension styles. The reason I want to do this is we use a
    ton of x-refs and are always changing and are always purging drawings which
    I lose some of my layers, test style, dimension styles and I thought it
    would be easier than to keep dragging them in from the design center. This
    will be the first time for doing this so all help will be appreciated.
     
    Lon Jafraty, Jan 23, 2005
    #1
  2. Lon Jafraty

    ECCAD Guest

    Lon,
    One easy way is to make up a blank drawing..no graphics,
    just definitions of layers, text styles and dim styles..preloaded.
    Then just 'insert' this drawing at 0,0.
    You should have all the definitions loaded into target file.

    Bob
     
    ECCAD, Jan 23, 2005
    #2
  3. Lon Jafraty

    sunny Guest

    Lon Jafraty дµÀ:
    I do this as Bob said. That's a easy way.
     
    sunny, Jan 24, 2005
    #3
  4. Lon Jafraty

    OLD-CADaver Guest

    Yes the block method is easy, but it requires another file to manage. I use a lisp function that is then accessible from several methods. I have a drawing setup function that sets every system variable, text setting, dim setting and creates all the basic layers.

    There's a couple of ways to get there in lisp, either (ENTMAKE or a simple (command ".layer" "m" ...) function works well.

    There's also this : http://tinyurl.com/6qp5r
     
    OLD-CADaver, Jan 24, 2005
    #4
  5. if there is no thinking involved, write a script.
    Just type in the commands as you would for the command line.
    spaces are returns, use quotes for layer names with spaces.
    so your script might look like:

    ;layers
    -layer m "sdfsd fsdf" co 2
    -layer m "sdfsd fsdf1" co 2
    -layer m "sdfsd fsdf2" co 2
    ;dimension style, set variables and save...
    DIM
    DIMALT Off
    DIMALTD 2
    DIMALTF 25.4
    DIMALTTD 2
    DIMALTTZ 0
    DIMALTU 2
    DIMALTZ 0
    DIMAPOST '
    DIMASO On
    DIMASZ 0.10
    DIMAUNIT 0
    DIMBLK .
    DIMBLK1 _ARCHTICK
    DIMBLK2 _ARCHTICK
    DIMCEN 0.09
    DIMCLRD BYLAYER
    DIMCLRE BYLAYER
    DIMCLRT BYLAYER
    DIMDEC 2
    DIMDLE 0
    DIMDLI 0.5
    DIMEXE 0.06
    DIMEXO 0.06
    DIMFIT 3
    DIMGAP 0.04
    DIMJUST 0
    DIMLIM Off
    DIMLFAC 1.0
    DIMPOST '
    DIMRND 0
    DIMSAH Off
    DIMSD1 Off
    DIMSD2 Off
    DIMSE1 Off
    DIMSE2 Off
    DIMSHO On
    DIMSOXD Off
    DIMTAD 1
    DIMTDEC 4
    DIMTFAC 1
    DIMTIH Off
    DIMTIX Off
    DIMTM 0
    DIMTOFL off
    DIMTOH Off
    DIMTOL Off
    DIMTOLJ 1
    DIMTP 0
    DIMTSZ 0
    DIMTVP 0
    DIMTXSTY STANDARD
    DIMTXT 0.10
    DIMTZIN 0
    DIMUNIT 2
    DIMUPT Off
    DIMZIN 0
    SAVE
    Improvement
    YES
    ;leader
    DIMBLK .
    DIMBLK1 .
    DIMBLK2 .
    SAVE
    Improvement$0
    YES
    ;back to standard
    DIMBLK .
    DIMBLK1 .
    DIMBLK2 .
    SAVE
    Improvement
    YES
    EXIT
    ;text styles
    -style "newstyle" romansx.shx 0.0 1.0 0.0 n n n
    -style "newstyle2" romansx.shx 0.0 1.0 0.0 n n n

    modify as needed, test each item by doing the commands by hand

    "Lon Jafraty" <>
    |>What I want to do is set up a button to allow me to add about 15 layers, 7
    |>texts styles, 2 dimension styles. The reason I want to do this is we use a
    |>ton of x-refs and are always changing and are always purging drawings which
    |>I lose some of my layers, test style, dimension styles and I thought it
    |>would be easier than to keep dragging them in from the design center. This
    |>will be the first time for doing this so all help will be appreciated.
    |>

    James Maeding
    jmaeding at hunsaker dot com
    Civil Engineer/Programmer
     
    James Maeding, Jan 24, 2005
    #5
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.