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.

Colour & linestyle by layer

Started by adriank, December 03, 2012, 07:06:19 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Adrian 2.0

This is a feature I use a lot but it really does drive me mad sometimes.
It seems to be extraordinarily flakey at best - the 'color by layer' and 'linestyle by layer' checkboxes in the info box seem to be the main culprit.
I have several preset layers (some color only, some linestyle only & some both) which open by default when I open DCad but I often find when I check the info box on an object that either the box is checked when it shouldn't be, or unchecked when it should be.
I just tested by re-starting DCad a few times with a new drawing, drew a line & checked it in the info box.
The first time in a layer with preset color & line - color was unchecked on the info box.
Second time OK
Third time a layer with no presets had the color box checked.
I'm often annoyed when I change a line to a new preset layer & the style or color don't change automatically - if they never did, that would be OK too but it's a lottery.

Apart from that, there are a couple of things I'd like to see changed.
When I jump to a layer by using the 'same as' function, the color & linestyle presets don't load with the layer. I have to 'same as' then open the layer window and select the layer again to get them to load - PITA, but still quicker than scrolling through dozens of layers to find the one I want.
I also noticed that any object drawn with layer defined color can't be selected using the Selection filter 'select by color' option, the only colors displayed are those drawn in layers without fixed color presets.
These must surely be bugs, not features?

Adrian

MarkX

Quote from: adriank on December 03, 2012, 07:06:19 AM
I also noticed that any object drawn with layer defined color can't be selected using the Selection filter 'select by color' option, the only colors displayed are those drawn in layers without fixed color presets.
These must surely be bugs, not features?
What version are you on?

For this particular objection, a line with color by-layer doesn't really have a color. Its sort of like "by-layer" is its own magic color. But you can use the Selection Filter to select it by layer.

This by-layer versus by-entity thing gets complicated fast. Today you want the color filter to select a green line that displays green because it happens to be by-layer on a green layer. But tomorrow you may find that you only want to select true green objects and not the by-layer false greens.

Its kind of like whichever method you prefer to use for working -- by layer or by entity -- you need to make up your mind and use that approach throughout the drawing.  DC will allow you to mix and match, but you're likely to get a headache figuring out the ramifications of various choices.

Good luck,
Mark

Dr PR

Artian,

Mark is being polite by saying it is complicated.

Facts:

Objects must be displayed in some color. Objects have an intrinsic color that is displayed in layers that do not have an assigned color. Layers may or may not have an assigned color. Objects have a "Color by layer" option that determines whether or not they display in a layer's assigned color or in their intrinsic color. These things interact in a complex way.

The way the program works:

1. Objects have an intrinsic color.  You can change the intrinsic color from the Info Box by turning off the "Color by layer" option and clicking on the color tile.

2. Layers can have an assigned color. Any object residing in that layer is supposed to be displayed in the layer's assigned color, and not the object's intrinsic color. But this only applies to objects that have the "Color by layer" option selected. Objects with this option deselected always display their intrinsic color, even on layer with an assigned color.

3. New objects created in a layer with an assigned color will have that layer's assigned color as their intrinsic color, and they will have the "Color by layer" option selected.

4. If an object is created on a layer that does not have an assigned color it will take the color currently assigned in the Color Toolbox as the intrinsic color. It will not have the Info Box "Color by layer" option set.

If this object is moved to a layer with an assigned color it will display with it's intrinsic color and not the color assigned to a layer. You have to set the objects "Color by layer" option to get it to display in a layer's assigned color. After that it will display the color assigned to the layer it is in, but it still retains the original intrinsic color.

****

Here is the confusing part.

If you create an object A on a layer with an assigned color (say green) it will display with the layer's assigned color, it will have the "Color by layer" option set, and it's intrinsic color will be the same as the layer's assigned color green.

But then suppose you change the active layer to a layer without a defined color, and the red color is selected in the Color Toolbox. Now select object A, duplicate it and move the duplicate A' to the current layer. The duplicate's intrinsic color will change to the Color Toolbox color (red) IF the "Color by layer" option is set in the duplicate object before the layer change - even if the layer you move it to does not have an assigned color!

If the duplicate A' "Color by layer" option is disabled before the object is moved to a new layer, it will retain the intrinsic color (green) of the original object A.

Got that?

So, if the "Color by layer" option is set in an object and you move it to a layer that has no assigned color, it will have the color selected in the Color Toolbox assigned to it's intrinsic color. At least in V21.1 beta 3. Maybe others will test this in other versions to see what happens.

I suspect this is a bug, but the interactions of the Color Toolbox, colors assigned (or not assigned) to layers, and each individual object's "Color by layer" option are so complex that it may not be.

Phil
DesignCAD user since 1987

Adrian 2.0

Thanks for the replys guys.
(I'm using V22)
I understand the logic now, that the color by layer tool only defines what we see, not what is drawn.
I was thinking that if I go to a layer with a defined red color, then the color toolbox changes to red automatically so any new line would be created in that color. I would have thought that would have made a complicated proceedure more simple for the programmers too - apparently not.
This also explains why if I take an object from one drawing with one set of pre-definitions into another drawing with different definitions the displayed colors & lines get messed up. (that makes the whole system of pre-defining a bit useless to me)

It might also explain why when I jump to a layer using the same-as tool the program does not see the line & color definitions for that object. That does not make it any easier to use though, here is what happens currently.
New drawing. Layer 1 is current with no definitions, color palette is displayed, linestyle fields are active.
I draw a solid black line.
I go to layer 2 with dash line & red color definitions. The color & linestyle toolbox are inactive & I draw another line, this shows a red dashed line as expected.
I then go back to layer 1 using the 'same-as' pointy finger but now instead of the color & linestyle toolboxes being active they remain inactive - the color palette shows the previous red as the active color (not black as expected) & the linestyle box declines to tell me what linestyle it intends to use.
I draw another line & surprisingly it draws in black, not the red it shows as active, and it draws a dash line.
If I open the layer box & select layer one a second time the color & linestyle boxs become active, showing a black solid line as before & I draw a solid black line again.
I know it's not hard to fix when only working in 2 layers, but when I'm using hunderds of them & trying to move from layer 42 to 666 it's much faster to use the same-as, especially when my brain can't remember what layer I'm supposed to draw the furnace in!

Dr PR

Adrian,

It does look like there is a bug somewhere related to changing layers without adapting to the color and line style options for the new layer.

When you switched from layer 2 back to layer 1, and found that the color and line style boxes were grayed out, did you still have an object on layer 2 selected? If this is the case the color and line style boxes were probably showing the options for the selected item and not the layer.

Phil
DesignCAD user since 1987

MarkX

I think I mentioned that its better to pick one system and stick with it?

Mixing and matching brings in subtle conflict rules.

For instance, if you set the color and linestyle for a line, and then later set it to color & linestyle by layer, whenever you use "same-as" on that line, your resulting line will show the color/linestyle that you had set previously for the line, and not the color it happens to have right now due to its layer. You probably won't be able to memorize all the original colors and linestyles of your lines, so the same-as may surprise you.

I would want to see an actual file with a problem before concluding there was a bug.

Mark

Dr PR

It seems to me that the "correct" way to use the by-layer features is to start off by assigning line style and colors to all layers that you intend to use, before drawing anything. This is not a problem if you are repeating a drawing style that you have already developed in past drawings. If you are starting something new, be sure to assign properties to any new layer before you use it.

If you do this, all objects will have the "Color by Layer" option set when they are created, and they will have the intrinsic color of the layer that are created in. Then if you simply avoid moving things between layers everything will behave as expected.

I suspect the by-layer features originated to streamline the production of topographic maps, where everything has properties related to its function in the map. Water is blue, vegetation is green, countour lines are brown, etc. Of course, you won't want to move streams to the roads layer, etc.

If you need the flexibility to move objects between layers the by-layer properties probably shouldn't be used.

Phil
DesignCAD user since 1987

Adrian 2.0

Hi Phil,
No, I didn't have anything selected when I jumped back to layer 1.
As you described - I have the program set up so every new file I create has the same default linestyle properties set up by default.

Mark,
It's really easy to create your own test file.
Opening a new drawing.
Draw a line (should be black, solid, layer 1)
Assign layer properties to layer two. (red , dashed)
Go to layer 2
Draw a line  (should be red, dashed!)
Go back to layer one using 'same-as'.
The color & linestyle toolboxes are not accessible & you will draw a black dash line - not the original assignment, not what is displayed in the inaccessible color toolbox & not the layer 2 properties either.

Adrian

MarkX

#8
Quote from: adriank on December 04, 2012, 08:33:31 PM
Hi Phil,
No, I didn't have anything selected when I jumped back to layer 1.
As you described - I have the program set up so every new file I create has the same default linestyle properties set up by default.

Mark,
It's really easy to create your own test file.
Opening a new drawing.
Draw a line (should be black, solid, layer 1)
Assign layer properties to layer two. (red , dashed)
Go to layer 2
Draw a line  (should be red, dashed!)
Go back to layer one using 'same-as'.
The color & linestyle toolboxes are not accessible & you will draw a black dash line - not the original assignment, not what is displayed in the inaccessible color toolbox & not the layer 2 properties either.

Adrian
Hi Adrian,

You're right! That looks like a bug to me in the LAYER "Same-as" tool that appears to the right of the layer dialog. Everything stays grayed-out no matter what you click on until you change layers either with the layer drop-down or with the main ("L") layer dialog tool.

To summarize, using the Layer Same-As tool can result in grayed color and linestyle toolboxes.

Even closing out and re-opening the file will not reset the toolboxes. I've attached an example file showing the bug in action (or is it "inaction"?). When you open up the file, you will be on Layer one with no Color or Linestyle restrictions. But all the related toolboxes will be grayed (greyed) out.

Edit: New summary. The State of the Color toolbar and of the Linestyle toolbar does not change when using the Same-As Layer (pointy finger of doom) tool. This works in both directions. So you can end up on a layer with color and line presets, but have the respective toolbars open, or you can end up on a layer with NO color and line presets, and yet have the color and line toolbars grayed (greyed) out.

Mark

Adrian 2.0

Hi Mark,
Thanks for taking the time to confirm I'm not a fruit-cake!
I hadn't picked up that it happens in reverse too - that may explain how I get so many objects with screwed-up properties in my drawings.
Loved the 'inaction' BTW!

Adrian

prl

Where things go with supposed layer and entity defaults, what actually gets changed with the "same as" functions, what final colors (and layers) will result with solid additions and subtractions, etc. ; managing these things is like trying to herd cats. I've unfortunately have never been able to 100% predict or recommend the proper logic to all these combinations including the various tools that affect them. Thanks for pointing out this situation.

prl

Quote from: Dr PR on December 04, 2012, 06:33:22 PM
I suspect the by-layer features originated to streamline the production of topographic maps,

In my line of work (buildings), way back we adopted the color by layer stuff to assign plotter pens.  We had many layers but only 5 basic colors.  Looking at our CAD screens (black background), with colors substituting for hand drafting line thickness, one could quickly see if things were properly assigned.   My first drafter (before I was allowed to draft, you know engineers engineer, admin staff type etc. . . . right), he would quickly draw without regards to color or layers.  Once he hashed out the detail or whatever, he then dumped the various bits and pieces on the right layers.  For detailing I still do that, start DC and simply start drawing.  Cleanup and organizing  happens later.

Dr PR

prl,

You are right! It has been so long that I had forgotten about controlling pen type. I suspect that is probably the real reason, even with topo maps. Each layer was plotted with a different pen type (color and line width).

Plotters that used multiple pens had pen change commands to allow programs to change pens (line width and line color). I do remember mapping layers to pen colors in early circuit board layout programs. If I recall correctly (and I may not because it has been a long time) ProDesign had a way to associate pens with line width and color, but I don't recall ever using it.

Phil
DesignCAD user since 1987