
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.
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: 25.Feb.2011 at 07:35 |
Good morning everyone
Thank you for your suggestions.
I think I create a new layer for my construction lines as mentiond from John and HAWDesigner.
CarlB: your solution works for one time, second time it stops underway. But it gives me an idea of commands in macros.
|
 |
CarlB
Senior Member
Joined: 16.Oct.2009
Location: United States
Status: Offline
Points: 321
|
Posted: 24.Feb.2011 at 23:06 |
l'll give a suggestion for what you'd like to do and let others advise you what's "proper".
After the "xline" command, you need 2 pauses (backslashes) for the 2 pick points, then an enter to end it. So something like:
^C^C_-layer;se;0;;-farbe;253;_xline;\\;_-farbe;vonlayer;
|
 |
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>>
|
 |
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 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>>
|
 |
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
|
 |
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
|
 |
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
|
 |
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>>
|
 |
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
|
 |