News:

Please note new Forum URL: forum.designcad.com

Main Menu
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.

Layer features save

Started by Dr PR, November 13, 2012, 10:58:36 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Lar

Quote from: prl on November 14, 2012, 05:43:54 AM
Interesting twist. This isn't documented as a possible layer state combination.
Prl, clicking the 'unlock all' button to allow you to select groups with parts on inactive layers is what is I call a "friendly bug". It's a malfunction that helps rather than hinders.

I discovered this way back and during that time when many users did not comprehend "multi-layered" groups and were about to riot I posted this remedy on the forum. It has since become a part of dcad lore. Before that I did not want to post it because back then the programmers had a tendency of "fixing" friendly bugs within a week of it being reported, as opposed to years to fix unfriendly bugs.

Lar,
DCH, FP
(Dcad Historian and Forum Pacifier)

prl

Quote from: Lar on November 14, 2012, 06:55:40 AM
Prl, clicking the 'unlock all' button to allow you to select groups with parts on inactive layers is what is I call a "friendly bug". It's a malfunction that helps rather than hinders.

I dare ask, should we ask them to fix this friendly bug? I would not.  Strangely enough what Phil is asking for (being able to select objects with hidden attachments and not regenerating the screen) can be done programmatically.

prl

#17
QuoteLAYER(x)    - Layer status of layer x. Returns 0-15
   [legal values: 0, 1, 2, 3, 6, 7, 14, 15]
   

Well to answer my own question, "Unlock ALL" creates a different layer state, at least temporarily.  After I created a multilayer group with some layers turned off, my layer state routines report layer values of 4 and 5.  Not one of the legal values given above.

Rather than fiddling with the layer code and introducing another partial lock icon, why not formalize what the "Unlock ALL" button actually does.  In other words, on the General options page, put an option so the user can decide "Enable Selection of multi-layer group and/or solids elements on hidden layers".  This is I think what Phil and others are actually doing with this friendly bug/feature.



JJG

#18
Quote from: Lar on November 14, 2012, 06:55:40 AM
Quote from: prl on November 14, 2012, 05:43:54 AM
Interesting twist. This isn't documented as a possible layer state combination.
Prl, clicking the 'unlock all' button to allow you to select groups with parts on inactive layers is what is I call a "friendly bug". It's a malfunction that helps rather than hinders.

I discovered this way back and during that time when many users did not comprehend "multi-layered" groups and were about to riot I posted this remedy on the forum. It has since become a part of dcad lore. Before that I did not want to post it because back then the programmers had a tendency of "fixing" friendly bugs within a week of it being reported, as opposed to years to fix unfriendly bugs.

Lar,
DCH, FP
(Dcad Historian and Forum Pacifier)

Lar, and others,

since some user(s) has had the bad idea to ask to remove the "Group layer visibility by Group Host layer" status, because of their theory that a group should not have a layer such that the nested groups of Designcad have,
while regular groups may still have one, if one affects it to via the layer with toolbox,
it's the kind of incomprehensible and intractable situations to which we arrive now.

I'm not surprised;
But we should not talk of a bug, this time. No.
this is a just an inadequate way to use Designcad, ie use without enough rigor, that's all.

This is an additional reason that makes me like the nested groups when the status of visibility by host layer works, as in the French version of Designcad.

Dr PR

Lar,

I don't want this feature changed, but it certainly isn't a bug! It makes perfect sense for visibility and locked state to be unrelated.

Note that locked/unlocked and editable/uneditable are two totally different concepts. The program works with a simple four state table:

                   Unlocked     Locked
Visible         editable      uneditable
Invisible      uneditable  uneditable

The programmers obviously designed it to work this way, and it is perfectly logical, so it isn't a bug.

The real bug is that the locked icon doesn't always show the locked state. A further problem is that clicking the lock icon doesn't just reverse the locked state (as it should) but it may also reverse the display state. If there is a "friendly bug" this is it. However, like you I wouldn't want this to be changed because a lot of users depend upon it.

If we are to add any options, I think it would be for the locked icon to operate independently of display state, and actually show the true locked/unlocked state of the layer.

****

A compromise would be to add an "Editable" column to the Layers Dialog. Clicking the Editable icon would work similar to the way the lock icon works now. Clicking the Editable icon when a layer was invisible would make the layer visible and unlocked. Clicking it when a layer is visible would hide and lock the layer.

Then fix the lock icon to just toggle the locked/unlocked state and display the results.

Users can hide the columns they don't want to see. This would allow us all to work the way we want to.

Phil
DesignCAD user since 1987

prl

#20
Quote from: Dr PR on November 14, 2012, 01:15:35 PM
The programmers obviously designed it to work this way, and it is perfectly logical, so it isn't a bug.

I would guess you stumbled upon a useful bug and have convinced yourself this is the way the program operates.  The four state table is not described in any of the programming literature produced including the OLE reference, only the three state table.

I also take it you can't control this partially editable state on a layer by layer basis, only through the "Unlock ALL" button.


Edit: I guess it is also possible the programmer's were heading in the direction Phil suggested but never finished the full concept.  DesignCAD is full of things like this.


Not arguing about the merits of this 4 state table, but the term locked as a separate layer property is not defined in the literature.  Maybe it is or isn't a substitute for non-editable.  Only Dt would know what was intended.

From the OLE reference:

QuoteProperty Editable As Boolean

Read/Write.

Description:
The Editable property controls whether entities on a layer can be selected, edited, or deleted. When Editable is True, the entities on that layer are available for any kind of editing. When it is False, they are not available.

Example:

' Assumes DcLayer is a valid DesignCAD.Layers object

DcLayer.Editable = False



QuoteProperty Visible As Boolean

Read/Write.

Description:
The Visible property controls whether entities on the layer can be seen. If the Visible property is set to False, the Editable property is automatically set to False as well (you aren't allowed to edit what you can't see).

Example:

' Assumes DcLayer is a valid DesignCAD.Layers object

DcLayer.Visible = True

Dr PR

prl,

Frankly, I don't understand your arguments. Clearly the program does keep track of visible and locked states for layers.

You can control this behavior on a layer by layer basis - that's how the program works. If you make a visible layer unlocked, make it invisible, and then visible again, it is still unlocked. Lock a visible layer, make it invisible, then visible again and it is still locked.

If only an "uneditable" state was being stored it would be impossible to determine if a layer should be unlocked or not when it was changed from invisible to visible.

Yes, there is an "editable" state, but it is the Boolean AND of visible and unlocked.

There is an "uneditable" state, but it is the Boolean OR of invisible and locked.

****

It looks to me as if whoever wrote the OLE documentation has substituted "Editable" for "Locked." Read what you posted. It describes two independent variables. One controls visibility and the other controls whether obejcts can be selected. Call it "Editable" or "Locked" or "Freeblehauser" - it doesn't matter. There are two distinct functions.

And it isn't a bug - there is no way the program would work if it wasn't implemented this way.

Phil
DesignCAD user since 1987

prl

#22
Quote from: Dr PR on November 20, 2012, 10:13:54 PM
Frankly, I don't understand your arguments. Clearly the program does keep track of visible and locked states for layers.

I'm merely demonstrated the 4th state does not exist in the documentation nor can I set it by OLE or BasicCAD.  The fact you and Lar stumbled upon it is great for your purposes but does not (necessarily) imply the program was programmed that way.  You implied there are three layer properties, 1.) visible (on/off), 2. editable (on/off) and 3.) locked (on/off).  The "Locked" layer property does not exist in the literature and the word may simply be a substitute for "read only" (aka non-editable).  If that is the case, when you turn off the layer visibility, the edit state according to the OLE is automatically set to False (read only).  If toggling the layer lightbulb doesn't set the edit state to false, then technically this is a bug which is why Lar labeled it a friendly bug because it separated out the trip link between the two properties.

Edit: And since we are beating this topic into mush, according to the programming guides there are two trip links between these two properties.  One for the lightbulb icon and one for the lock icon.

1.  You click the lightbulb when it is ON,  it turns off layer visibility AND trips the editable state to False (the locked icon appears).

2.  While both the lightbulb is dimmed (OFF) and the locked icon is ON, if you click the locked icon, this trips ON the layer visibility (lightbulb ON) AND the locked icon becomes Unlocked (editable).


Dr PR

prl,

Most of the confusion here is the result of semantics. One person thinks one way and assumes everyone else thinks the same way. They assume a particular term or icon means the same thing to everyone else, when they don't.

You are correct that clicking the lightbulb icon on a visible layer does turn off visibility and it also locks the layer. However, clicking the lightbulb may or may not unlock a layer - this is unpredictable from the Layer Dialog display. Both lightbulb and lock icons control editability and not visibility and locked state. One single "editability" icon could accomplish all of this.

That is the way the program works, but I would like to see this changed, or at least have an option to allow us to control the locked and visible states separately. It is not a question of "efficient use" of the program or any other such nonsense. Having to enable visibility of a layer to find locked layers is a real problem when it may take tens of minutes for that layer to be displayed and then not displayed again. Right now the only option I have in large drawings for finding the locked layer that is preventing me from selecting a group or solid is to unlock all layers, and that makes deliverately locking some layers to protect entities on those layers pointless. For me, the way the program works now is extremely inefficient and very poor program design!

****

Part of the problem is an inconsistency in terminology. The Layers Dialog uses a lock icon to represent editability, but it has "Lock All" and "Unlock All" buttons. In all other programs I have used that allow control of layer properties the terms "locked" and "unlocked" are used, and they are independent of layer visibility. Obviously, most users on this forum use the terms "locked" and "unlocked" while the people who wrote the documentation used "editable" and "uneditable." This is a source of confusion.

The lock icon does actually operate to control editability (locked and visible states) while the "Lock All" and "Unlock All" buttons control only the locked/unlocked state of the program. These differences also add to the confusion.

The program does maintain independent locked/unclocked and visible/notvisible layer variables, as I have demonstrated above. The lock icon changes both of these, so it is actually an "editability" function, not a "lock/unlock" function as the icon suggests. The "Lock All" and "Unlock All" control only the locked state. This is the way the program was designed, and none of it is bugs.

It all makes sense except that the lock icon doesn't always show the locked/unlocked state. If you think only in terms of "editability" the lock icon works correctly - it is an editability icon. If you think in the way the program maintains locked/unlocked layer states the lock icon behaves oddly.


****

Clicking the "Unlock All" does reverse the locked state on invisible layers, and makes objects on those layers editable IF you can find a way to select them.

1. Look at "layer test 1.jpg." I created three objects, a cube on layer 1, a pyramid on layer 2 and a sphere on layer 3. Then I duplicated the three objects.

2. Next I grouped the cube and pyramid on the right.

3. Then I disabled visibility for layer 2 and clicked "Unlock All."

4. I selected the right hand cube and deleted it. Then I enabled visibility of layer 2 and the pyramid was also deleted. See "layer test 2.jpg."

5. I repeated steps 1-3.

6. I gravity snapped to the right hand cube and it was selected. Then I pressed "N" to duplicate the group and dragged - as you can see a wireframe image of the entire group is visible. The pyramid on the invisible layer 2 is selected.

****

I do not know what the "DcLayer.Editable" variable does. The text from the OLD documentation describes the independent locked/unlocked function. It doesn't mention visibility. Whether it works to just change the locked/unlocked state or if it also influences visibility I do not know.

However, I would consider it a bug if it doesn't just control the locked state. There is no reason why macros or OLE extensions should not be able to select and delete specific objects on layers that are not "visible" since visibility is purely a display function for the benefit of users. Nothing is "invisible" to programs that can sort through the drawing list.

In this case the use of "Editable" instead of "Locked" would be the result of one of those mental lapses that often afflict people tryiing to describe things.

Phil
DesignCAD user since 1987

prl

Phil,  what you have discovered is real and I can reproduce it too. The wordplay comes down to DesignCAD rules.  If the rule is "you aren't allowed to edit what you can't see", you are left with three combinations.  With this rule, clicking the "Unlock ALL" button should technically turn ON invisible layers too.  Fortunately for you it doesn't otherwise you would get a massive regen when all you want to do is select the group/solid with the partially hidden items.

Dr PR

prl,

Agreed.

However, I have never assumed that you aren't allowed to edit what you can't see. Hiding layers just makes it easy to remove clutter from the drawing area, and a consequence is that hidden objects can't be selected in the normal way. If you can't select them, you can't edit them. But if there is a way to select them, they should be editable.

The editability controls are useful shortcuts. After all, that is what most people are interested in. We certainly don't want objects on invisible layers to be selectable or to be snapped to in most cases. That is why we have invisible layers.

Actually, in earlier versions there have been bugs that allow hidden grids to be snapped to, and that would make it almost impossible to gravity snap to the correct items on visible layers.

Likewise, the locked but visible combination is very useful, allowing us to use objects on locked layers as templates for drawing on unlocked layers.

None of this should be changed!

****

By the way, the real reason this whole thing came up is because DesignCAD often moves things from the layers where you put them and puts them on other layers. In particular, it sometimes scatters facets of grids to the wind and they come down in whatever layer they land in. If these layers are not visible and locked, you can't do anything with the resulting grid, or an object that it is a part of. And since the user didn't put them there, the user has no way to find them except to make everything visible (very bad if this takes tens of minutes) or just unlock all layers. If "Unlock All" didn't work the program would be unusable for me.

After unlocking all layers you can select the object and use the Info Box to force all the parts back to a single layer. If the original objects were on multiple layers, you lose that.

The solid Boolean operations are the prime culprets for moving things between layers. It happens with nearly every "Solid Add" operation and very often with "Solid Subtract" on both of my machines (XP and Vista), and with every version since V17. Most of the time the wayward bits and pieces end up on layer zero. I think this is why the Layers Dialog has the "Merge layer zero entities to the current layer" option. If so, it is a pretty lame bug patch because the material properties of the wayward bits are also screwed up (they almost always become black color and the "Aluminum" material). However, on one occasion I found the scattered bits on a layer number higher than the layer the original objects were on.
DesignCAD user since 1987

prl

Quote from: Dr PR on November 21, 2012, 11:29:23 AM
. . . I have never assumed that you aren't allowed to edit what you can't see.

You and Lar are rebels :)  I always enjoy reading and trying your discoveries . . . . even if it takes me a bit to catch on.


DrollTroll

QuoteI think this is why the Layers Dialog has the "Merge layer zero entities to the current layer" option.
Not at all. That option is there so when you are importing symbols using "load and explode" or "Load as original entities", any entities in the symbol that were on layer zero come in on the current layer rather than on layer zero.
25 years with DesignCAD

Dr PR

DT,

Thanks. Now that you mention it I do recall that it had something to do with symbols.

Phil
DesignCAD user since 1987