DesignCAD 3D Max 2027 box
Now available

DesignCAD 2027

Hatches that follow their boundaries, an on-screen dial to turn your model, and a way to find any command by name, in a clean Windows 11 look.

Can't see layer color detail

Started by MarkX, November 08, 2011, 01:24:11 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

MarkX

If you assign several different colors to layers in your drawing, and then go back to look at the previously assigned color, the dialog does not show you the assigned color. Instead it shows some arbitrary or previously used color. This means you can't go back and find out the exact RGB of any particular layer color. You would want to do this, for instance, if you created a new layer and wanted it to be the same exact color as a previous layer. (v21)

Thanks,
Mark

Pearco

MarkX;

I don't see any way to do that, but I think you have a good suggestion. Maybe Dempsey can add it to the next version wish list.
Jim
User since ProDesign 1.5

Lar

MarkX,

I'm not sure which dialog box you are referring to but you can view the colors assigned to layers via the Layer dialog (L key) or with the Layer Toolbox. To investigate a layer's color open the layer dialog and click the color square by the layer-names area or the color rectangle right of 'assign color' (below the 'name' field). A standard color dialog box will open with, among other stuff, the r, g and b values next to the big color square.

In fact, this is the only way to assign colors to layers (other than via basiccad macros) so I don't understand how you assigned colors without being aware of this.

Lar

MarkX

Hi Lar,
Quote from: Lar on November 08, 2011, 06:17:22 PM
I'm not sure which dialog box you are referring to but you can view the colors assigned to layers via the Layer dialog (L key) or with the Layer Toolbox. To investigate a layer's color open the layer dialog and click the color square by the layer-names area or the color rectangle right of 'assign color' (below the 'name' field). A standard color dialog box will open with, among other stuff, the r, g and b values next to the big color square.

In fact, this is the only way to assign colors to layers (other than via basiccad macros) so I don't understand how you assigned colors without being aware of this.
Yes, you can pick a new color, but it won't show you the value of the current color. If you click on the color square what it brings up is NOT the value of the current layer color (unless the current layer color is that same as that of the default), but some default or previously selected color. To understand the problem, assign a different color to 3 layers and then try re-visiting each color square. When the color dialog comes up, it will pre-select some other color rather than the current color. This means that you can't determine the RGB value of the color in order to recreate it, use it in a different drawing, create a coordinated layer set, etc.

Thanks!
Mark 

Dr PR

Mark,

I agree, this is an oversight (a polite way of saying bug!).

DesignCAD isn't alone in this type of problem. I am learning yet another PCB design program, and the programmers provided a way to assign colors to schematic traces to make them easy to follow. Unfortunately, they forgot to provide a way to go back to the auto default color! So, once you have "highlighted" a trace you can never "unhighlight" it. Not too bright!

However, with DesignCAD there is a pretty good chance the problem will be fixed once it is on Dempsy's bug list. The last extended round of debugging squashed something like 60 bugs, large and small.

Phil
DesignCAD user since 1987

Bob P

A macro can do it, grabbing sys(290)-sys(292).

Functions 290 - 299 are properties of an entity just selected with the Entity statement.

290 - Current Entity color, Red value [0-255]
291 - Current Entity color, Green value [0-255]
292 - Current Entity color, Blue value [0-255]

MarkX

Quote from: Bob P on November 09, 2011, 01:45:33 AM
A macro can do it, grabbing sys(290)-sys(292).

Functions 290 - 299 are properties of an entity just selected with the Entity statement.

290 - Current Entity color, Red value [0-255]
291 - Current Entity color, Green value [0-255]
292 - Current Entity color, Blue value [0-255]

Hi Bob,

Just tested this. It doesn't work for the color of an entity that has been set by layer. For those objects, it returns some same strange default as it might if you tried determining the color in the layer manager.

Thanks -
Mark

DrollTroll

Hmmm... looking into it. There's gotta be SOME way to get at that sucker.
25 years with DesignCAD

Lar

#8
Quote from: MarkX on November 08, 2011, 07:08:57 PM
Yes, you can pick a new color, but it won't show you the value of the current color. If you click on the color square what it brings up is NOT the value of the current layer color ...

Ok, Mark, I see your problem. My solution to you is to use the 'same color as' button (the pointing finger) on the color toolbar by clicking it on an entity of the color of interest. This would make that color the 'active color', which is what shows up in the color dialog box when assigning colors to layers. The bonus here is that you don't have to make the layer of interest the current layer, then record the RGB values, then dig for the layer you want to assign, then assign the color. Just use the finger, open the layer dialog box, find the layer of interest, click the color square (2nd left of the layer number, this would open the color dialog box) and press enter or click 'ok'. A quick way to find layers is to make them the 'current' by using 'the finger' from the Layer toolbar on an entity of that layer.

FYI:
The 'color by layer' function gets fed from the 'active color' function so it shows the active color (as opposed to the 'color tab' in the Options dialog that shows the color of the button clicked). I actually like this about dcad because I use it to assign colors and linestyles for new layers. I would have more than one layer with the same color so once that color is the 'active color' I just pick layers and press the right amount of 'enter's without having to move the mouse all over the screen {programmers obviously like moving the mouse all over the screen because you click a button here then then you have to move the mouse to the other side of the screen and click a button there, then back again... etc}.

Mark's problem would be easy to fix in older versions (that have the 'colors by layer' feature) because making the layer of interest the current layer would set the active color.

More recent versions have introduced complications with the 'automatically toggle bylayer settings' found in the layer dialog box. The first trick is that if 'color by layer' is not activated then making a layer current in the normal ways does not set the 'active color'. The second trick is that if you have 'color by layer' activated then making a layer current causes that layer's color to be displayed in the 'active color box' of the 'main' toolbox but it is not really the 'active color' (new entities would be displayed in the 'layer color' but their actual color would be the 'active color').

I have my own fix to Mark's problem but I can't reveal it on the forum because the programmers would have it 'unfixed' tomorrow. 'Good bugs' (the bugs that help) are 'corrected' almost immediately whereby 'bad bugs' linger for years and years.

Lar








MarkX

Quote from: Lar on November 11, 2011, 10:42:10 AM
Quote from: MarkX on November 08, 2011, 07:08:57 PM
Yes, you can pick a new color, but it won't show you the value of the current color. If you click on the color square what it brings up is NOT the value of the current layer color ...

Ok, Mark, I see your problem. My solution to you is to use the 'same color as' button (the pointing finger) on the color toolbar by clicking it on an entity of the color of interest. This would make that color the 'active color', which is what shows up in the color dialog box when assigning colors to layers. The bonus here is that you don't have to make the layer of interest the current layer, then record the RGB values, then dig for the layer you want to assign, then assign the color. Just use the finger, open the layer dialog box, find the layer of interest, click the color square (2nd left of the layer number) and press enter or click 'ok'. A quick way to find layers is to make them the 'current' by using 'the finger' from the Layer toolbar on an entity of that layer.
This method will only allow me to assign existing colors. It still won't tell me the existing value of a color. The "Same As" button doesn't assign any color if the object you're clicking on has been assigned a color by layer.  So you can't capture the layer color value that way. It seems as if one needs to keep a record of layer colors that are being assigned as one proceeds. You really should be able to just click and see the value of the current layer color.

Thanks!
Mark

Lar

Quote from: MarkX on November 11, 2011, 11:15:14 AM
It seems as if one needs to keep a record of layer colors that are being assigned as one proceeds.
You save colors in the 'custom color table' of the color dialog box. Once you have the desired color click the padlock icon to unlock the table, click one of the blank squares (with the red 'x') then click the 'add to custom table' button. Click the 'save as default' button then the 'save colors to file' so you can load the colors again later if you lose the default somehow.

..........

Quote from: MarkX on November 11, 2011, 11:15:14 AM
The "Same As" button doesn't assign any color if the object you're clicking on has been assigned a color by layer.  So you can't capture the layer color value that way.
This is exactly what I was saying here:
Quote from: Lar on November 11, 2011, 10:42:10 AM
More recent versions have introduced complications with the 'automatically toggle bylayer settings' found in the layer dialog box. The first trick is that if 'color by layer' is not activated then making a layer current in the normal ways does not set the 'active color'. The second trick is that if you have 'color by layer' activated then making a layer current causes that layer's color to be displayed in the 'active color box' of the 'main' toolbox but it is not really the 'active color' (new entities would be displayed in the 'layer color' but their actual color would be the 'active color').
This is why I don't use 'color by layer'. I may have to put a group of entities on a layer of a different color/linestyle and I wouldn't want the group's appearance to change. If I wanted the appearance to change I would activate 'color/linestyle by layer' for the group via the info box (of course, this also works the other way around). Like I said, I have a way to change layers and make the layer's assigned color/linestyle active all at the same time, the way it worked in way-back versions.

Lar

MarkX

Hi Lar,

I'm sorry, I thought you were saying that there was a way to grab the value using the "same as". But actually you're recommending (I think) that "color by layer" be avoided and just use the custom color function to keep track of colors.

That's a good work around, but it would still be nice to know what the original layer colors were. Obviously DC knows what the colors are, because it can display them.

As an extreme work-around, that worked once but I didn't thoroughly test -- you can draw a line with "color by layer" and then export the file as dwg. Then reimport into a blank drawing, turn off "color by layer" on the item, and then inspect the color of the resulting line. Not sure if it works every time or if I just got lucky.

Thanks!
Mark

Quote from: Lar on November 12, 2011, 12:07:36 AM
Quote from: MarkX on November 11, 2011, 11:15:14 AM
It seems as if one needs to keep a record of layer colors that are being assigned as one proceeds.
You save colors in the 'custom color table' of the color dialog box. Once you have the desired color click the padlock icon to unlock the table, click one of the blank squares (with the red 'x') then click the 'add to custom table' button. Click the 'save as default' button then the 'save colors to file' so you can load the colors again later if you lose the default somehow.

..........

Quote from: MarkX on November 11, 2011, 11:15:14 AM
The "Same As" button doesn't assign any color if the object you're clicking on has been assigned a color by layer.  So you can't capture the layer color value that way.
This is exactly what I was saying here:
Quote from: Lar on November 11, 2011, 10:42:10 AM
More recent versions have introduced complications with the 'automatically toggle bylayer settings' found in the layer dialog box. The first trick is that if 'color by layer' is not activated then making a layer current in the normal ways does not set the 'active color'. The second trick is that if you have 'color by layer' activated then making a layer current causes that layer's color to be displayed in the 'active color box' of the 'main' toolbox but it is not really the 'active color' (new entities would be displayed in the 'layer color' but their actual color would be the 'active color').
This is why I don't use 'color by layer'. I may have to put a group of entities on a layer of a different color/linestyle and I wouldn't want the group's appearance to change. If I wanted the appearance to change I would activate 'color/linestyle by layer' for the group via the info box (of course, this also works the other way around). Like I said, I have a way to change layers and make the layer's assigned color/linestyle active all at the same time, the way it worked in way-back versions.

Lar


paulerens

#12
Hi all,
This macro works if the layer has a specific color, but otherwise it returns the last color.
Sys (530-531-532-533) or a question mark for me???????
If Sys(242)= 0 Then
Sys(242)= 1          ' Select object when created [0=no, 1=yes]
 sowc = 1
End If
Sys$(41)="Discover color by layer"
InPut"Layer number for color by layer ?",c
Layer(c)=14
>PointMark
{
<Pointxyz 0,0,0
}
GetSelect 1,i
Entity i
Red = Sys(290)         'note the color number for red
green= Sys(291)        'note the color number for green
blue = Sys(292)        'note the color number for bleu
>Erase
{
 }
Sys(315)=red
Sys(316)=green
Sys(317)=blue
>CustomColor              ' Opens the Custom Color window.
{
 <CmdPrompt "Compose your new color."
 }
If sowc = 1 Then
Sys(242)= 0             'rest
End If
Regen
End

paulerens

#13
This one a little further, discover and change the layer color,if you wish.

If Sys(242)= 0 Then
Sys(242)= 1          ' Select object when created [0=no, 1=yes]
 sowc = 1
End If
Sys$(41)="Find out and change the color by layer"
InPut"Layer number for color by layer ?" c
Layer(c)=14
>PointMark
{
<Pointxyz 0,0,0
}
GetSelect 1,i
Entity i
Red = Sys(290)         'note the color number for red
green= Sys(291)        'note the color number for green
blue = Sys(292)        'note the color number for bleu
>Erase
{
 }
>CustomColor              ' Opens the Custom Color window.
{
 <CmdPrompt "Compose your new color.Or OK to leave the layer color as it is"
 }

Sys(531)=Sys(300)     '}this reset to the new color
Sys(532)=Sys(301)     '}
Sys(533)=Sys(302)     '}
>ApplyColor
{

}

If sowc = 1 Then
Sys(242)= 0             'rest,Select object when created,if needed.
End If
Regen
End

Lar

Quote from: MarkX on November 12, 2011, 10:46:54 AM
Hi Lar,

I'm sorry, I thought you were saying that there was a way to grab the value using the "same as". But actually you're recommending (I think) that "color by layer" be avoided and just use the custom color function to keep track of colors.

That's a good work around, but it would still be nice to know what the original layer colors were. Obviously DC knows what the colors are, because it can display them.

Mark, I think I have found a way to reliably investigate a layer's assigned color (please test, I'm using v21.0):
1] with 'color by layer' on, make the a layer with the desired color the current layer and draw a line (the line will be in the assigned color, which may or may not be the entity's 'actual color') Select the line and the info box will show a tick mark by 'Color by Layer'...
2] Copy the entity to the clipboard then past in back into the drawing. The pasted entity will loose its 'color by layer' property and now have the layer color as its 'actual' color' (wow, imagine the problems that can cause). You now have the following choices:
a] to investigate the color: click the 'change color' button at top of the info box. This will open the color dialog box with the entity's color in the big square. Without clicking any of the color squares make note of the RGB values right of the big square and/or drop the color in the 'custom color table' (note that you can even change the 'basic color table' via the dc_color.ini file, please make a backup first in case you mess things up)...
b] to assign the entity's color to a layer: turn off 'color by layer' (see my last paragraph), use the 'same color as' finger on the entity, open the layer dialog box, find the proper layer, click the square 2nd left of the layer's number, click ok or press enter when the color dialog box opens.

To clarify, I was not really recommending not using 'color by layer', since everyone has their own preferred way of working. I was saying that if you use 'color by layer' then using the 'same color as' finger may produce unexpected results, since an entitiy's visible color may not be it's 'actual' color (the visible color would be the layer color, the actual color would be what was the actual 'default' color {as opposed to the 'active' color} when the entity was created). I was also saying that when using 'color by layer' the color that shows in the 'Color Toolbox' button of the 'main toolbar' (I was mistakenly calling this the 'active color square' since this is what it displays) would be the 'assigned layer color', as opposed to the 'default' color. So, when you go to assign layer colors, the color you see in the 'color toolbox' button would not appear in the big color square if the 'layer color' is not the same as the 'default' color. What would life be without complications.

Another weird thing about 'color by layer' that I just re-discovered: if you use the 'same color as' finger to click on an entity and the current layer has an assigned color then the 'actual color' of that entity becomes the assigned color for the current layer (even if the entity is not on the current layer) and all of the entities on that layer would now be displayed in that color (remember, their 'actual' colors may each be something different)....(note that each entity has it's own 'color by layer' property that can be turned on or off via the info box).

Lar