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.

prl

#45
Quote from: samdavo on July 25, 2014, 07:07:40 AM
In fact, what I was aiming at was a macro that unlocks all VISIBLE layers.

.
.
cl = sys(3) 'current layer
nlayers = 1000 'number of layers you want to cycle through.  Set to what you use.  No reason to waste CPU time if you only use 100 layers.

sys(36) = 2 'turn off annoying update on layer toolbar as you do the loop
for i = 1 to nlayers
    y = layer(i)
    if ODD(y)=1 and ODD(y\2)=1 and ODD(y\4)=0 then 'layer has entities, is visible, is locked
        Layer(i) = 6 'make layer visible and unlocked
   endif
next i
sys(36)=0
sys(3)=cl
.
.


prl

If you want to unlock all visible layers regardless whether they have entities on them or not, use

if ODD(y\2)=1 and ODD(y\4)=0 then 'is visible, locked

samdavo

#47
Thanks yet again prl,
works like a dream. (reply #47).

PS Right now the pantry is unlocked, and, having run the amended a.d3m macro,  I have (likewise) selected everything visible and edible.  See ya :) 
(edit - I should have said "I have (likewise) made everything visible edible".

ok (burp) back.
I post an example of a steel plate that is required to be painted around its margin differently to the majority of the top.   i have used qs2.d3m of course -  in fact qs3.d3m, which gives me more chances to turn the black "selection" lines on and off on a trial and error basis.   But what I was wanting to point out is that the drilled holes (shown red, layer 2) would be almost black if they were selected, due to the many facets, hence I have locked layer 2, so that qs3 with Ctrl+A  doesn't select it (2 cents). 

And of course, once set up, I have used BobP's savv.d3m to save (and rv.d3m to retrieve) that view of Lock-and-Look-Status of those layers. :)  Brilliant stuff.

PS I enclose the final drawing of that plate (as I have said a few times, most of my drawings are pretty simple, but this is one of the simplest).  I do the drawing as 2D, then as required (20 % of the time) I change to 3D and extrude the plate and drill it etc - then take an isometric screensnip and change back to 2D - the 3D (extruded) version of the plate is still there in the background,  circled blue, (and isn't included in what is printed) - but after changing back to 2D, I simply add that isometric view as an image.   I find it easier than paperspace.  (2 cents)

bobl

The above looks great and thanks for making me aware of all these possibilities. Layers are a big one for me now that you've (collectively) helped me up the learning curve a bit so...thank you all for posting the above questions and solutions.

samdavo

#49
Dean
Just a quick note about that grey-and-cyan-plate-with-red-holes, (layers 8, 5 and 2 resp, using my colour system)
when you get around to drawing solids and subtracting bits like those holes, then you will find that if you are using a set of red "pencil-shaped" cylinders for the drilled holes, and subtract that solid from the solid (grey) plate, you will be left with a new solid with red holes.

But suppose you want to change the colour of other bits of the new solid (drilled plate).

Then you can explode the solid ( eg using Infobox) and change the colour (and layer) of the other planes as required.  You can always round up those plates planes again later, and define them as a solid again with Ctrl+D.  But equally you can leave them as a set of planes. Cheers 

bobl

>...Then you can explode the solid ( eg using Infobox) and change the colour (and layer) of the other planes as required....and define them as a solid again with Ctrl+D
Blimey!...Thanks.

samdavo

#51
PS Some prefer to always have a single object (eg a solid) on a single layer.  To do that you would just change the colour of eg the holes to red, and the margin to cyan (without changing the layer).   

Now... using qs2 and/or qs3, you need to be able to stop some colours eg red, from being selected (otherwise the holes with their many facets appear almost black).  I do that by having a solid with multiple layers- and then locking layer 2.   Some would say that's the tail wagging the dog .

OK, so I experiment some more :)  I notice that a multicoloured solid that was formed by exploding into planes, then just changing the colour of some of those planes (not their layer) - but double-checking that, at the end of the day, all planes are in the same layer, say layer 8 for instance  - and re-defining the planes as a solid again  (using Ctrl+D) - that you can still select all colours other than red, simply by using the selection filter. (see first jpeg - again the red hole is not selected by qs3.d3m).

PS for those not familiar with qs2 and qs3, they change the selection colour to black - with the objective of adding black lines to delineate the various planes - see jpegs.

Note that the second jpeg shows red selected as well, and hence the many black lines on the multi-faceted hole. 
In each case, I have used Ctrl+D to (re)define the solid, yet I am able to selectively select coloured planes within those solids. 

(edit) actually I suspect a few more rules at play - it seems to depend on which solid was subtracted from which - and maybe the sequence - and not quite as simple as just "use colour selection filter to split up a solid". Hence I'll probably stick with exploded solids and layers.

But for me, it is easier to always use layers - and their colours - assigned at the same time (locking and unlocking them using macros) - rather than "selection filter" and effectively locking and unlocking colours that way.   (Also please remember that I only do simple drawings with a few layers - and the advice you get from the architects around here will doubtless be different to mine)
cheers       
sam

bobl

>and the advice you get from the architects around here will doubtless be different to mine.
It sounds pretty good to me!