| Author |
Message |
TRJ
Guest
|
Posted:
Wed Apr 06, 2005 8:59 pm Post subject:
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.
|
|
| Back to top |
|
 |
Tom Closs
Guest
|
Posted:
Wed Apr 06, 2005 9:40 pm Post subject:
Re: Menu Item Repeat |
|
|
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...
| Quote: | 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.
|
|
|
| Back to top |
|
 |
Casey
Guest
|
Posted:
Thu Apr 07, 2005 12:12 am Post subject:
Re: Menu Item Repeat |
|
|
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...
| Quote: | 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.
|
|
|
| Back to top |
|
 |
TRJ
Guest
|
Posted:
Thu Apr 07, 2005 3:36 am Post subject:
Re: Menu Item Repeat |
|
|
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...
| Quote: | 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.
|
|
|
| Back to top |
|
 |
Jeff Mishler
Guest
|
Posted:
Thu Apr 07, 2005 3:53 am Post subject:
Re: Menu Item Repeat |
|
|
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...
| Quote: | 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.
|
|
|
| Back to top |
|
 |
TRJ
Guest
|
Posted:
Thu Apr 07, 2005 4:03 am Post subject:
Re: Menu Item Repeat |
|
|
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...
| Quote: | 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.
|
|
|
| Back to top |
|
 |
Kent Cooper, AIA
Guest
|
Posted:
Thu Apr 07, 2005 4:47 pm Post subject:
Re: Menu Item Repeat |
|
|
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...
| Quote: | 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. |
|
|
| Back to top |
|
 |
Tom Smith
Guest
|
Posted:
Thu Apr 07, 2005 8:15 pm Post subject:
Re: Menu Item Repeat |
|
|
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. |
|
| Back to top |
|
 |
TRJ
Guest
|
Posted:
Thu Apr 07, 2005 11:15 pm Post subject:
Re: Menu Item Repeat |
|
|
Excellent advice gentlemen. thank you.
"Tom Smith" <nospam@address.withheld> wrote in message
news:2349024.1112890563728.JavaMail.jive@jiveforum2.autodesk.com...
| Quote: | 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
| Quote: |
[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. |
|
|
| Back to top |
|
 |
Tom Smith
Guest
|
Posted:
Thu Apr 07, 2005 11:30 pm Post subject:
Re: Menu Item Repeat |
|
|
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)) |
|
| Back to top |
|
 |
|
|
|
|