Multiline style creation via. command macro or script

Discussion in 'AutoCAD' started by krobincat, Jan 13, 2005.

  1. krobincat

    krobincat Guest

    Does anyone know how to create Multiline styles via the command line so I can create a command macro/script of it.
    I need to tell it how many lines I want as a prompt and default the spacing and linetypes.
    Thanks,
    Kevin Robinson
     
    krobincat, Jan 13, 2005
    #1
  2. krobincat

    David Kozina Guest

    Kevin,
    Glutton for punishment, eh? ;)

    Let me guess - your running head-on into the !#$(*#$(*&^# mlstyle dialog
    load option brick wall.
    Pardon my punctuation.

    Try here for one example how to do this via entmake:
    http://xarch.tu-graz.ac.at/autocad/stdlib/ENTMAKE.LSP

    Note that you'll still have to dig into the dxf codes to use the above
    function properly (as well as understand how the function operates and what
    it's stdlib dependencies might be.

    An easier way (depending on your coding experience) might be to create your
    standard styles and incorporate them into small drawings, which can be
    command line -inserted (look ma! no dialog!) via a lisp routine or script.

    As a further suggestion, control your element linetypes (and color) via the
    LAYER settings (IOW, use BYLAYER), rather than hardcode them into the
    mlinestyle, if at all possible, and, assuming you have equal element
    spacings, set them to be either 1 unit apart in the mlinestyle definition OR
    give them an overall total of 1 unit, then use the mline scale option as
    needed in the drawing. The reason should be obvious, and hopefully reduce
    the number of styles you will need to create. (Note that the MLINE command
    options (or corresponding sysvars) can be preprogrammed as needed to 'set
    things up' for the user.)

    IOW, do only that which is necessary for your mlinestyle definitions - no
    more, no less. KISS principle in full force applies here (or you'll likely
    be paying for being fancy-shmancy later).

    hth,
    David Kozina
     
    David Kozina, Jan 13, 2005
    #2
  3. Well, I was going to suggest just typing MLINE ST at the command line in
    AutoCAD, to just go through the command, taking note of the prompt sequence
    and the kinds of "answers" or options required at each step. But I tried it
    (in 2004), and oddly, after giving it a style name, it puts up a dialog box,
    even with FILEDIA set to zero to suppress them. It doesn't accept hyphens
    to bypass the dialog box, either, whether I put one in front of MLINE or the
    ST option or a file name. I'm stumped.
     
    Kent Cooper, AIA, Jan 13, 2005
    #3
  4. krobincat

    David Kozina Guest

    Egads, y'all really DO need to pardon my punctuation!
    THAT was an apostrophe catastrophe!

    I am SO ashamed,
    David Kozina
     
    David Kozina, Jan 13, 2005
    #4
  5. krobincat

    John Schmidt Guest

    What we do is have all the mline styles we use saved in a small dwg, then we
    use menu macros to insert this, which brings all the mline styles into the
    current drawing. Then we have the block deleted and purged, then call a
    script that sets the layer properties and starts the mline command,
    specifying the mline style and justification.

    Below is a copy of one of the macros, plus the script that it calls, (watch
    word wrap for macro):

    ^C^C-insert;//0ds1//Toolbox/mlrw.dwg;0,0;;;;(ssget "x" '((2 .
    "mlrw")) );erase;p;;-purge;B;mlrw;n;script;RWallpr.SCR

    RWallpr.SCR:

    LAYER
    MAKE
    RETWALL-PRELIM
    COLOR
    54
    RETWALL-PRELIM

    CMLSTYLE
    RW-PRELIM
    CMLJUST
    2
    MLINE

    John

    can create a command macro/script of it.
     
    John Schmidt, Jan 13, 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.