Results 1 to 6 of 6

Thread: Macro to Create an AECpolygon with Masking Style, Retain Original Polygon, then Send all to Front

  1. #1
    Member
    Join Date
    2013-12
    Posts
    5
    Login to Give a bone
    0

    Default Macro to Create an AECpolygon with Masking Style, Retain Original Polygon, then Send all to Front

    OK - so I realize that this is a question regarding an AutoCAD Macro and not a LISP routine, but I couldn't find a better place for this question. Is there a dedicated subforum for macros?

    What I'm trying to accomplish is set a keyboard shortcut for a string of commands. In my office we use AECpolygons with a masking style instead of wipeouts because of the weird issue where wipeouts print as black boxes. So what I've done is write a macro that:

    1. Converts a closed polygon into an AECpolygon, retaining original geometry
    2. Sets the style of the polygon to "mask"
    3. Changes the display color to 255 so that it prints invisibly
    4. Sends the masking poly behind the source polygon

    Here is my code:
    Code:
    aecpolygonconvert;;n;-aecpolygonmodify;p;
    s;mask;;draworder;p;;b;change;p;;properties;c;255;;
    This is all fine and dandy, but in an ideal world I want two more features:

    1. Both the source polygon and masking polygon come out on the top of the draw order
    2. The source polygon and masking polygon are joined together in an unnamed group

    I realize that what I'm trying to accomplish here is quite possibly beyond the scope of what macros can accomplish and I would be better off with a LISP routine or something else. Unfortunately, the CAD standards guru of my office is highly suspicious of scripts and has instructed me to limit my tinkering to macros.

    What's kinda awkward is that AutoCAD has a hard time independently keeping track of two objects in the command line at the same time. There is some potential by differentiating between the "last" parameter and the "previous" parameter. Unfortunately, I can only keep these two separate for one command, because as soon as I select something with "last" it becomes the last selected object and is both "last" and "previous" in my next step. So I thought maybe I can throw my source polygon into a named group "1", then ungroup it at the end so that I can reuse the macro multiple times on the same drawing. For some reason I can't get this to work, when I try making a macro to do this, it's getting hung up somewhere and I can't figure out why:

    Code:
    ^C^C_group;create;1;
    ;draworder;group;1;;f;
    Am I being insane with my ambition here? Should I give up and accept my beta version macro as the best I can get, or is there another angle I can hit this from? Any help would be awesome.

  2. #2
    Administrator Opie's Avatar
    Join Date
    2002-01
    Location
    jUSt Here (a lot)
    Posts
    9,106
    Login to Give a bone
    0

    Default Re: Macro to Create an AECpolygon with Masking Style, Retain Original Polygon, then Send all to Front

    Typically, most discussions regarding AutoCAD Macros are posted in the AutoCAD Customization forum.

    AutoLISP could assist this macro. It could also assist the CAD standards guru to make CAD standards a no-brainer. Executing a properly designed macro / autolisp/ .NET function can place the necessary elements on the desired layers / styles.

    Since you are using aec commands, AutoLISP should be available on other machines within your office. You could save and restore selection sets for use within your macros.
    If you have a technical question, please find the appropriate forum and ask it there.
    You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
    jUSt

  3. #3
    Member
    Join Date
    2013-12
    Posts
    5
    Login to Give a bone
    0

    Default Re: Macro to Create an AECpolygon with Masking Style, Retain Original Polygon, then Send all to Front

    Thanks for the reply. I'll cross post this thread over there.

    AutoLISP definitely is the way to go, but unfortunately I don't have a heck of a lot of say in the matter. Maybe this will change in my office someday but in the meantime I'm looking for the next best solution.

  4. #4
    Administrator Opie's Avatar
    Join Date
    2002-01
    Location
    jUSt Here (a lot)
    Posts
    9,106
    Login to Give a bone
    0

    Default Re: Macro to Create an AECpolygon with Masking Style, Retain Original Polygon, then Send all to Front

    Please read the AUGI Forum Guidelines before cross posting again. We try to keep the discussion in one thread instead of multiple threads. We can move discussions around the forums as needed, you just need to ask.
    If you have a technical question, please find the appropriate forum and ask it there.
    You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
    jUSt

  5. #5
    Administrator Opie's Avatar
    Join Date
    2002-01
    Location
    jUSt Here (a lot)
    Posts
    9,106
    Login to Give a bone
    0

    Default Re: Macro to Create an AECpolygon with Masking Style, Retain Original Polygon, then Send all to Front

    What I was saying with your macro, you could create snippets of AutoLISP to store selection sets in variable names, which can be recalled later in the macro.

    Also, have you looked at using the Action Recorder?
    If you have a technical question, please find the appropriate forum and ask it there.
    You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
    jUSt

  6. #6
    Member
    Join Date
    2013-12
    Posts
    5
    Login to Give a bone
    0

    Default Re: Macro to Create an AECpolygon with Masking Style, Retain Original Polygon, then Send all to Front

    Oops, my bad. Thanks for moving the thread.

    It would be great if I could write a LISP routine to create selection sets. LISP use is not allowed in my office however.

    I tried using the action recorder on a much earlier version of this idea without a whole lot of success - it seems buggy to me. Maybe I just need to spend more time figuring out how it works. Just now it was not completing all the steps in the action macro under certain conditions but returning no errors...a temperamental macro is not a great solution when the idea is to distribute it to my office and just say "go".

Similar Threads

  1. Multiple "send to back" and "bring to front"
    By Wish List System in forum Revit Architecture - Wish List
    Replies: 4
    Last Post: 2015-10-31, 12:19 PM
  2. 2015: Linked CAD In Front - obscuring model - can i send behind?
    By jkedward365745 in forum Revit - Platform
    Replies: 1
    Last Post: 2014-07-01, 03:30 AM
  3. Send Behind/ In Front of Element
    By Limbatus in forum Revit - Platform
    Replies: 4
    Last Post: 2010-07-27, 08:27 AM
  4. Stretch a Polygon/Maintain the Original Area of Polygon
    By autocad.wishlist1734 in forum AutoCAD Wish List
    Replies: 0
    Last Post: 2007-08-02, 04:39 PM
  5. Bring to front/send to back??
    By Kelly@Laebon in forum Revit Architecture - General
    Replies: 4
    Last Post: 2004-04-30, 10:46 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
  •