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.

layers shortcuts

Started by bobl, July 17, 2014, 02:22:21 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Bob P

My layer suite pre-dates DesignCad's native "Group Layers" by about 15 years.  it originated in the DOS days.

I just checked out DC's system for the first time.  I have no idea how to work with it.  ???

bobl

Wow this is amazing....and there was me thinking I was getting on ok with layers...
This is a whole other level...Thank you very much for writing this stuff.

samdavo

#32
BobP
Trust you don't mind, but I have twigged your macro (L2.d3m enclosed as a zipped file).
a) It now uses my colours (trivial and easily customised by anyone - great idea),
b) based on the file colours.cus, (also enclosed), which should be saved in same directory with the macro

c) it warns you that a selection will be changed ( which doesn't Undo)
d) but most importantly, if it simply changes layer, then it also changes to the corresponding colour - otherwise any new lines would be using the previous colour. (2 cents)

I believe that cl.d3m should also have feature d) above.
cheers
sam
 

samdavo

#33
PS Further to the post above,
Suppose you don't select something, i.e. you just want to change layers - (which is where there is a difference between BobP's L.d3m and my amendment,  L2.d3m).
Then when you run  L2,  and change the current layer to say layer 5 (which I associate with cyan),

you will note that the number in the layer toolbox changes to 5;
and also the colour in the main toolbox changes to cyan.
(Sorry if this is coming across as super-basic, but I would personally have a major problem if colour didn't change with layer number) (2 cents).
 
 

bobl

Enhancing BobP's brilliant macro to change colour is exactly what I was looking for. I previously thought L.d3m did this but on closer inspection what I thought was a colour change was just a coincidence :) Your change layers across the board is also very useful to me.
Thank you very much and I too hope BobP doesn't mind.

samdavo

#35
Dean
sorry I note there are still some bugs there - I will post a corrected version later.
sam

ok  I have corrected the macro , (still called L2.d3m) and changed the one  attached to my earlier reply #34 to the correct one. - refer back there. (the correct zipfile is "colours (4).zip")

PS I have added another feature. 

Now, suppose you run L2 without anything selected.  Then
a) current layer changes to that layer
b) complete with the colour for that layer (for any lines /entities drawn thereafter) , and
c) a new feature,  the selection rubberband also changes to that colour

Why add the third feature? it reminds you what colour and layer you are in "WITHOUT taking your eye off the ball-point" (2 cents).
- PS try it by simply dragging the selection "rectangle".

Example, if you run "L2" on the command line without anything selected
and you choose layer 4 (lime green)
then you end up with 
a)  layer 4 in the layer toolbox
b) lime green in the main toobox ( but not in the normal field of view), and
c) lime green when you leftclick and drag ( i.e. start a selection rubberband box) = visible at the "coalface"

(edit) To be honest I don't even use the Layer toolbox - nor do I look at the main toolbox.   As soon as I see the colour of the selection rubberband I know what layer is current.   That goes for drawing some new entity, or for selecting that layer. 

The only thing missing with that "philosophy" is that you don't know if you have "manipulate all layers, mall"  or "manipulate current layer only, mclo".    Personally I previously liked to change the rubberband to dark purple  for "mall",  and also, whenever I changed to a new layer, I liked to lock all the others.   However BobP's suite of macros seem mighty powerful, and I might try them for a while :)

samdavo

#36
Dean
I am gonna assume that you are pretty new to DCAD macros (safe assumption? lol)
and I'll post some simple macros for changing background colour, and changing the selection colour.  (edit partly triggered by recent discussion of prl's macro qs2.d3m)

A. BACKGROUND COLOUR
Personally I change between background colours all the time.
I usually use black background for "working mode" ( nite.d3m),
I sometimes use white background - maybe to show black lines rather than white  (day.d3m)
Rarely use grey background (grey.d3m)

But for presentation purposes with 3D shading, I use off-grey (qs3.d3m)  with black selection (for outlines) - (which is a simplified version of prl's qs2.d3m).

B. SELECTION COLOUR
qs3.d3m is both a background colour - and ALSO a selection colour.  (strictly short for "quick shade 3")
As soon as I use qs3.d3m (which I have intentionally set to leave the selection colour as black, so that I can add and subtract entities selected to attract black outlines there)...  then I have to have a way to reset the selection colour.

I have therefore made two new macros
ps3 = purple selection 3  (my normal selection colour)
ys3 = yellow selection 3. (only if I am in layer 9, - which is that colour) = rare

Hopefully this makes sense - If nothing else it has forced me to put my ideas down clearly - for my own benefit  :)
cheers
sam 

looking for rocket science?   (maybe prl or Lar or BobP or Phil etc will oblige next week lol)

PS Just to remind you how good qs2.d3m and qs3.d3m are, I add a drawing of my weekend project called laundry shelves that I did when the forum website was down :)

samdavo

#37
Dean
Here's another (real basic) trick.  Suppose you want to select both layers 5 and 6, and only them.
You can do that using the Layer toolbox, by making both of those layers the only unlocked layers, then drag the selection box,  or maybe use Ctrl+A.

But another way that doesn't use the Layer toolbox is :-
a) make just layer 5 unlocked (and obviously current), and drag the selection box
b) leave the selection alone, and "alive", then   
c) make just layer 6 unlocked (and obviously current), and drag the selection box again (edit - with Shift pressed) - and you end up with both 5 and 6 selected (2 cents)

PS I am thinking I will have to amend that macro L2.d3m  some more, because I really miss the fact that when you select a new layer, it doesn't lock all the others.   

PS I add that macro - called L3.d3m ( that locks all other layers up to 255 ).  Hopefully I haven't made too many errors. 

PS OOPS - lol .  That doesn't work, (edit - it does now that I've changed it)  because when you try to use L3 to change to layer 6, it finds that you have a selection, and changes that instead.

OK, to make it work, I have had to simplify L3.d3m so that it ONLY changes current layer (and colour and rubberband) - and lock all others,  and doesn't change the layer of a selection.
Then you can
a) use L3 to make layer 5 current and the only unlocked layer, and
b) select only layer 5
c) then use L3 again and make layer 6 current and the only unlocked layer, and
d) add that to the previous selection, ( so that you end up with both layers 5 and 6 selected) 

But if you want to move a selection to a new layer, you have to use L2.d3m.

bobl

#38
I just popped in to see if there was any response to my last post.
Wow Sam!
Loads of good stuff there and right up my "street" from the looks of it!
Your assumption re my skills is of course spot on so...
thanks for bearing that in mind in your explanations.
I'll have a good run at this stuff in the morning when I'm at my sharpest and thank you very much indeed for taking the trouble i.e. it's very much appreciated.

bobl

Actually I couldn't resist....that L2 works great :)

samdavo

#40
Dean
Bob P kindly posted this list of Sys and Sys$ functions for V21 (see zip files attached).

However...
Previously he also posted them for V17.  And those are easier to search (using Ctrl+F).  (and presumably not much different)

Quote from: Bob P on February 14, 2007, 10:56:24 AM
Searching in the help file is sometimes less than ideal, I've created a PDF file with the SYS AND SYS$ listing.

Find it here.   

Crackerjack - You're welcome to put it on your site, of course.

Just FYI and amusement.

samdavo

#41
  (edit) Replies #47 and 49 amend/correct the macros mall2.d3m, mall3.d3m - to what I was personally targetting anyway, reposted as a.d3m ;  = "unlock all visible layers".  Whilst I am it, I will only use purple as the selection rubberband for this macro , and delete reference to yellow.  I have deleted mall2 and mall3 as attachments in the next emails

Whilst I am at it, herewith a slightly amended version of BobP's mall.d3m  ( trivial amendment)
Manipulate all layers. mall2.d3m

which sets the selection rubberband colour to yellow.
Since none of the layers in my colour system are yellow, then when I see a yellow selection rubberband box, I know I am in this mode, and that I am about to select all visible layers.     No change to hidden layers - they remain hidden (as per his macro).


To summarise then.
If you want to know exactly which layers you are about to select, then use L3 and mall2.  a.d3m - which uses purple selection rubberband .
The colour of the rubber band box will tell you.
- i.e. if it is a layer colour ( = that layer, all others locked)
or if it is yellow purple (= all visible layers).

PS I personally don't use mclo.d3m - I just reset the current-and-only-unlocked-layer to what I want. 

But if you want to move a selection to a different layer, use L2.d3m.   
Likewise, if you just want to change current layer without locking all others, use L2.d3m. 
cheers
sam

PS of course there are other options in BobP's suite, namely the savl, av, subv options etc.

samdavo

#42
Dean
Minor addition to the previous post ...

In fact I use dark purple for "manipulate all layers",  (and yellow rubberband doesn't work too well with white background, although it's fine with black or grey)... 

And I enclose mall3.d3m to be consistent with this thread, and to use this purple colour instead.

This colour is the same as layer 9 - however, because I "never" use layer 9, that doesn't matter (2 cents)


(Incidentally, for manipulate all layers, I use a similar macro called a.d3m, and hotkey "a" to trigger that - hence "a,   Ctrl+a"  selects everything.
see replies #47 and 49 for latest version, including "unlock all visible layers'

and I also have macros 1.d3m for layer 1 only,  (hotkey = 1);   2.d3m etc etc;  also sto4.d3m for "selection to layer 4" etc - all as per prl's suggestion way back in this thread)     

bobl

Sam...thank you very much indeed for making this stuff so accessible to me and to Bob P for writing that sys help in the first place. I'll need to play with L3 to see exactly how it works but L2 is already "doing it" for me.

I'm back on implementation now (sourcing acros strong boys and lintels) but will need to punctuate this with CAD sessions to design/confirm things so hopefully I'm not going to lose what familiarity I've acquired.

All in all thank you very much indeed.
Best Regards
Dean

samdavo

#44
ahh heck,  I might need some help here.
I find that mall2.d3m (like mall.d3m) only "enables multilayer editing"  (whatever that means??)  At least that's what it is doing tonight.

But I don't think it unlocks all layers after all.  (Please feel free to set me straight on what that means)

In fact, what I was aiming at was a macro that unlocks all VISIBLE layers.

Mall.d3m  uses sys(26) = 0 
Quote
' Program: mall2.d3m
' Edit all layers - possibly screwed up by samdavo 20140724

sys(26) = 0
   message "Multi-layer editing ENABLED"

'set selection rubberband to purple (samdavo)
sys(324)=130
sys(325)=0
sys(326)=255

I can imagine how "sys(26) = 1" might "disable multilayer editing" - and that would reliably lock all other layers.
And I assumed that sys(26) = 0 would be predictable and unlock all other layers - (at least the visible ones).   

Needs more work / checking / knowledge.

PS I have always used a macro "a.d3m" which makes ALL layers both visible and editable. (added below, old-fashioned version).

and - just trying to start using hidden layers - I figured the ideal thing would be if that only unlocked visible layers.
- and I need to do some more research - and modify that a.d3m macro.

Quote
'macro a.d3m sets all layers to be visible and editable
'also the selection rubberband to purple
'as also the selection and cursor etc etc

for j = 0 to 2000
layer(j) = 6
next j
layer(sys(3))=14
sys(26)=0

'point =purple
sys(312)=130
sys(313)=0
sys(314)=255

'cursor =purple
sys(331)=130
sys(332)=0
sys(333)=255

'set rubberband = purple
sys(306)=130
sys(307)=0
sys(308)=255

'set selection rubberband to purple
sys(324)=130
sys(325)=0
sys(326)=255

'selection to purple
sys(315)=130
sys(316)=0
sys(317)=255