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 names during import and paste

Started by Dr PR, February 18, 2013, 11:37:46 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Dr PR

It would be nice if the program would pay attention to layer names when files are imported into an existing drawing, and when objects are pasted into an existing drawing. We should have the option to use layer numbers or layer names.

For example, suppose I have a drawing open with layer 3 named "Floor."

With the "Number" option objects just paste/import into the layer number corresponding to where they were in the original drawing. This is how DesignCAD works now.

With the "Name" option if I cut and paste objects from another drawing with a layer named "Floor" but where this layer is number 5, I would like the option to paste the objects either into the layer number 5 or to the layer with the name "Floor" (layer 3).

Likewise, with the "Name" option when I import another drawing with a layer named "Floor" I would like the option to have objects in the "Floor" layer in the import drawing to go into the layer named "floor" in the current drawing.

In both cases, with the "Name" option if objects are imported or pasted from a drawing with a layer name "Veeblefetzer" and there is no similarly named layer in the current drawing, a new layer named "Veeblefetzer" should be created using the next highest unused layer and the objects from the "Veeblefetzer" layer in the original/imported drawing should be pasted into that layer.

This would solve the problem of trying to move objects between files and have them arrive in the proper layers.

****

For imports this should be trivial. For cut/paste somehow the cut operation must carry with it the layer name list of the original drawing. This may be tricky, since the simple Windows cut/paste just copies the selected objects.

Phil
DesignCAD user since 1987

paulerens


prl

What Phil is asking for would be great  . . . .   and about twenty years late  . . .    but still needed now more than ever if DesignCAD is ever to share and import components.

samdavo

#3
Quote from: Dr PR on February 18, 2013, 11:37:46 AM
For imports this should be trivial.  For cut/paste somehow the cut operation must carry with it the layer name list of the original drawing. This may be tricky, since the simple Windows cut/paste just copies the selected objects.
Phil
Phil, I'm interested in why you say it should be trivial.  I'm assuming you are saying that a macro could be written which would
a.  import a drawing (alias symbol) with say "layer 5, floor"
b.  into a drawing with "layer 1 floor" and "layer 5 ceiling", then
c. interrogate the incoming layers and layer names, then ask the question which, then change to layer 1 or 5 as you direct, and load that layer (?)  (and so on to the next layer).

As for importing "copy and pasting", would it work perhaps  - as a stopgap whatever -  if one pasted first into a blank drawing, saved it, then imported the drawing as a symbol (as above)? 

And if that didn't work , i.e. if the cut or copy operation didn't bring layer names with it,  then I guess you'd have to delete everything else in the drawing being selectively copied or cut from - and what is left would have layer details intact, and could be saved as such - again as a symbol to be imported (?)

Just thinking aloud, and I haven't even checked if layer name is available as sys () function etc (?) - let alone the miriad other lines required for such a macro. 

Dr PR

#4
sam,

I said import should be trivial because the import file would have the layer names in it. I wasn't thinking of a macro, but a future change in the program code where the programmer has access to all the "innards" of the program.

I doubt that you can get into the import file with a macro to determine the layer names. However, maybe one of our macro wizards can figure out a way.

What is needed is a map of layer names and numbers in 1) the working file and 2) the import file. Then import objects can have the layer numbers changed (move to a new layer) to match the number of the drawing layer with the same name.

Phil
DesignCAD user since 1987

samdavo

#5
undoubtedly a bright red herring but...  going back a step ...
I often import XYZ files, (which incidentally I generate in a spreadsheet - ok I'll admit it, I use lotus 123, but DT has steered me towards creating comma-separated files with Excel)   and allocate them to layers  - and it wouldn't be hard to interrogate the layers as they are loaded up.

Now,  I imagine you could convert a drawing (which you want to import) back a generation to xyz , lol.
So you could import the LINES of a drawing  (and maybe lose the text - or maybe import as vectors... ?)

Please, macro specialists, think of something better than this :)

PS maps of working and import files are way beyond my philosophy,  Horatio. cheers samd

prl

Quote from: Dr PR on March 05, 2013, 09:20:26 PM
What is needed is a map of layer names and numbers in 1) the working file and 2) the import file. Then import objects can have the layer numbers changed (move to a new layer) to match the number of the drawing layer with the same name.

What Phil is describing is very simple to do internally and should have always been the way DesignCAD merged drawings including cut and paste.

I have macros that do this proper merging but they are awkward.  I have to open a second drawing, run the macro which copies all the layer names to the name field of the entities, then cut and paste into the primary drawing, run another macro that cycles the main drawing reading the name fields of the pasted entities moving those entities to the proper layers.

Way too many steps never mind overwriting the name field in case you were using it for something else.

prl

Quote from: samdavo on March 06, 2013, 01:25:45 AM
Please, macro specialists, think of something better than this :)

A few years ago, I toyed with the idea of creating my own DesignCAD file format, an ASCII text file format like the original DesignCAD files.  Something that can be loaded by any text editor.  Such files are easy to examine and manipulate with external programs or basiccad.

Problem with this approach is DesignCAD blocks and symbols are mystery entities with no documentation about how the entities they contain are stored.

My primary reasons for considering this was to fix the ubiquitous  DesignCAD merge/cache defect and also the layer index/name flaw.


samdavo

#8
I realise that this is not answering Phil's request/question, but my own drafting requirements would not need this level of sophistication.
i.e. I would get by with the following :-

a) layers have unique colours, (i.e. always the same layers have the same colours, eg layer 1 = white, layer 2 = red, layer 3 = yellow etc ) and
b) this would apply whether or not they have names,  i.e. whether or not white is called "layer 1" or "layer 1 white" or "layer 1 attachment interface" or "layer 1 ground floor" I guess, (in fact I have memorised them for my work needs as 1=a, 2=b, 3=c etc, where a= attachment interface, b=base, c=centre etc) and
c) if I want to add a feature to attachment interface (or ground floor etc) imported from another drawing using copy and paste,

then   
d) either I would set it up externally (in the source drawing, or maybe an intermediate step) to be in layer 1 and also white, and then paste it (most likely); 
e) or I would set it up to be in layer 1 at least, paste it, and run "layer to colour"
f) or I  would set it up to be white at least, paste it, and run "colour to layer".
Any which way, I would end up with all layers having my memorised colours.  After 20 years, that's the only way my mind can work I'm afraid.

Just another thought, if you have a lot of layers (I rarely have more than 6), then I guess one could keep a table on say layer 9 or 100 whatever, which is generally invisible, (or at least not printed), which records layer numbers and names and other notes.
(1.5 cents) 

Dr PR

What I originally requested would solve another problem with layer names that often arises. When you copy part or all of a drawing and paste it into a new drawing the layer names do not carry over.

This was a problem several versions back when copy/paste was the only way to pack group and solid IDs. However, DT and the programmers have solved this issue and we now have the pack commands.

Still, I sometimes want to set up a new drawing by copying parts from other drawings. When I do this I have to enter all of the layer names.

I work mostly in 3D so I don't use other layer properties like color and line style. I'm not sure what problems might arise and how they would be solved if line styles and layer colors were carried over in copy/paste.

Phil
DesignCAD user since 1987

Lar

Phil, what you can do (between now and whenever your request is granted) is select whatever you want to be copied to the new file but instead of 'copying and pasting' just 'save-as with selected-only'. This will save only the selected in a new file with all the layer setups, including any layer groups and paper space layouts.

Another way is laid out below but it only works in 22, I think, and it doesn't save the layer groups and paper space:

1]...if you have layers 'saved as default' already: open a new drawing, which will have all your saved layer names. colors and linestyles...
2] Open the file you want to copy from (do not close the first file), open the layer dialog and click 'save as default'...
3] Open a new file. This will open with all the layers info of the copy-from file...
4] Go back to the 1st file, open the layer dialog and 'save as default'. This will restore you regular layer info. You can close this file now, if you want.
5] Now you can copy the stuff from the 2nd file to the 3rd, both of which now has the same layer info (but no layer groups and no paper space).

Lar