Hi everyone.

I've been trying to automate some of my offices tasks in Autocad LT using tool palettes and macros. We can't afford a subscription for the full version of Autocad so I'm trying to make do with what i have.

I'm relatively new to scripting and I've come across an unusual issue that i can't get my head around. My understanding of macros is that they work in exactly the same way as typing in the commands in sequence on the command line. I've come up with a macro that does exactly what i want when typed in to the command line but when i try to run it as a macro it behaves differently.

The intention of the command is to select all hatches in a drawing received from a client and change them to hatch color 9 (light gray). This is to distinguish them from the linework which plots black.

I understand that there is no command line equivalent for the qselect or filter commands in LT. This makes it impossible (as far as i know) to select the hatches directly. But I've found when using the -hatchedit command in LT2016 (i believe the dash forces command line interface ) the command automatically rejects and unselects non hatch objects and allows you to edit the remaining hatches. For some reason when the command is placed into a macro this behaviour changes. I cannot work out why it changes or if there is another way to edit hatch color for these objects.

The following sequence works perfectly when entered line by line in LT2016

-hatchedit;
all;;
CO;
8;;


However the macro below is unsuccessful.

^C^C-hatchedit;all;;CO;9;;

When turned into a macro on a tool palette the following error occurs: after the return on the ‘all’ command to the selection query a message reads
‘Select hatch object: all
The object is not in current space.
The object is not in current space.
The object is not in current space.
Selected object must be a hatch object or associative hatch block.’
and the command is unsuccessful. Why is this different to typing the command one step at a time? Is there any way to get the command to execute the same way as it does on the command line.

Thank you for your help.