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.

Frozen Bitmap image

Started by Hughaircraft1, January 22, 2015, 03:56:48 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Dr PR

#15
Sam,

To rephrase and complete what you posted:

Dec  Binary    Current     Locked      Visible       Occupied
0       0000        no             no             no             no
1       0001        no             no             no             yes
2       0010        no             no             yes            no
3       0011        no             no             yes            yes
4       0100        no             yes            no             no
5       0101        no             yes            no             yes
6       0110        no             yes            yes            no
7       0111        no             yes            yes            yes
8       1000       yes             no             no              no
9       1001       yes             no             no              yes
10     1010       yes             no             yes             no
11     1011       yes             no             yes             yes
12     1100       yes             yes            no              no
13     1101       yes             yes            no              yes
14     1110       yes             yes            yes             no
15     1111       yes             yes            yes             yes

I put the binary number in because programming languages allow testing individual bits of a value - these are sometimes called flags where 0 = false and 1 = true. It was a way to use a single memory location for multiple purposes back in the days when memory was scarce.

So the bits in the value you are testing mean:

XXX0 is not occupied (empty)
XXX1 is occupied
XX0X is not visible
XX1X is visible
X0XX is not locked
X1XX is locked
0XXX is not the current layer
1XXX is the current layer

However, DesignCAD has a peculiar way of testing for editability - what you are calling locked/unlocked. Only visible objects are supposed to be editable. So:

X00X is locked and not visible (not editable)
X01X is locked and visible (not editable)
X10X is not locked and not visible (not editable)
X11X is not locked and visible (editable)

Initially all layers have bit 1 = 0. When you create an object in a layer (or move an object to the layer) bit 1 is set to 1.

"Hide All" resets the second bit = 0 in all but the current layer.
"Show All" sets the second bit = 1.

"Lock All" resets the third bit = 0 in all but the current layer.

However, the "Unlock All" function in the layers dialog sets the third bit =1 in all layers and that unlocks the layers, even if they are not visible. This allows you to select a hidden object IFF it is a part of a group and IFF another part of the group is visible.

When you change layers the fourth bit for the new current layer is set = 1 and the fourth bit = 0 in all other layers.

Phil
DesignCAD user since 1987

samdavo

#16
Phil
I like the way you introduce "editability", as a suitable combination of locking and visibility, viz:=
(edit) On second thoughts, I prefer "selectability"

X00X is locked and not visible (not editable)
X01X is locked and visible (not editable)
X10X is not locked and not visible (not editable)

Only X11X (not locked and visible) is truly "editable".

It seems to me that I would only use a few of those options - but I'll have to double check which .

PS  mmm, I seem to disagree on whether some are locked or not eg 3 and 7.

Dr PR

Sam,

The unlocked versus editable thing has confused a lot of people. There are several other threads on the forum that sprang from it.

The main source of confusion is the lock icons in the layers dialog. They are referred to as "lock icon" in the Reference Manual. In visible layers they indicate whether the layer is editable, but this is commonly referred to as "unlocked" (or "locked") because the icon appears locked or unlocked. And there are "Lock All" and "Unlock All" functions in the Layers dialog

But as I have mentioned there is a "locked/unlocked" flag that is not an "editable" flag. The "Unlock All" function works only on the locked/unlocked flag, and it will unlock invisible layers. However, these unlocked invisible layers are not normally editable (you cannot select invisible objects). But "Unlock All" does allow you to select objects that are scattered across multiple layers if some of the parts are hidden.

Editable (visible and unlocked) isn't my idea - that's what the Reference Manual calls it and the way the program has worked for a long time, maybe all the way back to the original Prodesign in the 1980s. It may have been a way to prevent the program from selecting objects on invisible layers. This was a big problem in the early 3D versions of the program. You would gravity snap to a nearby visible object but the snap would actually be to a hidden point near the visible object. In crowded parts of drawings this made it almost impossible to do any work. The problem came and went through several versions and revisions.

Phil

PS: I tried to reply to your personal message but it bounced, with the IMSI server saying "User unknown." ?WTF
DesignCAD user since 1987

samdavo

#18
Quote from: Dr PR on January 24, 2015, 10:07:22 AM
So the bits in the value you are testing mean:

XXX0 is not occupied (empty)
XXX1 is occupied
XX0X is not visible
XX1X is visible
X0XX is not locked
X1XX is locked
0XXX is not the current layer
1XXX is the current layer

However, DesignCAD has a peculiar way of testing for editability - what you are calling locked/unlocked. Only visible objects are supposed to be editable. So:

X00X is locked and not visible (not editable)
X01X is locked and visible (not editable)
X10X is not locked and not visible (not editable)
X11X is not locked and visible (editable)
Phil,
Thanks
Firstly a bit of pedantry (Minor point) -
I believe you mean :-

X0XX is not locked not "editable"  (in the sense of being unlocked)
X1XX is locked  "editable"  (in the sense of being unlocked)

Elsewhere you said it as follows :-
Quote from: Dr PR, elsewhereBit 0 = layer empty state, 0 = the layer is empty, 1= the layer is not empty
Bit 1 = layer visibility state, 0 = invisible, 1 = visible
Bit 2 = layer locked state, 0 = locked, 1 = unlocked
Bit 3 = current layer, 0 = not current layer, 1 = current layer

ok,
In an attempt to add to this conversation (which has been long-running, and probably exhausted - but nonetheless here goes ...)

I enclose a dcd drawing, as well as screensnap of the layer dialogue box.

Next I define the layer function as the "cevo" value, where
c = current (or not)
e = "editable" (or not) - in the sense of being unlocked, (not the compound meaning which is also influenced by visibility).
v = visible (or not)
o = occupied (or not)

I have set up the drawings layers with
layer 0 to be cevo = 0 = 0000
layer 1 to be cevo = 1 = 0001
layer 2 to be cevo = 2 = 0010
layer 3 to be cevo = 3 = 0011

layer 6 to be cevo = 6 = 0110
layer 7 to be cevo = 7 = 0111

layer 14 to be cevo = 14 = 1110   (current at the moment)
layer 15 to be cevo = 15 = 1111 (well it would be if you made 15 current instead of 14)

I could not achieve 4 or 5, viz:-
layer 4 would be cevo = 4 = 0100
layer 5 would be cevo = 5 = 0101
I tried to impose this with a macro, but it wouldn't play.
Others around here might be able to achieve it - and for some reason I seem to recall getting them once before - I'm guessing it is something to do with the sequence of turning out the light etc(?))


(edit) LATE EXTRA UPDATE:  You can achieve 4 (cevo = 0100) by forcing a change to 6 (cevo = 0110) -  (which is unlocked and visible) to be "apparently locked", purely by turning off the visibility light.   

Nor could I impose 8 to 13 - but that is more 'obvious'

Note that cevo is spelt backwards according to the columns of the layer dialogue box - see screensnip.  i.e. they are in the sequence of "ovec".  (2 cents) (edit) I reverse this in replay #27

samdavo

#19
Here's a pretty simple macro called aaaa.d3m  PS Temporarily withdrawn.
and when you run it on any dcd file, it will tell you the status of all the files - well at least the first 16,  (0 to 15 incl)

I use cevo through to NLHU
where
c = current,   N = noncurrent
e = editable,  L = locked
v = visible,    H = hidden
o = occupied, U = unoccupied

PS please tell me someone has a better version lol.

PS Temporary Ground Under Repair - watch this space

Hughaircraft1

Sam,
I think that unticking the allow multi layer editing box was indeed the source of my problems.
Hugh

Dr PR

Sam,

I repeat, "editable" layers are both unlocked and visible.

Visible layers that are locked are not editable.

Therefore, editable and locked are not the same thing.

Objects must be on unlocked layers to be editable.

And, as I have described, it is possible to unlock hidden layers, allowing things on those layers to me moved to different layers or deleted (and probably copied, change colors/materials, etc., but I haven't tested this) IFF the objects on the hidden layers are part of a group or solid/grid that also has parts on a visible layer.

Note: You cannot directly select objects on unlocked hidden layers, but you can select objects on visible unlocked layers. And if the visible objects are connected in some way with the hidden objects, the hidden objects are also selected.

You cannot select groups or solids/grids that have parts on locked layers, whether they are visible or not.

Here is proof:

1. Create objects on layers 1 and 2, and then group them.

2. Make layer 3 the current layer.

3. Hide layer 1.

4. Try to select the object on layer 2 - you can't.

5. Open the Layers dialog and click "Unlock All."

6. Now click on the visible object on layer 2 - it will be selected.

7. Use the Info Box to change the layer of the selected object(s) to layer 3 (or use the "A+" button in the Layers Tool Box).

8. The formerly hidden object from layer 1 will now be visible along with the object from layer 2, and both parts of the group will now be on layer 3.

Therefore: You can unlock objects on hidden layers. However, they will not be selectable (editable) unless they are a part of a group or solid/grid that is partially visible on an unlocked layer (editable).

I have been using this trick for 10-15 years, and have done this countless times after the solid Boolean operations have scattered facets of grids to other unknown layers.

Phil
DesignCAD user since 1987

samdavo

#22
Phil,
Quote from: Dr PR on January 25, 2015, 09:52:52 PM

Therefore: You can unlock objects on hidden layers. However, they will not be selectable (editable)  ....
I hear you, and ...
Sure I understand that there are two senses of the word editable, 
a) one means that the lock is unlocked, ( which I am calling "editable" )
b) the other meaning that changes can be made  (which should probably be called "selectable"  - AS YOU SUGGEST).

1. I would challenge any claim that DCAD's "editable" means BOTH unlocked AND visible.

Evidence?
If you look at the enclosed jpeg, you will see that DCAD says that layer 31 is BOTH "editable" and "invisible".
i.e. "editable" can coexist with "invisible" (in the terminology used by DCAD).
Hence any argument that says that DCAD's definition of editable necessarily includes "visible" is incorrect.

2. Why am I using "edible" rather than "unlocked"?
I find 1= yes and 0 = no is confusing if the question is in the negative.

i.e. it is confusing if the question is "is it locked?"   and 0 = yes, and 1 = no.
   
In the same way that I believe your post became confused,  i.e. where you say :-

QuoteX0XX is not locked   (this should be locked)
X1XX is locked   (this should be unlocked)

The other reason I am sticking with "editable" is that I can't find a better word in the on-line thesaurus - "writeable" achieves the same confusion that "editable" does for instance - (although it would have been nice to stay away from controversy I concede - all I can say is that I tried).   

3. I like your idea of using "Selectable"  when the layer is BOTH "editable" / unlocked and visible?

PS I am still working on that macro lol.  (edit - since posted) -  In between watching tennis, cricket, stupid politicians etc.   

(off topic) Would you believe it?  Our PM has made Prince Phillip (QEII's husband) a Knight of Australia (??)  Sir Phillip??   As someone said, maybe he's confusing him with Governor Arthur Phillip, the first Governor of Australia in 1788.  :)   (sheesh - "cringeworthy" doesn't come close)
http://www.abc.net.au/news/2015-01-26/abbott-defends-knighthood-for-prince-philip/6046380

prl

#23
Sam, I had this reference up before but removed it.  I should have left it.

Quote from: Dr PR on January 14, 2013, 02:18:45 PM
"editable" (visible and unlocked).

I tend to think: editable entity = layer visible bit ON + editable layer bit ON, and yes to have an entity be editable it must be selectable.

For your reading pleasure, which will explain Phil's terminology which is based on the reference manual.    Just keep in mind, the bits we are turning on/off are layer bits which may be a subset of an entity's various parameters.

http://forum.designcad.com/index.php?topic=4760.msg30026#msg30026

Dr PR

Well, we certainly have beat this horse to death, and all over a bit of semantics.

I use the term "editable" the way the Reference Manual uses it on page 38 - "Editable(lock icon)."

I use the terms "locked" and "unlocked" because the Layers dialog has a "lock" icon that is displayed in two states, locked and unlocked, because the Reference Manual calls it a "lock icon," because there are "Lock All" and "Unlock All" buttons, and because "locked" and "unlocked" are the terms universally used on this Forum for years to describe whether layers can be edited.

I have a real problem when people invent new terminology for things that are already defined in the Reference Manual. This causes all sorts of confusion for new users who read one thing in the manual and see others using different terminology. One of the purposes of this Forum is to reduce confusion, so I try to stay with the terminology used in the Manual, even though it isn't always perfect.

I also used terminology that is common in virtually all programming languages. "Flags" are state variables (memory location contents) that tell something about the state or condition of a program process, such as visibility of a layer. The flag is either true, or it is false.

In the C and C++ programming language (and most other languages) true  = not zero (The C Programming Language, Kernigan and Ritchie, Prentice-Hall, Inc., 1978, page 41).

Therefore, when a programmer defines the function of a flag bit, it has to be in terms of truth as the flag is defined. The definition of the flag can be "X" or "not X" - such as "locked" or "unlocked." If the flag is defined as a "locked" flag then it is true if the layer is locked. If it is defined as "unlocked" it is true if it is not locked.

With bit testing you are limited to two states, "true" (1) and "false" (0). So we come down to the functions and states of the bit in the flag, where the 0 state is always false, and the 1 state is always true.

The four bits are flags for current layer, locked layer, visible layer and occupied layer.

XXX0 is occupied false (not occupied, or empty)
XXX1 is occupied true (occupied, or not empty)
XX0X is visible false (not visible)
XX1X is visible true (visible)
X0XX is locked false (not locked)
X1XX is locked true (locked)
0XXX is current layer false (not current layer)
1XXX is current layer true (current layer)

And as I have said several times, in DesignCAD terminology "editable" is a combination of visible true and locked false. That's the way the program is written.

****

Your picture illustrates one of the several minor bugs in the program relating to layers. The "Editable" box at the bottom left of the Layers dialog does not always show the "editability" of a layer. Just select a non-visible layer and notice that it will still be checked as "editable" when it actually is not.

This is because these check boxes are intended to allow you to check/uncheck to set the state of the selected layer, and not to display the state, although it would make sense for them to change as different layers are selected to reflect the actual state of the layers.

The lock icon in the layers list is supposed to show the "editability" of a layer. But as I have demonstrated, it doesn't always show the locked state of a layer. You can unlock a non-visible layer, and the objects on it are still cannot be edited - you can't select them, and if you can't select them you can't edit them, therefore they are uneditable.

But you can select items on visible layers unless the object is a part of a group or solid/grid that has parts on a locked layer. In this case you can select the objects on visible unlocked layers only if you unlock the appropriate hidden layer(s). "Unlock All" does this but it doesn't make objects on hidden layers editable. After unlocking the hidden layers you still can select only those objects that are on visible and unlocked layers (editable).

As it happens, by a quirk of programming oversight, once you have succeeded in selecting the visible part of a multi-layer group, solid or grid you can manipulate all parts of the object, even the hidden parts.

Phil
DesignCAD user since 1987

samdavo

#25
Quote from: Dr PR on January 26, 2015, 10:12:11 AM

X0XX is locked false (not locked)
X1XX is locked true (locked)

Phil
Phil,
Elsewhere you said it as follows :-
Quote from: Dr PR, elsewhereBit 0 = layer empty state, 0 = the layer is empty, 1= the layer is not empty
Bit 1 = layer visibility state, 0 = invisible, 1 = visible
Bit 2 = layer locked state, 0 = locked, 1 = unlocked
Bit 3 = current layer, 0 = not current layer, 1 = current layer
reply 7 here :-
http://forum.designcad.com/index.php?topic=4760.0

Which is correct?

PS ( I believe you were right back then, and wrong now. )

Dr PR

Sam,

Good question. I based my original numbers on the results you posted. You said 0-3 are locked, so

bit 2 = X0XX = is locked (0-3, 8-11)
bit 2 = X1XX = is not locked (4-7, 12-15).

Looks like it is a "not locked" flag where 0 = false and 1 = true.

Sorry for the confusion. Got my un-nots confused.

Note: Another bizarre programming convention defies mathematical theory. In mathematics 0 is the absence of anything (an idea introduced by the Arabs many centuries ago). But in computer science 0 is just another counting number and there is no absence of anything - might as well be counting in Roman numerals! So the bits in an 8 bit byte are numbered 0-7. Totally screwball! This is a throwback to early computer architecture and the way memory is addressed.

Instead of using and address of zero to mean that nothing is addressed, they started addresses at zero and used a separate signal to indicate that nothing or something is being addressed. With the tube type electronics in use then it was simpler than  decoding all address bits to see if any are high (1). So from now to forever we will have both 1s complement and 2s complement arithmetic to deal with.

Phil
DesignCAD user since 1987

samdavo

#27
Phil
That's ok
Sailors are always getting confused with knots.

And You're right, I was wrong with some of my first guesses.

Since then I have cracked the code, (and that macro can be used to interrogate any dcd drawing).

(edit) The attached dcd file has every easily-accessed layer "state",  0 to 7, 14 and 15 .  As I say, I have finally cracked the code.

I enclose an optional method of re-jigging the Layer diague box.   Basically I have swapped the columns around, easily dragged back and forwards) - now in the sequence  "cevo" = "current? - editable? - visible? - occupied?"

If you see, for example,  "no-yes-yes-yes", then you know that layer is 0111,  (7) etc.
And, Doctor Phil,  I thank you for your time and trouble in explaining this to a novice.

Next I'll introduce yet another new word,  "funlay" = layer function.
And this thread can be retitled, "Doctor Funlay's Casebook"  :)
Sorry, that's just a bit of fun;
Let's stick with "cevo".

As for the most common layers,
when you open DCAD,  you are presented with a layer which is
cevo = 1110 = 14;

If you add an entity, you have 
cevo = 1111 = 15;

If not current, that becomes
cevo = 0111 = 7;

Maybe you later make that invisible, you have
cevo = 0101 = 5

You move to a new layer, add an entity, eventually lock it,
cevo = 0011 = 3

and maybe make that invisible as well
cevo = 0001 = 1;

And if there is no entity on those layers you also get

cevo = 0110 = 6
cevo = 0100 = 4
cevo = 0010 = 2
cevo = 0000 = 0.

See attachments, (the dcd has examples of cevo= 14, 7, 5, 3, 1, 6, 4, 2, 0) ....  cheers. sam

PS The macro adds letters eg "cevo" through to "NLHU",
where even Help\Layer Options defines layers as :-

(current or Noncurrent),   c or N
editable or Locked,    e or L
visible or Hidden,      v or H,
  and
(occupied or Unoccupied),  o or U.

PS talking V22.1 here, especially Help files, and manipulable dialogue box.
(2 cents)


prl

#28
Sam, CEVO 5 should have an unlocked icon?   And as far as I can tell, can only be achieved with the Unlock ALL button.


A summary:

States 4 and 5 can't be set by the programmer.  Only the "Unlock ALL" button in the Layer options dialog can set those states.  You can, however, read them.


States 8 to 13 - These states appear blocked and will always default to 14 or 15.


ps.  Sam, I was playing around with your example sequence and drawing.  In the past I was sure when you hit the lightbulb (to OFF), it would give you a state 1.  But you showed me otherwise.   Anyways, interesting.

samdavo

#29
prl
howdy.
Well, lol - if you look at my drawing, you will find I have achieved States 4 and 5 in that drawing.  And I assure you I didn't use Unlock All.

I had to play around with the sequence of lightbulbs and padlocks  (turning lightbulbs on and off whilst observing the effect on the padlock), eg  forcing "apparent locked" by closing a layer down with the lightbulb (edit)?! - and then clicking another layer, and then coming back to that layer - and only when the "editable" tick-flag came on (and the visible tick-flag was off) were you sure you had State 5 or 4 - depending on whether the layer was occupied or not.

  ALTHOUGH, to be honest I find I sometimes / often get the wrong State instead (?!)  eg I get layer 0 when I'm after 4 etc. 


And I had a lot of trouble achieving State 5 - i.e. when I achieved it with the file (tonight), I quickly saved it, and posted it lol.  Before it "self destructed" into States 0 and 1 etc instead of 4 and 5.  (2 cents).

Where is all this going?
I imagine a macro that makes a Hidden layer visible by simply amending the State (or vice versa) would be worth knowing about.   i.e. I still prefer macros to the Dialogue Box.  (2 cents)

PS I add the same jpeg I posted earlier which shows where you should look for the "edit" flag.

Note that, when you turn off the lightbulb for a State 4 or 5, - then you turn the lightbulb on again - you make the layer visible again ( obvious) - BUT ALSO the padlock miraculously changes to unlocked again - i.e. it was always secretly unlocked.    

i.e. This is consistent with :-
State 4 = cevo = 0100 = unlocked but Hidden, so you'd never know until you turn the light back on. 
State 5 = cevo = 0101 = unlocked but Hidden, (but occupied with entities) - so again you'd never know until you turn the light back on.