Results 1 to 10 of 10

Thread: Menu Item Repeat

  1. #1
    TRJ Guest

    Menu Item Repeat

    I have a partial menu (heirarchical) with hundreds of lines like the
    following:

    [SP-20 ]^c^c-LAYER;M;LA-TREE;C;3;;;-INSERT;TREE-01;\(/ 10.0 12)+
    ;;;SP-20;-LAYER;M;LA-TREEHT;C;2;;;-INSERT;TREE-HGT;@;!sf;;;20;

    How can these macro be "defun'd" so that a single return will repeat the
    macro? I know how to make macros repeat but this is not the desired
    functionality.

  2. #2
    Tom Closs Guest
    It looks as if all of these macros creates some layers and inserts blocks on
    these layers. If you created a simple LISP routine to do the same thing it
    would allow you to use the Enter key to repeat the LISP lika a seperate
    AutoCAD command. I think this is what you are looking for.

    --
    Tom Closs
    INCAT
    tcloss@incat.com
    www.incat.com

    "TRJ" <a0h9rjone@cfl.rr.com> wrote in message news:4254157a_2@newsprd01...
    I have a partial menu (heirarchical) with hundreds of lines like the
    following:

    [SP-20 ]^c^c-LAYER;M;LA-TREE;C;3;;;-INSERT;TREE-01;\(/ 10.0 12)+
    ;;;SP-20;-LAYER;M;LA-TREEHT;C;2;;;-INSERT;TREE-HGT;@;!sf;;;20;

    How can these macro be "defun'd" so that a single return will repeat the
    macro? I know how to make macros repeat but this is not the desired
    functionality.

  3. #3
    Casey Guest
    for toolbar buttons, putting a '*' before the command makes it repeat untill
    it is 'escaped' out of..... don't know if it works in a menu or not....
    probably not... so Lisp would be the way to go.

    Casey


    "TRJ" <a0h9rjone@cfl.rr.com> wrote in message news:4254157a_2@newsprd01...
    I have a partial menu (heirarchical) with hundreds of lines like the
    following:

    [SP-20 ]^c^c-LAYER;M;LA-TREE;C;3;;;-INSERT;TREE-01;\(/ 10.0 12)+
    ;;;SP-20;-LAYER;M;LA-TREEHT;C;2;;;-INSERT;TREE-HGT;@;!sf;;;20;

    How can these macro be "defun'd" so that a single return will repeat the
    macro? I know how to make macros repeat but this is not the desired
    functionality.

  4. #4
    TRJ Guest
    If I create a subroutine and call it in each macro with the appropriate
    values as in:

    [TAF]^c^c(gcvr_sub "TAF" 12)

    it DOES NOT repeat with a simple Enter.

    I cannot imagine having to create unique C: defuns for each line of the menu
    (hundreds of lines). And as stated before, I realize a menu macro can be
    made to repeat until escaped but, again, this is not the desired
    functionality.

    Can't you create a "container" or temporary C: defun of some sort to
    accomplish the desired functionality? Is the lambda function what I'm
    looking for? I've never used it nor do I understnd its use.


    "Tom Closs" <tcloss@incat.com> wrote in message
    news:42541f14$1_3@newsprd01...
    It looks as if all of these macros creates some layers and inserts blocks
    on
    these layers. If you created a simple LISP routine to do the same thing
    it
    would allow you to use the Enter key to repeat the LISP lika a seperate
    AutoCAD command. I think this is what you are looking for.

    --
    Tom Closs
    INCAT
    tcloss@incat.com
    www.incat.com

    "TRJ" <a0h9rjone@cfl.rr.com> wrote in message news:4254157a_2@newsprd01...
    I have a partial menu (heirarchical) with hundreds of lines like the
    following:

    [SP-20 ]^c^c-LAYER;M;LA-TREE;C;3;;;-INSERT;TREE-01;\(/ 10.0 12)+
    ;;;SP-20;-LAYER;M;LA-TREEHT;C;2;;;-INSERT;TREE-HGT;@;!sf;;;20;

    How can these macro be "defun'd" so that a single return will repeat the
    macro? I know how to make macros repeat but this is not the desired
    functionality.



  5. #5
    Jeff Mishler Guest
    How about this?
    [TAF]^c^c(defun c:temp () (gcvr_sub "TAF" 12));temp
    [TAM^c^c(defun c:temp () (gcvr_sub "TAM" 10));temp

    etc.......


    --
    Jeff
    check out www.cadvault.com
    "TRJ" <a0h9rjone@cfl.rr.com> wrote in message news:42547280$1_1@newsprd01...
    If I create a subroutine and call it in each macro with the appropriate
    values as in:

    [TAF]^c^c(gcvr_sub "TAF" 12)

    it DOES NOT repeat with a simple Enter.

    I cannot imagine having to create unique C: defuns for each line of the
    menu
    (hundreds of lines). And as stated before, I realize a menu macro can be
    made to repeat until escaped but, again, this is not the desired
    functionality.

    Can't you create a "container" or temporary C: defun of some sort to
    accomplish the desired functionality? Is the lambda function what I'm
    looking for? I've never used it nor do I understnd its use.


    "Tom Closs" <tcloss@incat.com> wrote in message
    news:42541f14$1_3@newsprd01...
    It looks as if all of these macros creates some layers and inserts blocks
    on
    these layers. If you created a simple LISP routine to do the same thing
    it
    would allow you to use the Enter key to repeat the LISP lika a seperate
    AutoCAD command. I think this is what you are looking for.

    --
    Tom Closs
    INCAT
    tcloss@incat.com
    www.incat.com

    "TRJ" <a0h9rjone@cfl.rr.com> wrote in message
    news:4254157a_2@newsprd01...
    I have a partial menu (heirarchical) with hundreds of lines like the
    following:

    [SP-20 ]^c^c-LAYER;M;LA-TREE;C;3;;;-INSERT;TREE-01;\(/ 10.0 12)+
    ;;;SP-20;-LAYER;M;LA-TREEHT;C;2;;;-INSERT;TREE-HGT;@;!sf;;;20;

    How can these macro be "defun'd" so that a single return will repeat
    the
    macro? I know how to make macros repeat but this is not the desired
    functionality.





  6. #6
    TRJ Guest
    Tadah - where do I send the prize money ;-). Thanks Jeff for a glimpse of
    sanity!

    "Jeff Mishler" <jeff_m@cadvault.com> wrote in message
    news:42547672_2@newsprd01...
    How about this?
    [TAF]^c^c(defun c:temp () (gcvr_sub "TAF" 12));temp
    [TAM^c^c(defun c:temp () (gcvr_sub "TAM" 10));temp

    etc.......


    --
    Jeff
    check out www.cadvault.com
    "TRJ" <a0h9rjone@cfl.rr.com> wrote in message
    news:42547280$1_1@newsprd01...
    If I create a subroutine and call it in each macro with the appropriate
    values as in:

    [TAF]^c^c(gcvr_sub "TAF" 12)

    it DOES NOT repeat with a simple Enter.

    I cannot imagine having to create unique C: defuns for each line of the
    menu
    (hundreds of lines). And as stated before, I realize a menu macro can be
    made to repeat until escaped but, again, this is not the desired
    functionality.

    Can't you create a "container" or temporary C: defun of some sort to
    accomplish the desired functionality? Is the lambda function what I'm
    looking for? I've never used it nor do I understnd its use.


    "Tom Closs" <tcloss@incat.com> wrote in message
    news:42541f14$1_3@newsprd01...
    It looks as if all of these macros creates some layers and inserts
    blocks
    on
    these layers. If you created a simple LISP routine to do the same
    thing
    it
    would allow you to use the Enter key to repeat the LISP lika a seperate
    AutoCAD command. I think this is what you are looking for.

    --
    Tom Closs
    INCAT
    tcloss@incat.com
    www.incat.com

    "TRJ" <a0h9rjone@cfl.rr.com> wrote in message
    news:4254157a_2@newsprd01...
    I have a partial menu (heirarchical) with hundreds of lines like the
    following:

    [SP-20 ]^c^c-LAYER;M;LA-TREE;C;3;;;-INSERT;TREE-01;\(/ 10.0 12)+
    ;;;SP-20;-LAYER;M;LA-TREEHT;C;2;;;-INSERT;TREE-HGT;@;!sf;;;20;

    How can these macro be "defun'd" so that a single return will repeat
    the
    macro? I know how to make macros repeat but this is not the desired
    functionality.







  7. #7
    Kent Cooper, AIA Guest
    The * alone isn't enough -- the menu item needs to start with *^C^C. And
    it does work in tablet, screen, and pull-down menus as well as toolbars.
    --
    Kent Cooper

    "Casey" wrote...
    for toolbar buttons, putting a '*' before the command makes it repeat
    untill it is 'escaped' out of..... don't know if it works in a menu or
    not.... probably not... so Lisp would be the way to go.

    Casey

    "TRJ" wrote...
    I have a partial menu (heirarchical) with hundreds of lines like the
    following:

    [SP-20 ]^c^c-LAYER;M;LA-TREE;C;3;;;-INSERT;TREE-01;\(/ 10.0 12)+
    ;;;SP-20;-LAYER;M;LA-TREEHT;C;2;;;-INSERT;TREE-HGT;@;!sf;;;20;

    How can these macro be "defun'd" so that a single return will repeat the
    macro? I know how to make macros repeat but this is not the desired
    functionality.

  8. #8
    Tom Smith Guest
    I've used your basic idea of doing a c: defun to make a menu itme repeat with a return, but with image menus. For instance we have a menu of common drawing tags, and it's common to place a bunch of them in a series. So the image_tags menu is called indirectly from a pulldown by

    [Drawing Tags]$I=ourmenu.image_tags imagemenu;

    Or from a toobar button by

    [_Button("Tags", "tags.bmp", "tags.bmp")]$I=ourmenu.image_tags imagemenu;

    And in the associated mnl there's a c: function

    (defun c:imagemenu ()
    (menucmd "I=*")
    (princ))

    This is enough to make the image menu pop up again by hitting a return.

    You could simplify Jeff's approach one step further by having a function in your mnl like

    (defun dothis (functioncall)
    (setq c:temp (list nil functioncall))
    (c:temp))

    And then the menu item would reduce to

    [TAF]^c^c(dothis '(gcvr_sub "TAF" 12));

    That would eliminate all those repetitive defuns in the menu itself.

  9. #9
    TRJ Guest
    Excellent advice gentlemen. thank you.

    "Tom Smith" <nospam@address.withheld> wrote in message
    news:2349024.1112890563728.JavaMail.jive@jiveforum 2.autodesk.com...
    I've used your basic idea of doing a c: defun to make a menu itme repeat
    with a return, but with image menus. For instance we have a menu of common
    drawing tags, and it's common to place a bunch of them in a series. So the
    image_tags menu is called indirectly from a pulldown by
    [Drawing Tags]$I=ourmenu.image_tags imagemenu;

    Or from a toobar button by

    [_Button("Tags", "tags.bmp", "tags.bmp")]$I=ourmenu.image_tags imagemenu;

    And in the associated mnl there's a c: function

    (defun c:imagemenu ()
    (menucmd "I=*")
    (princ))

    This is enough to make the image menu pop up again by hitting a return.

    You could simplify Jeff's approach one step further by having a function
    in your mnl like

    (defun dothis (functioncall)
    (setq c:temp (list nil functioncall))
    (c:temp))

    And then the menu item would reduce to

    [TAF]^c^c(dothis '(gcvr_sub "TAF" 12));

    That would eliminate all those repetitive defuns in the menu itself.

  10. #10
    Tom Smith Guest
    Oops, not that it really matters, but I should have declared the on-the-fly defun local:

    (defun dothis (functioncall / c:temp)
    (setq c:temp (list nil functioncall))
    (c:temp))

Similar Threads

  1. Inactive recompile menu item in file manager
    By Svenn Are Bjerkem in forum Cadence
    Replies: 2
    Last Post: 10-20-2005, 05:10 AM
  2. Menu item to open HTML from server location
    By ccyc in forum Customization
    Replies: 2
    Last Post: 03-22-2005, 05:21 PM
  3. Why repeat jumping
    By Adesu in forum Customization
    Replies: 4
    Last Post: 03-14-2005, 02:01 AM
  4. Repeat %s
    By Jorge Jimenez in forum VBA
    Replies: 0
    Last Post: 02-08-2005, 06:56 PM
  5. Right Click stuck on REPEAT
    By aawalter@hotmail.com in forum AutoCAD
    Replies: 2
    Last Post: 11-20-2004, 02:32 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other forums: Access Forum - Microsoft Office Forum - Exchange Server Forum