Easy Customization

Discussion in 'AutoCAD' started by TeeDeck, Jun 24, 2004.

  1. TeeDeck

    TeeDeck Guest

    I use CAD without any fancy custom stuff because we are a small company and
    don't need a whole lot but today, I sure could use some help. It's very
    simple. I need to add a new pline button that will create one segment line.
    In other words, select a starting point, draw to the next (user selected)
    point and end the command. I'm not very good yet at creating this, so if
    someone is willing to give this old fellow a hand, it would be appreciated.

    Thanks,

    TeeDeck
     
    TeeDeck, Jun 24, 2004
    #1
  2. TeeDeck

    TeeDeck Guest

    Wasn't that simple? Thanks a bunch

    TeeDeck
     
    TeeDeck, Jun 24, 2004
    #2
  3. TeeDeck

    TeeDeck Guest

    ok robert, i have the thing working but now comes a different problem. I
    have my right click set as repeat last command when no other command is
    active but my new single segment polyline menu won't work when i right click
    to repeat it, it defaults back to the normal pline command. Any
    suggestions?

    Thanks,

    TeeDeck
     
    TeeDeck, Jun 24, 2004
    #3
  4. That would require some lisping. Are you up to that?

    --
    R. Robert Bell


    ok robert, i have the thing working but now comes a different problem. I
    have my right click set as repeat last command when no other command is
    active but my new single segment polyline menu won't work when i right click
    to repeat it, it defaults back to the normal pline command. Any
    suggestions?

    Thanks,

    TeeDeck
     
    R. Robert Bell, Jun 24, 2004
    #4
  5. TeeDeck

    TeeDeck Guest

    Sure...i'm game for this. Got to learn someday

    TeeDeck
     
    TeeDeck, Jun 24, 2004
    #5
  6. TeeDeck

    ECCAD Guest

    Try this:

    [Pline with Repeat]^C^C(defun C:MP ()(command "_pline" pause pause "")) MP;

    Bob
     
    ECCAD, Jun 24, 2004
    #6
  7. TeeDeck

    ECCAD Guest

    Sorry,
    NG not in sync..don't look.
    Bob
     
    ECCAD, Jun 24, 2004
    #7
  8. Is it really appropriate to define the MP "command" anew, every time you
    pick the menu item, and then invoke it? Would it be better, if this is
    something you would use a lot, to define it in something that loads with
    AutoCAD, and then just call the command name on the menu item?

    And would that one actually Repeat on its own, or isn't that what you meant
    by "with Repeat"?

    The defun route (whichever way you do it) has the advantage that you should
    be able to repeat it with Enter, etc. But if you're going to pick it from a
    menu item and don't need that kind of repeatability, you could just do this,
    which should repeat automatically as long as you want:
    [Pline with Repeat]*^C^C(command "_pline" pause pause "")

    or even just:
    [Pline with Repeat]*^C^C_pline \\;

    [I can't help but wonder why, if you're doing single-line-segment polylines,
    you don't just use Lines. If that would work, just leave the p's out of the
    Pline's above.]

    Kent Cooper, AIA

    ...
     
    Kent Cooper, AIA, Jun 24, 2004
    #8
  9. TeeDeck

    ECCAD Guest

    Appropriate ? Probably not. It would be a little harder to explain to a 'newbee' how / where to tuck the function away, then (load) the function if not loaded, then do the function..
    much easier route this way. Just re-writes the function (no harm) for such a short one anyway. And, you have to 'pick' the menu item (anyway)..to get a load or just a call to it.
    Let's just keep it simple.. :)

    Bob
     
    ECCAD, Jun 24, 2004
    #9
  10. TeeDeck

    ECCAD Guest

    Repeat ?
    <<I have my right click set as repeat last command when no other command is active but my new single segment polyline menu won't work when i right click to repeat it, it defaults back to the normal pline command <<
    Hense use of 'repeat' - could be 'repeat if you want'..he can rename the button as desired.

    Bob
     
    ECCAD, Jun 24, 2004
    #10
  11. TeeDeck

    TeeDeck Guest

    I'm starting to understand what you guys are talking about, but let me make
    on thing clear. The 'repeat' term is used from the options menu in the
    right-click customization menu - "if no object is selected, repeat last
    command". Hence the problem, trying these versions takes me back to the
    start. I start a pline (or line), select the next point, and then i'm
    prompted to enter a new point or select (or press) enter. I'm trying to
    kill the last step - just one segment. I want the command to end after
    selecting the first point. I don't want to modify the existing pline or
    line functions as I still need these to work the default way.

    I know it sounds absurd but I work with simple 2D and sometimes I need to
    create shapes that have multiple lines at random locations but in the end
    they determine the shape I need.


    is active but my new single segment polyline menu won't work when i right
    click to repeat it, it defaults back to the normal pline command <<
     
    TeeDeck, Jun 24, 2004
    #11
  12. Ok, first off: please post the menu macro you created. We will take it from
    that point, so that you understand the process. We will be duplicating what
    the menu macro does but make a command via AutoLISP so you can hit <Enter>
    to repeat.

    (Ignore Bob and Kent for the purpose of learning the thought process [Sorry,
    guys!].)


    --
    R. Robert Bell


    Sure...i'm game for this. Got to learn someday

    TeeDeck
     
    R. Robert Bell, Jun 24, 2004
    #12
  13. TeeDeck

    ECCAD Guest

    <<I want the command to end after
    selecting the first point<<
    I guess I.m confused. How do you plan to draw a line or pline,
    with only picking (1) point ? Do you mean, you want to use the 'lastpoint' as beginning point, then just pick the 2nd point, and draw a pline between ? And, then repeat (pick next point), draw a line from end of 2nd to picked point. ??
    If you explain in steps, maybe we can get you there.

    Sorry for thick-head, but I don't see how what you want differs from the standard pline command...

    Bob
     
    ECCAD, Jun 24, 2004
    #13
  14. TeeDeck

    TeeDeck Guest

    I'm sorry if this is confusing...i'm at work and don't have all the time in
    the world but a bit of it. I'm on my way home right now and will continue
    this later this evening if anyone is still around. Thanks for all the help
    guys.

    TeeDeck


    as beginning point, then just pick the 2nd point, and draw a pline between ?
    And, then repeat (pick next point), draw a line from end of 2nd to picked
    point. ??
     
    TeeDeck, Jun 24, 2004
    #14
  15. TeeDeck

    ECCAD Guest

    Robert will walk you through it.
    See his post at: 19:25

    Bob
     
    ECCAD, Jun 24, 2004
    #15
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.