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.

bobl

Now I'm a bit more familiar with DC and using layers more and more I find my self wanting to switch between layers and change which layers objects belong to at the speed of light (or close :) ). That sounds like the command line to me and I'm just wondering what the advice is re this...

I also note that although I assign colours to layers...if I switch an object to belong to a different layer using the info box...ctrl/i  I still have to manually change the colour. Is there a way to have this done automatically?

Thank you in anticipation and FWIW my initial delight re using DC hasn't wained any!

prl

#1
Dean,  anyway you want it . . . .

BobP has some great layer routines http://www.wwslalom.net/dc/layers.zip or decide how you want to work, and I'll help you with the basiccad code.

Example: You could select a bunch of objects and type H 12.  All selected items become blue.  You type H 13, all yellow.  Basically you define a color table and use the H (as in Hue) routine.  The number is the color argument, the selection set is the target.

Or you select a bunch of items and type   2L 15.   meaning " to layer 15".  etc.  Roll your own names, behavior.

Check out what BobP has done and maybe pick a simple "goby" as a starting point for the upcoming Bobl layer suite.

samdavo

PS Dean-bob,
I am guessing that BobP doesn't use "assign colour by layer".
The reason I say that is that the sort of manipulation macros in prl's post (written by BobP) are (imo) best left in full control - not with "colour by layer" ticked , which just causes a "clash of control-titans".

If you have colours assigned to layers, then
Q\layers \clear preset colours \apply or ok
should sort that out.  ( 2 cents)

Bob P

#3
I do use color-by-layer, using an external rgb table.

The layer suite: http://www.wwslalom.net/dc/layers.zip

The colors.txt file within contains the color maps.

bobl

prl, Sam and Bob...
Thanks very much for your advice re this and I'll have a good look at that zip (I won't be able to do it justice until tomorrow now). I'll also watch and record the sort of things that I'm doing as a basis for some basiccad and thank you very much for the offer. Good to talk to you all again.
Best Regards
Dean

samdavo

#5
BobP,
You say you do use assign by color.  Thanks for clearing that up.

I do it slightly differently, and probably more complicated and 20th century.

Whenever I change a selection to a new layer (using a macro), it automatically assigns a colour (unique to that layer).
Since I only use max 9 colours, it is pretty easy. 
I can look at a drawing, and I know which line or entity is in which layer ( possible exception of groups and blocks :)  )

Just chewing the fat here ok?
If you use the primary colours (which I do) :-
layer 1 = white (or probably better black)  rgb =  255,255,255 or 0,0,0   (I think DT recommends 0,0,0 if exporting to ACAD)
layer 2 = red,  255,0,0
layer 3 = brown,  255,170,0 (I used to use yellow but it's useless on white background, or when printed on a laser printer)
layer 4 = green,  0,255,0
layer 5 = cyan,  0,255,255
layer 6 = magenta,  255,0,255
layer 7 = dark blue,  0,0,255
maybe add grey ( 8 ) and purple (9)

then
1. you have a rainbow of sorts
2. and  (as I understand it) these are similar to the first 7 layers of ACAD (relevance?  maybe I should investigate that further, beacuse I would like my drawings to be easily read when exported to ACAD)

also
3. you can add pastel versions of those layers - and add 10, so that
layer 12 = 255,85,85 is pastel red etc.
4.  and in the end you can pretty much memorise your layers, and hence look at a drawing and know which layer an entity of line is in.

GREYS
5. As for greys, I post an idea for comment.  Firstly I find shades of grey real handy when you draw a steel plate with various machined features on it, and the lighter shades can show where milling occurred etc  ( or brighter reds etc, but unrealistic).  hence...
6.  If you assign layers 21 to 29 such that the
layer 22 is near black - call it 5% white  10,10,10
layer 23 is about one sixth white , i.e. 40,40,40

and the other layers progress in 40's so that
layer 24 is 80,80,80
etc
and so on until the dimming switch is fully turned on and you have white 

Just thinking aloud ok?
(PS in the attachments I choose black background, and naturally enough pure black shows up as white, where 10,10,10 shows as near black (2 cents) )
   
PS Maybe I'm lucky, only doing engineering drawings, but 8 layers or 30 absolute max (!) are more than enough for me.   (even if I get imaginative one day, and use, say, layer 12 for a hidden version of layer 2 for instance - being a ghostly pastel shade of the same colour :)  - anyway I imagine I could somehow associate layers 12 and 2, just not sure how yet lol)

(edit) I enclose a corrected dcd file, - with the layers of the lines corrected.

samdavo

Quote from: samdavo on July 17, 2014, 02:09:16 PM
2. and  (as I understand it) these are similar to the first 7 layers of ACAD (relevance?  maybe I should investigate that further, beacuse I would like my drawings to be easily read when exported to ACAD)

Could anyone who is familiar with ACAD advise please if it would make more sense to have layer 1 = red 255,0,0  etc - to better suit ACAD automatic layers (as I understand them to be)?

i.e. would an exported drawing look better if I matched ACAD layers ( at least for the first 7 or 8 "primary colours")?
thanks
sam

samdavo

#7
Quote from: Bob P on July 17, 2014, 07:47:18 AM
I do use color-by-layer, using an external rgb table.
The layer suite: http://www.wwslalom.net/dc/layers.zip
The colors.txt file within contains the color maps.
Bob P
ok, I suspect a misunderstanding -   I meant using the "Assign Color" in Q\Layers  (and you are talking what is assigned if you use your L.d3m macro I believe (?).

Just that I thought I detected in Dean-bob's original post that he was using Q\Layers,  viz :-
(edit) - and I suspect that would clash with even your method ? - please comment if I am wrong.

Quote from: bobl on July 17, 2014, 02:22:21 AM
I also note that although I assign colours to layers...if I switch an object to belong to a different layer using the info box...ctrl/i  I still have to manually change the colour. Is there a way to have this done automatically?

PS I'm guessing (?) there is a way to do this, but I can tell you that this doesn't work :-

suppose you have a drawing with colours and layers randomly scattered;
and you go to Q\Layers and "assign (unusual) colours to layers" and "apply/ok" (eg an upside-down rainbow) ...

then I personally can't find a way to force the layers to behave in retrospect  (i,e, for the colours to change to the upside down rainbow). 
I tried "Options\Colour by Layer" (on Menu bar) - but that doesn't work.
2 cents

Bob P

It's been a long, long, time but my colors probably date back to the original 15 (?) ProDesign colors.  Back then my experience with AutoC*d was nil, so I never knew whether there was a "color standard' at all.  Now that I think about it, DC changed a couple of colors in their standard pallet around V5 or V6 and I edited that DC color file to match their earlier "standard".

samdavo

#9
PS prl and /or BobP
I have decided that I will write a macro to change the colour of layers before I export to .dwg files (for ACAD).
(edit) and maybe delete any hidden layers in the process.

After all, if you and minstrel can rotate everything 90 degrees in order to export to SketchUp, that's simple by comparison :)

But no way can I get my subconscious to accept that red is really layer 1 ( not 2) :)

http://www.firstinarchitecture.co.uk/autocad-line-weights-colours-and-plotstyles/
gives the colours as per the first jpeg. (red = 1 etc)

PS The second jpeg gives the same set as your website in the next post.

PS I should add that I have no idea what the latest ACAD colours are in truth.

PS  (edit) Back in reply #5, I have enclosed a corrected dcd file, - with the layers of the lines corrected.

Bob P

Here is the color pallet that I used.  I think that color 7 and another color were exchanged in later DOS versions.

bobl

#11
Ok...
l.d3m rapidly re-assigns an object to a different layer (changing the colour along the way so...that's one done (Many thanks Bob P!)

I can run it from the menu option "macro execute" but not from the command line...
% l_dean 5    i.e. l_dean is just l.d3m with the path to colors.txt changed
...despite my having changed the macros directory path in options/options/file locations to point at the .d3m. I'm missing something obvious aren't I? :)

While we're about it the original path for macros in file locations is...
"C:\Program Files\DesignCAD Pro 2000"
Do you folks empty all of your custom macros into your central macro directory or do you have a way of organising your macros into sub-directories i.e. wouldl the % command search all sub-dirs under "C:\Program Files\DesignCAD Pro 2000" if I wanted to keep things separate?

The other thing I wanted to do is...quickly swap visibility between two layers e.g. to repeatedly compare as-is-window frames/holes with the proposed ones.
It seems to me that this might be a combination of Bob P's...

Program: subv.d3m
Removes a layer group from the current view
followed by...
Program: av.d3m
Adds a layer group to the current view

eg swpv.d3m <layer to hide> <layer to unhide>
Can you make a macro by calling two others?

samdavo

#12
BobP
I like your macros, but have a question.

you say that
a) savl.d3m saves the current layer state (visibility and editability)
b) rv.d3m retrieves it ( great !)

However, do you really need
c) av.d3m ( add  to savl) and
d) subv.d3m (to subtract from savl) ?

i.e. I would have thought you could change the "layer state" (longhand, or using macros), and simply use/ rewrite savl.d3m to update it to the latest data (?)

PS On a really minor point, you say that cl.d3m "makes the layer of the selected entity the current one" -  very slightly ambiguous, and  I'm gonna remember that as " sets the current layer based on the colour of the selected entity" :)   

Anyway congrats on those macros.
sam

samdavo

#13
Dean-bob,
I'm fairly sure that most people save all their dcd's in one directory ( eg I use C:\2000dc\A4\  )
and likewise all their macros ( C:\2000dc\macros\ ).

That way, you get V19, V22 V23 etc, and they all work on the same drawings and macros.

(I personally put keyboards, and workspaces, and materials and views and custom toolboxes etc etc in the same directory with the macros.
And I also put symbols with the other drawings, so there are two main subdirectories).

I would be careful renaming that L.d3m file, but I'll let you experiment with and without the change.

When you look at L.d3m, (about line 20),  it searches for the colour template  on "d:\dc15\macro\colours.txt".
And I'm guessing that it would be far simpler to put it in the same directory as the macro itself (although I might be wrong).  - and to amend L.d3m accordingly.  (2 cents)

I'll let the experts comment further.  cheers.

PS I'm fairly sure if you have the correct "Q\File Locations" set to find macros, then the next time you tuen DCAD on, you will be able to type those commands on the command line.  Of course,   if there is a clash, eg "L" might be already assigned (in custom.ini), then it may not do what you expect.

PS I'm looking forward to playing around with those macros of Bob's -  customising them if you will -  and given that I plan to hide construction lines etc in layers 11 to 19,  then I might have a macro "Hteens.d3m" which hides all the teenage layers :)  - just for instance.   cheers


Bob P

Quote from: samdavo on July 18, 2014, 05:44:38 AM
Dean-bob,
I'm fairly sure that most people save all their dcd's in one directory ( eg I use C:\2000dc\A4\  )
and likewise all their macros ( C:\2000dc\macros\ ).

That way, you get V19, V22 V23 etc, and they all work on the same drawings and macros.

In fact, many of my macros that work in V15 don't work in V23, mostly because the number of layers available increased in later versions.  I keep my V15 macros in a different folder than the V23 macros.

Quote
(I personally put keyboards, and workspaces, and materials and views and custom toolboxes etc etc in the same directory with the macros.
And I also put symbols with the other drawings, so there are two main subdirectories).

I would be careful renaming that L.d3m file, but I'll let you experiment with and without the change.

When you look at L.d3m, (about line 20),  it searches for the colour template  on "d:\dc15\macro\colours.txt".
And I'm guessing that it would be far simpler to put it in the same directory as the macro itself (although I might be wrong).  - and to amend L.d3m accordingly.  (2 cents)
That IS the macro directory for V15 (back when I posted all the macros).  Since I have 5 working versions of DC, I now keep the V15 macros and V23 in separate directories in the root of d:.

Quote
I'll let the experts comment further.  cheers.

PS I'm fairly sure if you have the correct "Q\File Locations" set to find macros, then the next time you tuen DCAD on, you will be able to type those commands on the command line.  Of course,   if there is a clash, eg "L" might be already assigned (in custom.ini), then it may not do what you expect.
I've been using (and automating) DC since V1.  I think I've got a good handle on file locations by now, having written over 200 original command-line macros.  None of them require a path on the command line since the path is set in the program preferences.