See the top rated post in this thread. Click here

Results 1 to 8 of 8

Thread: AutoCAD and AutoCAD LT - Diesel in a MODEMACRO menu item

  1. #1
    Member Alistair0610's Avatar
    Join Date
    2002-07
    Location
    Abu Dhabi, UAE
    Posts
    30
    Login to Give a bone
    0

    Question AutoCAD and AutoCAD LT - Diesel in a MODEMACRO menu item

    I'm having a few problems with DIESEL while creating a series of buttons for setting the MODEMACRO to read the DIMSCALE variable. Perhaps a DIESEL boffin out there will point me in the right direction. I'm sure it's simply a case of additional quotes or something.

    Because I have to support many LT licences as well as full AutoCAD, I'm resorting to using DIESEL within a menu button for this particular function. All the button does is set the current LTSCALE and DIMSCALE to a particular scale. I want this scale to also be displayed as a MODEMACRO on the staus bar.

    What I have currently is: -
    ^C^C^Pdimscale;50;ltscale;50;modemacro Annot 1:$M=$(getvar,dimscale);

    This works, but evaluates the MODEMACRO to 'Annot 1:50', whereas I want it to evaluate it to 'Annot 1:$(getvar,dimscale)', so that it will update automatically if the DIMSCALE variable is changed. It does do this if 'modemacro Annot 1:$M=$(getvar,dimscale)' is entered in on the command line.

    For full AutoCAD I can easily add: -
    (command "modemacro" "Annot 1:$(getvar,dimscale)")
    to my acad.lsp, and omit it from the menu's, but this option isn't avalaible for LT.

    Any suggestions?

    Regards
    Alistair (not a DIESEL fan!)
    Last edited by Alistair0610; 2007-05-02 at 08:44 AM.

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

    Default Re: AutoCAD and AutoCAD LT - Diesel in a MODEMACRO menu item

    Quote Originally Posted by alistair.clark.34853
    [ SNIP ]

    What I have currently is: -
    ^C^C^Pdimscale;50;ltscale;50;modemacro Annot 1:$M=$(getvar,dimscale);

    [ SNIP ]
    Hi

    The above appears to work ok! for me, when tested in AutoCAD 2008.

    Initially I see the following in the user-defined area of the AutoCAD Status Line...

    Annot 1:50

    I then update the DimScale value via whatever means.

    The text value shown for ModeMacro updates accordingly eg

    Annot 1:10

    Annot 1:20

    Annot 1:100

    etc

    Have a good one, Mike

  3. #3
    All AUGI, all the time zoomharis's Avatar
    Join Date
    2005-02
    Location
    Abu Dhabi (Native-India)
    Posts
    506
    Login to Give a bone
    0

    Default Re: AutoCAD and AutoCAD LT - Diesel in a MODEMACRO menu item

    Quote Originally Posted by Mike.Perry
    Hi

    The above appears to work ok! for me, when tested in AutoCAD 2008.

    Initially I see the following in the user-defined area of the AutoCAD Status Line...

    Annot 1:50

    I then update the DimScale value via whatever means.

    The text value shown for ModeMacro updates accordingly eg

    Annot 1:10

    Annot 1:20

    Annot 1:100

    etc

    Have a good one, Mike
    Mike, How did you try that macro? From a command button?

  4. #4
    Member Alistair0610's Avatar
    Join Date
    2002-07
    Location
    Abu Dhabi, UAE
    Posts
    30
    Login to Give a bone
    0

    Question Re: AutoCAD and AutoCAD LT - Diesel in a MODEMACRO menu item

    Thanks for testing it Mike. I'm still on 2007 and It does work as you described from the command line, but not when assigned to a button. We should be upgrading to 2008 fairly soon.

    Cheers
    Alistair

  5. #5
    All AUGI, all the time zoomharis's Avatar
    Join Date
    2005-02
    Location
    Abu Dhabi (Native-India)
    Posts
    506
    Login to Give a bone
    0

    Default Re: AutoCAD and AutoCAD LT - Diesel in a MODEMACRO menu item

    The reason for your macro not working from the button is the presence of control charecter ($ sign) inside the string you wish to supply to the MODEMACRO prompt. I have seen some where Robert Bell suggesting the lisp equivalent (chr 36) instead of directly supplying the $ sign. But it will not work with LT as it doesn't support LISP. Please note that he suggested it on another context (Inserting a block having '$' inside the name using DIESEL macro). In your case it may act differently. By the way, good to see it's working well on 2008. I am really surprised to see that.

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

    Default Re: AutoCAD and AutoCAD LT - Diesel in a MODEMACRO menu item

    Quote Originally Posted by alistair.clark.34853
    Thanks for testing it Mike. I'm still on 2007 and It does work as you described from the command line, but not when assigned to a button. We should be upgrading to 2008 fairly soon.

    Cheers
    Alistair
    Hi Alistair

    my bad, I did not not test properly... I am now getting the same results as yourself.

    Below is one possible workaround (I have tested it properly this time and it works for me at this end)...

    Script file:
    Code:
    DimScale
    50
    LTScale
    50
    _.ModeMacro
    Annot 1:$(getvar,DimScale)
    [ Blank line ]
    Load (and run) the above Script file via a Toolbar button.

    You should now receive the same results as I documented earlier...

    Initially I see the following in the user-defined area of the AutoCAD Status Line...

    Annot 1:50

    I then update the DimScale value via whatever means.

    The text value shown for ModeMacro updates accordingly eg

    Annot 1:10

    Annot 1:20

    Annot 1:100

    etc


    Apologies for any confusion brought about by my previous slip-up.

    Mike
    Last edited by Mike.Perry; 2007-05-10 at 03:32 AM. Reason: Amended poor grammar.

  7. #7
    Member Alistair0610's Avatar
    Join Date
    2002-07
    Location
    Abu Dhabi, UAE
    Posts
    30
    Login to Give a bone
    1

    Thumbs up Re: AutoCAD and AutoCAD LT - Diesel in a MODEMACRO menu item

    Mike

    As always, you come up trumps! Thanks for that! I've set up buttons for the various scales and they all call on one script to set up the modemacro. Thanks too to zoomharis.

    [fyi, Ralph Grabowski made some suggestions about using quotes and the $M construct, but I couldn't get any of these to work. http://www.upfrontezine.com/tailor/tailor17.htm]

    Cheers
    Alistair
    Last edited by Mike.Perry; 2007-05-10 at 03:27 AM. Reason: Fix link.

  8. #8
    100 Club
    Join Date
    2004-10
    Location
    Scotland
    Posts
    102
    Login to Give a bone
    0

    Default Re: AutoCAD and AutoCAD LT - Diesel in a MODEMACRO menu item

    Alistair,
    For LT 2005, I've set up the AutoCAD icon to load the script while starting by using the /b switch -
    "C:\...\AutoCAD LT 2005\aclt.exe" /b "T:\...\start.scr"

    In the start.scr text file, I have a few settings; for mode macro, the line I have is as follows -
    MODEMACRO $(edtime,$(getvar,date),H:MM) | Txt H=$(/,$(getvar,textsize),$(getvar,celtscale))mm @ 1:$(getvar,celtscale)

    The time part is a bit wayward, as it only gets updated when regening, etc.
    The other settings add a default hatch style & size, distance between lines of text.
    The downside of loading a script at startup is that the blank drawing which loads always asks whether it is to be saved when loading.

Similar Threads

  1. AutoCAD Electrical type Icon Menu in AutoCAD Vanilla !
    By iqbal.ahmad in forum AutoCAD General
    Replies: 1
    Last Post: 2009-04-15, 05:33 AM
  2. How to write new menu file or update the existing menu in AutoCAD 2006
    By Partha Ghosh in forum CAD Management - General
    Replies: 1
    Last Post: 2007-09-30, 01:45 PM
  3. Transfer Image menu from AutoCAD 2004 to AutoCAD 2006
    By aficks in forum AutoCAD CUI Menus
    Replies: 2
    Last Post: 2007-01-25, 05:43 PM
  4. Using ModeMacro - Diesel precision display issue
    By fletch97 in forum AutoLISP
    Replies: 2
    Last Post: 2006-02-02, 06:38 PM
  5. AutoCAD 2000i LT Coustom Menu into AutoCAD 2004 LT
    By Ms. Serene in forum AutoCAD Customization
    Replies: 3
    Last Post: 2005-06-14, 04:02 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
  •