See the top rated post in this thread. Click here

Results 1 to 10 of 10

Thread: Command macro in Image Menu

  1. #1
    I could stop if I wanted to
    Join Date
    2003-08
    Location
    Tijuana
    Posts
    225
    Login to Give a bone
    0

    Default Command macro in Image Menu

    Can I make this work in a image menu? The macro works fine on a toolbar and a pop down menu, but I need it to run from an image menu.

    [KEYTAG(DOOR,DOOR)]^C^C-INSERT;DOOR;ps;(getvar "ltscale");\(getvar "ltscale");;

    Thanks,
    Last edited by sifuentes; 2006-05-17 at 05:06 PM.

  2. #2
    The Silent Type Mike.Perry's Avatar
    Join Date
    2000-11
    Posts
    13,656
    Login to Give a bone
    0

    Question Re: Command macro in Image Menu

    Quote Originally Posted by sifuentes
    Can I make this work on a pop down menu? The macro works fine on a toolbar and a pop down menu, but I need it to run from an image menu.

    [KEYTAG(DOOR,DOOR)]^C^C-INSERT;DOOR;ps;(getvar "ltscale");\(getvar "ltscale");;
    Hi

    Have you tried associating the above command macro with an Image Tile Menu.

    If yes, what happened ?

    If no, try it and see what happens.

    Below is extracted from the AutoCAD Online Help File [F1]...

    Quote Originally Posted by Overview of Image Tile Menus

    Image Tile Menu Macros

    Image tile menu macros can perform the same function as other menu macros; however, you cannot use the menu macro repetition feature. These menu macros can contain menu commands, including $I= commands. It is possible, therefore, to construct hierarchical image tile menus in which a selection displays another image tile menu, and so on. Because the activation of these menus is sequential rather than nested, the complexity of the structures you can create has no limits.
    Have a good one, Mike

  3. #3
    I could stop if I wanted to
    Join Date
    2003-08
    Location
    Tijuana
    Posts
    225
    Login to Give a bone
    0

    Default Re: Command macro in Image Menu

    The menu is already made and works fine, it is our office block library. I am just trying to find out if we can add more functionality.

    The original menu code reads like this:

    [KEYTAG(DOOR,DOOR)]^C-INSERT;DOOR;;\;\

    and works fine. But when I change it to:

    [KEYTAG(DOOR,DOOR)]^C^C-INSERT;DOOR;ps;(getvar "ltscale");\(getvar "ltscale");;

    the image menu works normally (scale factors default to 1) but doesn't take the ltscale for scale factors. And as stated, trying the macro in toolbars and pull downs work fine. I am missing something? Or lisp can't be used in image menus?

    I also have another question from the original code line: why is the block name followed by two enters? First I tought it was a typo, but all block names are followed by two enters, where they only need one to continue the command. Is there some purpose on that?

  4. #4
    I could stop if I wanted to
    Join Date
    2003-08
    Location
    Tijuana
    Posts
    225
    Login to Give a bone
    0

    Default Re: Command macro in Image Menu

    It seems I can't even scale a block at all. The following works well in a pop down menu, but not in the image menu.

    [NAME(PLTTL,PLAN TITLE)]^C-INSERT;PLTTL;\25.4;;\

    In the pop down it scales the block 25.4 times, but on the image menu it prompts for x scale factor.

    The customization guide says "Image tile menu macros can perform the same function as other menu macros" but obviously they don't, at least not in the same manner as toolbars or pull downs. Or is that incorrect and that is a limitation of image menus?
    Last edited by sifuentes; 2006-05-17 at 05:58 PM.

  5. #5
    The Silent Type Mike.Perry's Avatar
    Join Date
    2000-11
    Posts
    13,656
    Login to Give a bone
    0

    Default Re: Command macro in Image Menu

    Quote Originally Posted by sifuentes
    The menu is already made and works fine, it is our office block library. I am just trying to find out if we can add more functionality.

    The original menu code reads like this:

    [KEYTAG(DOOR,DOOR)]^C-INSERT;DOOR;;\;\

    and works fine. But when I change it to:

    [KEYTAG(DOOR,DOOR)]^C^C-INSERT;DOOR;ps;(getvar "ltscale");\(getvar "ltscale");;

    the image menu works normally (scale factors default to 1) but doesn't take the ltscale for scale factors. And as stated, trying the macro in toolbars and pull downs work fine. I am missing something? Or lisp can't be used in image menus?

    I also have another question from the original code line: why is the block name followed by two enters? First I tought it was a typo, but all block names are followed by two enters, where they only need one to continue the command. Is there some purpose on that?
    Hi

    Not that I am away of. Only one ";" is required after the Block name. Why someone put two of them ";;" there, I do not know.

    When I associate...

    Code:
    ^C^C-INSERT;TestInsert;ps;(getvar "ltscale");\(getvar "ltscale");;
    with a test Image Tile Menu Label, it works without a problem.

    Therefore is your Image Tile Menu Label correct ie

    Does...

    [KEYTAG(DOOR,DOOR)]

    Correctly correspond with the following format ( taken directly from the AutoCAD Online Help File [F1] )...

    Quote Originally Posted by Overview of Image Tile Menus

    [sldlib(sldname,labeltext)]

    The text labeltext is displayed in the list box, and the slide sldname in the slide library sldlib is displayed as an image.
    Have a good one, Mike

  6. #6
    I could stop if I wanted to
    Join Date
    2003-08
    Location
    Tijuana
    Posts
    225
    Login to Give a bone
    0

    Default Re: Command macro in Image Menu

    Thanks Mike. The slidename and lbltext are correct, and the original menu works fine, it is the new code I am adding that doesn't work, and the problem seems to be somewhere else, which I can't figure out either. Here's the situation:

    We have MENU1 which is our office's standard blocks library and is an image tile menu. It is loaded in all our Autocads, and it works fine. The changes now are because I am trying to add some functionality, so in order to keep the original MENU1, I copied it to a different folder, and renamed the copy MENU2. I add the new folder to the support search path, and leave it at the end of the list. I add the code provided before to a line in MENU2 and load it in Autocad, and keep MENU1 loaded. I try the new code added to MENU2 and it doesn't work, but it works well in toolbars and pop down menus, and Mike Perry confirms it works on an image tile menu.

    What I tried next was this: I added the code to the original MENU1, reload it and voila, the new code is working. I also tried loading MENU2 and unloading MENU1, but when I do that MENU2 doesn't work at all. It doesn't show anything, which is curious because MENU2 is an exact copy of MENU1, the only difference being the new small code added.

    What I need is to have both menus loaded, but one will insert blocks in imperial units drawings, and the other in metric units drawings, using the same blocks from a single library. The reason is that our original block library is drawn in imperial units. We need to use that library for projects to be in metric units. Instead of copying and redefining blocks to be metric, I want to keep a single blocks folder, and scale the blocks adding some code in the menu. This will keep me from renaming a new set of metric blocks too. I will also add some functionality to the imperial menu to insert annotation blocks using the ltscale as scale factor. The metric menu will scale drawing components by 0.0254, and annotation blocks by 0.0254*ltscale.

    So my two remaining questions are:

    Why does MENU1 take precedence when invoking the insertion of a block from MENU2?
    Why is MENU2 rendered useless if I unload MENU1?

    Thanks again,

  7. #7
    The Silent Type Mike.Perry's Avatar
    Join Date
    2000-11
    Posts
    13,656
    Login to Give a bone
    0

    Question Re: Command macro in Image Menu

    Hi

    Does the Image Menu appear without any problem in MENU2 when you invoke it ?

    Is it possible to post MENU1 and MENU2 ( if possible, you could place both in a ZIP file before uploading to the forums ), so we can take a look at the contents of both of them...

    Have a good one, Mike

  8. #8
    I could stop if I wanted to
    Join Date
    2003-08
    Location
    Tijuana
    Posts
    225
    Login to Give a bone
    0

    Default Re: Command macro in Image Menu

    Here they are. 1 STANDARDBLOCKS.mns = MENU1 and 1 STANDARDBLOCKS M.mns = MENU2

    The only line that has been modified in 1 STANDARDBLOCKS M.mns is the one for the DOOR keytag, for which I am providing the slide and dwg. 1 STANDARDBLOCKS.mns is in its original version without the new code.

    Thanks,
    Attached Files Attached Files

  9. #9
    The Silent Type Mike.Perry's Avatar
    Join Date
    2000-11
    Posts
    13,656
    Login to Give a bone
    0

    Default Re: Command macro in Image Menu

    Quote Originally Posted by sifuentes
    Here they are. 1 STANDARDBLOCKS.mns = MENU1 and 1 STANDARDBLOCKS M.mns = MENU2

    The only line that has been modified in 1 STANDARDBLOCKS M.mns is the one for the DOOR keytag, for which I am providing the slide and dwg. 1 STANDARDBLOCKS.mns is in its original version without the new code.
    Hi

    Ok! give the following a try, it works for me at this end...

    Warning, I have only carried out limited testing. I leave it up to yourself too carry-out detailed testing.

    * Open "1 STANDARDBLOCKS M.mns" in a Plain Text Editor eg Notepad.
    * Find and Replace all instances of "Standardblocks" with "StandardblocksM". Make sure you do not end up with an instances of "StandardblocksMM".
    * Exit and Save.
    * Unload "1 STANDARDBLOCKS.mns" from AutoCAD, if need be.
    * Within AutoCAD load "1 STANDARDBLOCKS M.mns".

    Image menus should now function / work without any problem when using "1 STANDARDBLOCKS M.mns".

    Have a good one, Mike

  10. #10
    I could stop if I wanted to
    Join Date
    2003-08
    Location
    Tijuana
    Posts
    225
    Login to Give a bone
    1

    Default Re: Command macro in Image Menu

    Thanks Mike, that solved the problem. Just run some tests and is working. Will start adding things to the menu.

Similar Threads

  1. 2014: Menu Macro
    By Martin Figlarz in forum AutoCAD Customization
    Replies: 2
    Last Post: 2013-10-15, 12:23 PM
  2. 2014: Menu Macro
    By Martin Figlarz in forum AMEP General
    Replies: 2
    Last Post: 2013-10-15, 12:23 PM
  3. Multiple command macro within pulldown menu
    By louis.64641 in forum AutoCAD Customization
    Replies: 2
    Last Post: 2006-04-04, 09:43 PM
  4. Calling an Image Tile Menu from Pull-Down Menu
    By pinckney3 in forum AutoCAD CUI Menus
    Replies: 2
    Last Post: 2006-01-06, 06:42 PM
  5. Layer Snapshot in Command Line or Menu Macro
    By dhallett in forum AutoLISP
    Replies: 4
    Last Post: 2005-05-17, 06:18 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
  •