PDA

View Full Version : Macro Help



eitreb
29-01-2009, 12:11 PM
Hi,

I'm trying to write a macro so that I can set a layer then set the dimscale then dimstyle and the finally a linear dim command.

However the dimtyle i require to use has spaces in which in cad are presumed as the enter key. I hope someone can help me with this. I show below the dimstyle name and macro command i have written so far. I've also tried putting it in " " marks but that doesn't work.

2-5 TEXT - SCALE 5(mm)

^C^C-LAYER;SET;S060_D_X_DIMS;;-DIMSTYLE;RESTORE;2-5 TEXT - SCALE 5(mm);DIMSCALE;5;DIMLINEAR;\\\

Cheers

Paul

CarLB
29-01-2009, 07:02 PM
I see you posted this in a few other forums, if you get it figured out please post back :)

As has been mentioned:
-change stylename to exclude space
-put quotes areound name (apparently doesn't work)

Some other guesses:
-use double quotes:
""name with spaces""

-set the name to a system variable, use diesel to retrieve it:
^C^CSETVAR;USERS1;2-5 TEXT - SCALE 5(mm);-LAYER;SET;S060_D_X_DIMS;;-DIMSTYLE;RESTORE;$M=$(getvar,USERS1);DIMSCALE;5;DI MLINEAR;\\\

eitreb
30-01-2009, 09:09 AM
Thanks Carl,

I have tried the double quotes without luck. I have also tried replacing the spaces with _ but again it doesn't seem to work.

I'm not quite sure what you mean by setting the name to a system variable and then using diesel to retrieve it?

Hope you can expand on that a little.

Thanks for your help it's much appreciated.

Exxit
30-01-2009, 11:02 AM
eitreb,
you have to change the spaces in your dimstyle!

My tip: Do not use command macros, use your Tool Palette...

Lothar

eitreb
30-01-2009, 11:08 AM
Thanks for that, looks like i will just have to use the tool pallette.

The only reason I was trying to use the macro was to allow speed of selecting dim & text styles as the company i work for have in excess of 100 different styles and would have just speeded up the process.

Thanks for everyones help

CarLB
30-01-2009, 06:01 PM
I'm not quite sure what you mean by setting the name to a system variable and then using diesel to retrieve it?

I did elaborate, in macro language, right after that:


^C^CSETVAR;USERS1;2-5 TEXT - SCALE 5(mm);-LAYER;SET;S060_D_X_DIMS;;-DIMSTYLE;RESTORE;$M=$(getvar,USERS1);DIMSCALE;5;DI MLINEAR;\\\