Launch "-layer" command in CUI macro...

Jerry_Barnes
Advocate
Advocate

Launch "-layer" command in CUI macro...

Jerry_Barnes
Advocate
Advocate

I want to create a toolbar macro that creates a new layer called "_xref", makes it current, then launches the XATTACH command. Problem is, I can't get past the Layer command stopping the macro at the command line (or a dialog box) asking what, exactly, I want to do. (e.g. Make, Set, New, etc.). The stoppage essentially kills the purpose of the macro.

Any ideas? Thanks. 

0 Likes
Reply
Accepted solutions (1)
330 Views
3 Replies
Replies (3)

tcorey
Mentor
Mentor
Accepted solution

^C^C(command "-Layer" "M" "_Xref" "");^C^CXattach;



Tim Corey
MicroCAD Training and Consulting, Inc.
Redding, CA
Autodesk Gold Reseller

New knowledge is the most valuable commodity on earth. -- Kurt Vonnegut

cwr-pae
Mentor
Mentor

If you are using version 2018 and later you can use the system variable xreflayer to set a layer name for xrefs to be placed on automatically. Even if not present in the drawing it wail be created when an xref is attached.

 

A variation of @tcorey's macro is: ^C^C-layer;n;xref;c;150;xref;;clayer;xref;xattach;

which creates the layer xref, changes the color to 150, makes the layer current and start the xattach command.

 

 

0 Likes

Jerry_Barnes
Advocate
Advocate

Thanks, Tim. As usual, U Da Man!

0 Likes