Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: playing with macros

  1. #1
    Member
    Join Date
    2005-09
    Location
    Winnipeg, Manitoba Canada
    Posts
    19

    Default playing with macros

    Trying to create a custom button that will preform the following with one click
    -purge all, then zoom extent,save, turn layer to 0.

  2. #2
    I could stop if I wanted to clshade's Avatar
    Join Date
    2009-01
    Location
    B5
    Posts
    478

    Default Re: playing with macros

    Can you type what you want from the Command line and have it do what you need?
    If so then the keystrokes can be made a Macro.

    ^C^C-Purge;All;*;No;Zoom;Extents;LA;Set;0;;
    or
    ^C^C-Purge;A;*;N;Z;E;LA;S;0;;
    Charles Shade LT 2013
    www.cshadedesign.com

  3. #3
    Moderator BlackBox's Avatar
    Join Date
    2009-11
    Posts
    2,499

    Default Re: playing with macros

    Quote Originally Posted by clshade View Post
    Can you type what you want from the Command line and have it do what you need?
    If so then the keystrokes can be made a Macro.

    ^C^C-Purge;All;*;No;Zoom;Extents;LA;Set;0;;
    or
    ^C^C-Purge;A;*;N;Z;E;LA;S;0;;
    If memory serves, LA is the built-in keyboard shortcut for the LAYER Command, and not the -LAYER Command as is needed for this particular macro.

    Also, as I need for my customizations to support multiple versions, I tend to 'spell out' the command options to avoid issues as discussed here.

    HTH
    "Potential has a shelf life." - Margaret Atwood

  4. #4
    I could stop if I wanted to clshade's Avatar
    Join Date
    2009-01
    Location
    B5
    Posts
    478

    Default Re: playing with macros

    Worked here
    Charles Shade LT 2013
    www.cshadedesign.com

  5. #5
    Moderator BlackBox's Avatar
    Join Date
    2009-11
    Posts
    2,499

    Default Re: playing with macros

    Quote Originally Posted by clshade View Post
    Worked here
    ... That's my point.

    Instead of only working for you, and anyone whom already has their PGP define LA as the -LAYER Command, etc. perhaps it would be prudent to post a macro that specifies the ._-LAYER Command. My $0.02

  6. #6
    I could stop if I wanted to clshade's Avatar
    Join Date
    2009-01
    Location
    B5
    Posts
    478

    Default Re: playing with macros

    I thought that LA was the common OOTB alias for Layer?
    I've never changed the pgp or any alias's for that matter.

    Though I think your input is worth at least a nickle maybe $0.06
    Charles Shade LT 2013
    www.cshadedesign.com

  7. #7
    Moderator BlackBox's Avatar
    Join Date
    2009-11
    Posts
    2,499

    Default Re: playing with macros

    Quote Originally Posted by clshade View Post
    I thought that LA was the common OOTB alias for Layer?
    I've never changed the pgp or any alias's for that matter.
    Perhaps I was unclear....

    OOTB the LA keyboard shortcut invokes the LAYER Command (the dialog version), and not the -LAYER Command (the command line version).

    If one user has LA defined OOTB (i.e., the LAYER Command), and another has LA defined (either by acad.pgp, LISP, CUIx, etc.) as the -LAYER Command, then the same macro will yield different results.

    Also worthy of note, is that one's LAYERDLGMODE System Variable setting may also yield difference results.

    By explicitly specifying -LAYER within the macro, you achieve standardization, without being affected by the user's customizations... Not that you have to, it's just a good way of avoiding potential complications (win-win).

    Were I to incorporate a similar macro in our setup, I'd have used:

    pseudo macro:
    Code:
    ^C^C._-purge all * no ._zoom extents ._-layer set 0
    ... Or, my preference is to use LISP for it's *error* handling, but this request is for someone using LT, so I digress.

    Also, for those that have full versions (i.e., LISP enabled), you might consider using SETVAR in lieu of the -LAYER Command:

    Code:
    (setvar 'clayer "0")
    Quote Originally Posted by clshade View Post
    Though I think your input is worth at least a nickle maybe $0.06
    That is very kind of you to say, clshade.
    "Potential has a shelf life." - Margaret Atwood

  8. #8
    I could stop if I wanted to clshade's Avatar
    Join Date
    2009-01
    Location
    B5
    Posts
    478

    Default Re: playing with macros

    Yep, way beyond the details I've ever gotten into.
    I've never been too sure about starting (using) the Command with ._- I know this helps translate the Macro for other languages but that is about it.

    Excellent information for more than just a passing shot at this Macro

    Now that I've used it I think I'll add it to my setup.
    I do tend to finish drawings this way and it sure is simple.
    Need to add OVERKILL (LT 2013) and AUDIT to it
    OVERKILL-AUDIT-PURGE
    Last edited by clshade; 2012-08-22 at 05:28 PM.
    Charles Shade LT 2013
    www.cshadedesign.com

  9. #9
    100 Club pendean's Avatar
    Join Date
    2001-12
    Location
    Dallas, TX
    Posts
    175

    Default Re: playing with macros

    If we want to write Macros correctly, we should all go all the way instead of partially correcting each other:
    ^C^C._-purge;_all;*;_no;._-purge;_regapps;*;_no;._zoom;_extents;._-layer;_set;0;;

    Leaving blanks for <enter> is never good coding 'best' practice IMHO.
    --
    Dean Saadallah
    http://LTisACAD.blogspot.com
    --

  10. #10
    Certified AUGI Addict jaberwok's Avatar
    Join Date
    2000-12
    Location
    0,0,0 The Origin
    Posts
    8,060

    Default Re: playing with macros

    Quote Originally Posted by pendean View Post
    If we want to write Macros correctly, we should all go all the way instead of partially correcting each other:
    ^C^C._-purge;_all;*;_no;._-purge;_regapps;*;_no;._zoom;_extents;._-layer;_set;0;;

    Leaving blanks for <enter> is never good coding 'best' practice IMHO.
    + 1
    John B

    "With or without religion, you would have good people doing good things and evil people doing evil things. But for good people to do evil things, that takes religion." - Steven Weinberg.

Page 1 of 2 12 LastLast

Similar Threads

  1. Just Playing Around with Lights
    By SCShell in forum Revit - Rendering
    Replies: 0
    Last Post: 2009-03-25, 07:09 PM
  2. Just Playing with the Alpha
    By SCShell in forum Revit - Gallery
    Replies: 4
    Last Post: 2009-02-25, 10:22 PM
  3. Just playing
    By sjsl in forum Revit - Gallery
    Replies: 1
    Last Post: 2008-03-07, 12:42 PM
  4. WIP just playing.
    By Gene Herring in forum Revit - Gallery
    Replies: 2
    Last Post: 2006-04-02, 04:31 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •