Author |
Topic Search Topic Options
|
papamoik
Newbie
Joined: 24.Feb.2011
Location: Switzerland
Using: AutoCAD LT 2007
Status: Offline
Points: 5
|
Topic: Makro; Farbe nach Befehl wieder ändern Posted: 24.Feb.2011 at 14:45 |
Hallo zusammen
Ich möchte die Konstruktionslinien in einer anderen Farbe als der Layerfarbe zeichnen. Dazu wechsle ich im Makro die Farbe. Wie kann ich nun aber nach dem Makro die Farbe wieder auf die Layerfarbe wechseln?
mit folgendem Makro funktioniert es nicht, der 2. -farbe Befehl wird einfach ignoriert, da er nach dem Befehlsabruch kommt...
^C^C_-layer;se;0;;-farbe;253;_xline;_-farbe;vonlayer;
Besten Dnak im Voraus
Gruss
papamoik
|
 |
John Connor
Senior Member
Joined: 01.Feb.2011
Location: United States
Using: AutoCAD 2018
Status: Offline
Points: 7175
|
Posted: 24.Feb.2011 at 17:39 |
You have written a macro and it does not assigned the color to the layer that you have called for. Is that correct?
|
"Humans have a strength that cannot be measured. This is John Connor. If you are reading this, you are the resistance."
<<AutoCAD 2015>>
|
 |
papamoik
Newbie
Joined: 24.Feb.2011
Location: Switzerland
Using: AutoCAD LT 2007
Status: Offline
Points: 5
|
Posted: 24.Feb.2011 at 19:13 |
Hi John
I tried to write a macro which does the following steps:
- chang the Layer to Layer 0
- change color to color 253
- start the xline command
- after i have drawn the xline the colour should be set to the color of the actual layer (layer 0 here)
If I don't do this step, the color is set to 253 even when I chenage the layer for a new line...
The last command to change the color back to actual layer doesn't work. Is there a way to implement this command in this macro or do I have to do somesthing else?
Thank you
best regards
Mike
|
 |
John Connor
Senior Member
Joined: 01.Feb.2011
Location: United States
Using: AutoCAD 2018
Status: Offline
Points: 7175
|
Posted: 24.Feb.2011 at 20:01 |
So all you want to do is change the color back to "white" (the original color of layer 0) after you have drawn your Xline using this macro?
|
"Humans have a strength that cannot be measured. This is John Connor. If you are reading this, you are the resistance."
<<AutoCAD 2015>>
|
 |
HAWDesigner
Senior Member
Joined: 04.Aug.2008
Location: United States
Using: AutoCAD R14, AutoCAD 2009, AutoCAD 2010
Status: Offline
Points: 310
|
Posted: 24.Feb.2011 at 20:50 |
If you don't want the color to be 253, then remove it from the steps, no?
|
--
R. Williams
AutoCAD 2010 Certified Professional
<!-- If all else fails hit F1 -->
<<AutoCAD 2009
|
 |
papamoik
Newbie
Joined: 24.Feb.2011
Location: Switzerland
Using: AutoCAD LT 2007
Status: Offline
Points: 5
|
Posted: 24.Feb.2011 at 21:12 |
Hi John
You got it!
This is what I want. I tried it with the command "-farbe; vonLayer" it means the active layer.
Regards
Mike
|
 |
papamoik
Newbie
Joined: 24.Feb.2011
Location: Switzerland
Using: AutoCAD LT 2007
Status: Offline
Points: 5
|
Posted: 24.Feb.2011 at 21:14 |
Hi HAWDesigner
If it was that easy
The construction lines have to be in color 253.
Regards
Mike
|
 |
John Connor
Senior Member
Joined: 01.Feb.2011
Location: United States
Using: AutoCAD 2018
Status: Offline
Points: 7175
|
Posted: 24.Feb.2011 at 21:34 |
Why not create a new layer for your construction lines rather than putting them on layer 0? That should solve your problem.
|
"Humans have a strength that cannot be measured. This is John Connor. If you are reading this, you are the resistance."
<<AutoCAD 2015>>
|
 |
HAWDesigner
Senior Member
Joined: 04.Aug.2008
Location: United States
Using: AutoCAD R14, AutoCAD 2009, AutoCAD 2010
Status: Offline
Points: 310
|
Posted: 24.Feb.2011 at 21:43 |
If you want the color of your construction lines to be 253, then I suggest putting them on a layer with the color dedicated to 253. (As I just realized John also suggested.  ) You cannot change the color of a layer, draw an object on that layer, then expect the objects to remain that color when you change the layer color again. Unless, of course, you hard color the objects, in which case, you're not changing the layer properties, you're changing the object properties.
Edited by HAWDesigner - 24.Feb.2011 at 21:44
|
--
R. Williams
AutoCAD 2010 Certified Professional
<!-- If all else fails hit F1 -->
<<AutoCAD 2009
|
 |
John Connor
Senior Member
Joined: 01.Feb.2011
Location: United States
Using: AutoCAD 2018
Status: Offline
Points: 7175
|
Posted: 24.Feb.2011 at 22:12 |
It is not good practice to override your layer properties like color and linetype. Do what we have suggested.
|
"Humans have a strength that cannot be measured. This is John Connor. If you are reading this, you are the resistance."
<<AutoCAD 2015>>
|
 |