CAD Forum - tips, tricks, discussion and utilities for AutoCAD, Inventor, Revit and other Autodesk products [www.cadforum.cz] ARKANCE | CONTACT - CZ | SK | EN | DE
Over 1.092.000 registered users (EN+CZ). AutoCAD tips, Inventor tips, Revit tips. Try the new precise Engineering calculator. New AutoCAD 2026 commands and variables.
RSS channel - CAD tips RSS tips
RSS discussions

Discussion Discussion forum

?
CAD discussions, advices, exchange of experience

CAD Forum - Homepage CAD discussion forum - ask any CAD-related questions here, share your CAD knowledge on AutoCAD, Inventor, Revit and other Autodesk software with your peers from all over the world. To start a new topic, choose an appropriate forum.

Please abide by the rules of this forum.
This is a peer-to-peer forum. The forum doesn't replace the official direct technical support provided by ARKANCE for its customers.
How to post questions: register or login, go to the specific forum and click the NEW TOPIC button.
  FAQ FAQ  Forum Search Search  Events Events  Register Register  Login Login

Topic ClosedMakro; Farbe nach Befehl wieder ändern

 Post Reply Post Reply Page  12>
Author
papamoik View Drop Down
Newbie
Newbie


Joined: 24.Feb.2011
Location: Switzerland
Using: AutoCAD LT 2007
Status: Offline
Points: 5
Direct Link To This Post 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
Back to Top
John Connor View Drop Down
Senior Member
Senior Member


Joined: 01.Feb.2011
Location: United States
Using: AutoCAD 2018
Status: Offline
Points: 7175
Direct Link To This Post 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>>

Back to Top
papamoik View Drop Down
Newbie
Newbie


Joined: 24.Feb.2011
Location: Switzerland
Using: AutoCAD LT 2007
Status: Offline
Points: 5
Direct Link To This Post 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
Back to Top
John Connor View Drop Down
Senior Member
Senior Member


Joined: 01.Feb.2011
Location: United States
Using: AutoCAD 2018
Status: Offline
Points: 7175
Direct Link To This Post 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>>

Back to Top
HAWDesigner View Drop Down
Senior Member
Senior Member


Joined: 04.Aug.2008
Location: United States
Using: AutoCAD R14, AutoCAD 2009, AutoCAD 2010
Status: Offline
Points: 310
Direct Link To This Post 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
Back to Top
papamoik View Drop Down
Newbie
Newbie


Joined: 24.Feb.2011
Location: Switzerland
Using: AutoCAD LT 2007
Status: Offline
Points: 5
Direct Link To This Post 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
Back to Top
papamoik View Drop Down
Newbie
Newbie


Joined: 24.Feb.2011
Location: Switzerland
Using: AutoCAD LT 2007
Status: Offline
Points: 5
Direct Link To This Post Posted: 24.Feb.2011 at 21:14
Hi HAWDesigner
 
If it was that easy Confused 
 
The construction lines have to be in color 253.
 
Regards
 
Mike
Back to Top
John Connor View Drop Down
Senior Member
Senior Member


Joined: 01.Feb.2011
Location: United States
Using: AutoCAD 2018
Status: Offline
Points: 7175
Direct Link To This Post 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>>

Back to Top
HAWDesigner View Drop Down
Senior Member
Senior Member


Joined: 04.Aug.2008
Location: United States
Using: AutoCAD R14, AutoCAD 2009, AutoCAD 2010
Status: Offline
Points: 310
Direct Link To This Post 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. Wink)

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
Back to Top
John Connor View Drop Down
Senior Member
Senior Member


Joined: 01.Feb.2011
Location: United States
Using: AutoCAD 2018
Status: Offline
Points: 7175
Direct Link To This Post 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>>

Back to Top

Related CAD tips:


 Post Reply Post Reply Page  12>
  Share Topic   

Forum Jump Forum Permissions View Drop Down



This page was generated in 0,238 seconds.