Beginner Help: Simple XRef Macro

Beginner Help: Simple XRef Macro

Anonymous
Not applicable
883 Views
6 Replies
Message 1 of 7

Beginner Help: Simple XRef Macro

Anonymous
Not applicable

Hi guys,

 

I'm sure this has been answered elsewhere so apologies! Just trying to create a simple custom command macro to purge all, audit and correct errors, turn all layers on/thaw/unlock, set all objects to by layer and set all layers' colour to 252 and run the overkill command on all. Any help would be much appreciated, I'm pretty new to CAD generally and particularly macros etc.

 

Cheers! Smiley Happy

0 Likes
884 Views
6 Replies
Replies (6)
Message 2 of 7

Alfred.NESWADBA
Consultant
Consultant

Hi,

 

>> Just trying to create a simple custom command macro to

Where are you at the moment?

You can create a SCR-file (script file) and type in the commands 1:1 as they would have been typed into the command line.

Only additional info: a lot of commands can be started with a leading dash ( -LAYER ) so the dialog will not startup, the command asks then all options in the command-line.

 

For now: how far did you come with your script or what is the next step you try to go but need support?

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2026
------------------------------------------------------------------------------------

(not an Autodesk consultant)
0 Likes
Message 3 of 7

Anonymous
Not applicable

Thanks for the reply, what I've got is this:

 

^C^C-PURGE;A;*;N;AUDIT;YES;SETBYLAYER;ALL;S; ;Y;Y;OVERKILL;ALL; ;

 

May well be completely wrong, it seems to run the commands as I'd want, but brings the dialogue boxes for SETBYLAYER & OVERKILL, any way around that?

 

Also as far as changing all layers colour to 252 and unlocking/thawing/turning on, preferable before the SETBYLAYER kicks in, I have no clue.

 

Cheers

0 Likes
Message 4 of 7

Alfred.NESWADBA
Consultant
Consultant

Hi,

 

>> but brings the dialogue boxes for SETBYLAYER

It does not bring up a dialog for command SETBYLAYER for me, how does that dialog look like (screenshot)?

 

>> but brings the dialogue boxes for [...] OVERKILL

As written before, start command with a leading dash to avoid dialog, so in this case use

-OVERKILL

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2026
------------------------------------------------------------------------------------

(not an Autodesk consultant)
0 Likes
Message 5 of 7

Anonymous
Not applicable

Apologies, I'd been changing a few things before replying to you.

 

Ok so this is what I have:

 

^C^CEXPLODE;ALL; ;-PURGE;A;*;N;AUDIT;YES;SETBYLAYER;ALL;S; ;Y;Y; ;-OVERKILL;ALL; ;

 

This is what brings up the setbylayer dialogue box and prompts me to press "OK", the dash preceeding OVERKILL has helped, thanks!

 

I've attached the dialogue box I'm talking about.

 

 

0 Likes
Message 6 of 7

Alfred.NESWADBA
Consultant
Consultant

Hi,

 

ahh ok, it's not the command itself, it's the settings-dialog for the command.

So the option is not to start option "SETTINGS" within the command. To avoid that you can first set the sysvar SETBYLAYERMODE to the value you need, then start the command .. and so the settings are predefined.

Look to the >>>help<<< to see the details for the sysvar.

 

HTH, - alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2026
------------------------------------------------------------------------------------

(not an Autodesk consultant)
0 Likes
Message 7 of 7

cadwomen
Collaborator
Collaborator

..... thx for charing your Email Box Smiley Embarassed

 

cw

If my post answers your question, please mark it as an Accepted Solution, so that others can find answers quickly!
0 Likes