Open ended user input in a Menu Macro?

Discussion in 'AutoCAD' started by Gordon Price, Nov 17, 2004.

  1. Gordon Price

    Gordon Price Guest

    I am looking to create a menu macro for use with a Tool Palette. I want the
    macro to start the PLine command, allow the user to do as many vertexes as
    desired, then upon completion of the PLine, do a RevisionCloud, by object,
    last entity, and no to reverse loops. The latter all automatically. I can
    get I defined number of vertexes, but I can't seem to figure out how to get
    the openended PLine to work.
    Anyone have a suggestions?
    The goal here is to make a rev cloud by object a single task. Rather than
    drawing a rectangle or closed polyline, then doing revcloud, typing object,
    picking the object, and then return for default loops, I just pick the tool,
    pickpoints and I'm done. The pline gets converted to a rev cloud, with the
    right loop sizes and orientation, on the right layer.

    BTW, the answer to my earlier macro question, how to get Mid2Points to work
    in a macro, looks like this:
    ^C^C_breakline;S;.125;E;.0625;M2P;\\M2P;\\;

    I get a break line, with specified block size and extension, on the right
    layer, with M2P snaps for both pick points automatically. I will use it for
    stairs, where I always draw my break line from mid tread to mid of next
    tread. Pretty slick.

    Best,
    Gordon
     
    Gordon Price, Nov 17, 2004
    #1
  2. Since you say you want to do this "by object" and choose "no to reverse
    loops", you must be in a recent enough release that Revcloud is a native
    command, rather than an Express Tool. If that's the case, my "suggestion"
    is just to invoke Revcloud directly. You can start the menu item with layer
    settings, and set arc lengths within the command (unlike in the Express
    Tool, where it looks like you need the dialog box to do that). I'm not
    understanding why you would want to make a polyline and then convert it.

    But if you really do want to do that, check out (while) and the "cmdactive"
    system variable. You could find examples of their use in various threads in
    the newsgroup history.

    --
    Kent Cooper, AIA


    .....
     
    Kent Cooper, AIA, Nov 18, 2004
    #2
  3. Hi Gordon,

    [...]

    Diesel has no direct support for looping, so I fear it's easier to do it
    in e.g. lisp, although that leaves out LT.

    Any Layer setting applied to the Toolpalette entry is respected, so the
    following should do it.

    ; RCPOLY
    ; author: ruul AT gmx.net - 2004/11/18
    (defun c:rcpoly ( / elast ent)
    (setq elast (entlast))
    (setvar "osnapcoord" 1)
    (command "_pline")
    (while (wcmatch (strcase (getvar "cmdnames")) "*PLINE*")
    (command pause)
    )
    (if (/= elast (setq ent (entlast)))
    (command "_revcloud" "_o" ent "_n")
    )
    'Thanks
    )
    ; ---- that's it ----------

    ruul
     
    ruul morawetz, Nov 18, 2004
    #3
  4. Gordon Price

    Gordon Price Guest

    Yes, R2005, so cloud is finally native. As for why I want to do it this way,
    I really hate the look of a freehand cloud, with the loops sized by speed of
    movement and such. My preference is to draw a recangle or closed pline and
    convert, it just looks cleaner. But that requires two commands, the pline
    and the cloud, and setting the loop size (because I also use a cloud with
    different loop size for hedges and other planting), choosing by Object, etc.
    The goal was to have a single Tool that lets you pick points, and you end up
    with a cloud, with correct loop size, on the right layer, with no extra
    effort.
    I was thinking of that, but I would really like to keep it as a menu macro,
    as it is easier for people to customize, and it works in LT.

    It was worth a try, tho'

    Gordon
     
    Gordon Price, Nov 18, 2004
    #4
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.