TheSwamp
CAD Forums => CAD General => Topic started by: craigr on August 23, 2012, 10:17:50 AM
-
I want to create a macro to change an EXISTING Rectangle to a width of .02 then change it to an EXISTING Layer called 'RED'.
I can make a macro to change a NEW Rectangle, but cannot make one to work on an Existing Rectangle.
Here is what I have so far - ^C^C_pedit;\w;.02;;change;Previous;;p;la;red;;
It doesn't error out, but all it does is change the Rectangle to .02 width.
I also tried the word 'Last' in place of 'Previous' and it still doesn't work.
Do any of you see what I am missing?
-
It's working for me in MEP 2011.
-
Well!!
I just now closed CAD and opened another file then tried it and it still only does the changing to .02.
I don't get it.
-
when you click on your button and AutoCAD finishes doing what it does... hit F2 and copy and paste into here, everything up to the point where you clicked the button (_pedit).
-
I see that. I use that to trouble shoot macros before. But with the 'Last' in the macro, it doesn't error out.
It's like the macro runs fine, but it doesn't change the Layer.
I've run into problems with the 'Last' and 'Previous' parts before on another macro, a LONG time ago, but don't remember how I solved it. Nor do I remember the macro that I can borrow it from.
-
The layer is called RED (and I'm sure the colour of that layer is red as well), but when you select the rectangle, is the colour set to BYLAYER or to some other colour?
-
Try this Craig:
^C^C_.select;\_.change;_p;;_p;_la;red;;_.pedit;_m;_p;;_w;0.02;;
-
MDub, the color is ByLayer. At the end of my Review Process, I set everything in the Dwg to Bylayer Color thru a Batch Routine. So, If I want something to stay Red, I put it on a Layer called RED.
Lee Mac - Thanks for the Macro, it is ALMOST perfect for me. The only thing I would like to get rid of is having to right-click after I select the Rectangle. Like in the following OLD Macro that I have -
*^C^C_snap;off;Change;\;p;c;Red;;
I don't understand what the ' . ' is in your macro, what is it for?
-
Lee Mac - Thanks for the Macro, it is ALMOST perfect for me. The only thing I would like to get rid of is having to right-click after I select the Rectangle.
You're welcome Craig :-)
The macro I posted previously allows you to change multiple polylines via a window selection, but if you are instead looking for a single pick selection, try:
^C^C_.change;\;_p;_la;red;;_.pedit;_m;_p;;_w;0.02;;
I don't understand what the ' . ' is in your macro, what is it for?
The point "." prefix ensures that the standard version of a command is used and not a possible redefinition of the command.
-
Ding, Ding, Ding!!!
That's perfect! Thanks alot for doing this for me.
I'll buy you a donut next time you are in Omaha, NE
craigr
-
I'll buy you a donut next time you are in Omaha, NE
I look forward to it :lol:
Will you also pay for my flight across the pond? :evil:
-
I always love the way you folks call it a 'Pond'.
Being in the Middle of the U.S., to ME it's an OCEAN!!
:)
Where are you over there?
-
I always love the way you folks call it a 'Pond'.
Being in the Middle of the U.S., to ME it's an OCEAN!!
:)
:-D
Where are you over there?
I'm based on the outskirts of London, England :-)
-
Isn't this Internet thingy GREAT!!
I'm soooo Glad that Al Gore invented it!!!
:)