Copy and paste to same location, but in different layer (v20)?
Hi, I have drawings with text and dimensions in Model space (a Text layer). I have 2 layouts in my template - one for US (Imperial) measurements and one in Metric measurements. Each layout viewports use VP Freeze to make sure that one printable layout shows all of the Imperial dimensions (only) and the other shows the metric (only) dimensions. I am converting a set of drawings into a set that has both systems of units in them as described.
I need to be able to turn off all layers but the one that has the Imperial text and dimensions in it, CTRL-A and CTRL-C to select all and copy to clipboard ... then need to be able to paste into the exact same position - but in a new layer, e.g. the metric layer. Then I can switch to the metric layer and edit (convert) the necessary values into Metric. The Layouts will then just be ready to print!
What sequence of steps and commands do I use to copy/paste to the same exact location but on another layer? Or at least to copy/paste to the same exact location but leave the pasted objects selected so I can use the Layers dropdown to move the selected objects to the other layer? I'm sure this is a common task, but I'm relatively new at CAD...
Comments
-
Got part of it figured out ... I didn't realize that just hitting Enter at the CTRL-V's 'Select insertion point' prompt would paste to the same location. I would be nice to paste into different layer though...
0 -
Got it ... thanks to @Eric Ratliff back in 2015 (paraphrased and added to by me):
- Make only 2 layers visible - the copy-from layer and the copy-to layer
- Press CTRL-C, then use whatever selection mode you want to select the entities that you wish to copy
- Press CTRL-V then ENTER to paste the copied entities in the exact same location in the SAME layer
- Enter SELGRIPS and then either press P then ENTER, or select 'Previous selection' from the SELGRIPS dialog box. This will re-select the original entities that you selected in #2 above. Press ENTER one more time to finish adding entities to the selection. Now, you will see all the grips (handles) show up and turn green (selected). Just the entities on the first layer are now selected, and none of the pasted entities are.
- Either in the Properties pane for your selected items or in the Layers dialog, select the destination layer to move the selected items to the destination layer.
- Done!
0 -
Under Autocad behaviors that sounds like a (or the) solution.
An in my other CAD (or any other App) that would be ...
for Layers :
- Select anything
- CTRL+C
- Activate new Layer
- CTRL+SHIFT+V (SHIFT for paste in same XYZ "place")
for Classes :
- Select anything
- CTRL+C
- CTRL+SHIFT+V (SHIFT for paste in same XYZ "place") pasted elements are now selected
- Change Class assignment in Property Palette
Who at Autodesk invented that losing a Selection,
without a user dropping it actively,
would be ever a good idea.0 -
An object's layer is one of its properties, just like its color and linetype. If you want the pasted objects to be associated with a particular layer, the easiest way is to give them that layer property before copying them to the clipboard.
To leave the pasted objects selected, you'd need a custom command, one that gets the name (it's a number, actually) of the newest object in the drawing, then executes the normal PasteClip command, and then selects all objects with a higher number/name than that, i.e. all the objects that were just pasted.
This one works for me, but I always work with PickAdd = Off. All my commands end with the newly created objects selected. If no new objects were created, then the command ends with the previous selection set still selected.
If you work with PickAdd = On, as most users do, you'd have to remember to cancel the selection set after assigning the layer property to it, to prevent a disaster. Or you could modify the code so that it does that automatically. For example, it could prompt the user for a layer, then execute the PasteClip command, then assign that layer to the selection set, and then cancel the selection set. Or maybe it could execute the -Layer command after the PasteClip command, with the Set option, and then Pause while that command is active, and then cancel the selection set with
(sssetfirst nil nil)
.You can change the name of the command to whatever's convenient for you. Whatever comes after the c: is the command name. Or you can create a short alias for PasteSelect, and/or a tool or keyboard shortcut or pull-down menu item for it, all by using the Customize dialog.
; _ssafter function by MP & Lee Mac at The Swamp (defun _SSAfter ( ename / ss d e ) (if (eq 'ename (type ename)) (progn (setq ss (ssadd)) (setq e (entnext ename)) (while e (if (and (setq d (entget e)) (null (member (cdr (assoc 0 d)) '("VERTEX" "ATTRIB" "SEQEND"))) ) ; end And (ssadd e ss) ) ; end 2nd If (setq e (entnext e)) ) ; end While (if (and (eq 'pickset (type ss)) (< 0 (sslength ss))) ss) ))) ; end Progn, 1st If, Defun ; ------------------------------------------------------- ; PasteSelect command = PasteClip with newly pasted objects selected (defun c:PasteSelect () (setq LastE (entlast)) (command "PasteClip") (while (> (getvar "cmdactive") 0) (command pause)) (setq NewSS (_ssafter LastE)) (if NewSS (sssetfirst nil NewSS)) )
0 -
Maybe some settings are different for different folks. For example, if I copy from one layer, change to another layer and paste ... the layer property stays the same, e.g. pasted entities still in the original layer.
Second, when I paste a set of entities, they do not remain selected.
The two reasons above are why my set of steps work for me. Once you select a large number of entities, copy and paste in the same location, the only way to select one set is to 'select previous' with SELGRIPS ... perhaps there's another way, but this is handy for all but the simplest (as in single entity) selections.
0 -
Yes, that is the way it is in Autocad.
And therfore in Bricscad too.
I just said that I am not amused about that behaviour.Maybe some settings are different for different folks. For example, if I copy from one layer, change to another layer and paste ... the layer property stays the same, e.g. pasted entities still in the original layer.
That is strange.
I did not try but understood Anthony's as :- Select object on current Layer
- Change their Layer to new desired Layer in properties
- hit CTRL+C
- Change Layer of originals, still selected, BACK to original Layer in properties
- then do Past in Place
Which should paste a bunch of geometry with the desired new Layer assignments ....
Not ?0 -
Michael,
In my first paragraph above, I assumed we were talking about copying and pasting from one file to another. For copying to the same location in the same file, I would've used the Copy command (picking the same point - any point - as both the from and to point) rather than CopyBase + PasteClip.
So I suggested changing the layer before using CopyBase, assuming that you would then close the source file without saving so that the objects don't change layer in that file. But your way would work too.
That's not how I'd do it of course. I'd use Copy in the same file or CopyBase + PasteClip between files, and in either case the new set of objects would be automatically selected and ready to be assigned a layer or any other property.
0 -
Ah... That makes sense. Yes, I am copying from one layer into another, same file... Same location coordinates, but copied entitled have the destination layer in their properties0
-
In VectorWorks and Photoshop, a layer is a kind of container -- a flat container with a geometric position, as the name suggests. Layers are usually thought of as being arranged above or below each other, like layers of paint, or layers of a cake or of the Earth's crust, and VW/PS layers are arranged like that. When you paste something in VW or PS you're pasting it onto the active layer, regardless of what layer the object that you copied was on.
But the Autocad system doesn't have that kind of layers. An AC layer is a non-geometric property of an object, similar to what VW calls a Class. You can't paste something onto an AC layer any more than you can paste it onto a color.
0 -
Try the attached LISP. It will duplicate selected dimensions to a layer of your choosing. Command is DUPEDIMS.
Regards,
Jason Bourhill
BricsCAD V20 Ultimate
CAD Concepts0 -
I do not think this was mentioned yet:
You can change the dimension style to also display alternate units.Be aware that copy-pasted dimensions are not associative.
0 -
Am I reading this wrong?
If you are on V20 then there is COPYTOLAYER, it isn't in the help file but if you type the command, select your entities, press Enter/Spacebar and either select an entity on a different layer or press Enter/Spacebar a dialog box comes up and you can select whichever layer you already have in your drawing and go from there.
If you aren't on V20 then the attached lisp and dcl does a similar thing.
Apologies if I am not understanding your requirement.
0 -
If you are on V20 then there is COPYTOLAYER
Ah, yes David.
I read about that in the feature list.
But instantly forgot about it again.0 -
When you paste something in VW or PS you're pasting it onto the active layer, regardless of what layer the object that you copied was on.
Yes, I miss that.
Which could be handy or even logical in IdahoDixons special
situation (?)
(At least when the Copies use a single Layer only)Hmmh,
But I think there is some inconsistency in Bricscad or Autocad
about auto-changing assignment to active Layer.I am not 100% sure (?) but at least I always run into problems
when repairing imported geometry.
Therefore, for some time I really thought that Bricscad would
always assign geometry to active Layer, no matter what edits you.Meanwhile, I think, generally Bricscad does follow a standard logic.
1.
If you create something new,
it will get the active Layer assigned2.
If you manipulate something already existing,
it will keep its original Layer assignment,
no matter which Layer is currently activeHere an example where that fails.
"Repairing" Meshes, 3D Faces or surfaces to get proper Solids,
by common Explode-Region-Stitch-Simplify workaround.You think you would manipulate only and not creating something new.
But "converting" Faces to Regions for Bricscad is creating something new.
("Create Region")
And it will change asignment to current active Layer.So if you do not really care,
when running through your Import on a Layer by Layer base,
in very short time you will screw up your file by accidentally
moving large parts of your geometry to Layer "0".While caring about correct Layer activation is tedious in itself and
cumbersome by the way Layer activation is restricted by warnings.And I am not sure about several other situations,
like when extruding a Face and such ...
Is it still a manipulation or already a creation.So to stay save, I currently adjustt active Layer always to object Layer
before I do anything.0 -
@Michael Mayer, @David Waight - Thank you! I will definitely look into the CopyToLayer in v20 - Didn't know it was there!
@Jason Bourhill - Thank you too! Perhaps on dimensions, the idea is to copy to layer then change units to metric (thanks, @Roy Klein Gebbinck ) - I will try this. For dimensions mentioned in text, I will still need to manually edit those after the copy.
And thanks to all. I really appreciate all the support!
0 -
@David Waight said:
If you are on V20 then there is COPYTOLAYER, it isn't in the help file but if you type the command, ...It is available in the Help now.
https://help.bricsys.com/hc/en-us/articles/360012980719-CopyToLayer0 -
Thanks Louis for the quick response.
0 -
Thanks ... I just tried the new CopyToLayer - works perfectly for me.
0 -
CopyToLayer was one of the commands I'd really missed, as I've never managed to get the old Express tools to load properly in BC. Glad it's back, with useful-looking selection options, too. However, one nice feature now lacking was the ability to type the name of a new target layer, which if not already existing would be created on the fly.
(The other Express Tools command I wish would get resurrected is LAYVPI, to isolate the layer of a selected entity in a viewport by freezing it in all the other viewports.)
0 -
If you can see an entity on the destination layer, I wrote this function a long time ago that "move the entities in this selection set to the layer of the entity I pick":
(defun C:LC(/ source target) (setq source (ssget)) (setq target (entsel "Select destination layer: ")) (command "CHANGE" source "" "p" "la" (cdr (assoc 8 (entget (car target)))) "") (princ) )
0 -
Steve ... thanks. In my case, the new layers are entirely new. I have a set of about 100 drawings that were all created with Imperial units and they are (actually done now) being converted to Metric. I added TEXT-METRIC and DIMENSIONS-METRIC layers, used CopyToLayer, and for dimensions, I used my newly defined dimension style for converting to millimeters. For the text, nothing for it but hand editing the embedded values... But, I'm all done now and have both an Imperial and Metric layout to produce the 2 versions of the drawings.
0 -
COPYTOLAYER is good for moving geometry to a known layer name, especially if created a new layer for specific geometry to be moved to. We have all done that.
Whereas Steve's lisp routine is more efficient if one doesn't know the name of the layer, but wants to match to ext'g geometry layer; saves a dialog box & a click (& that's not counting the Properies or List methods).
There is a use for both, depending on the circumstances; nice to have options.0 -
MDunn ... Yup, and I did save his lisp routine and plan to give it a try ... I appreciate it.
0 -
COPYTOLAYER is good for moving geometry to a known layer name, especially if created a new layer for specific geometry to be moved to. We have all done that.
Whereas Steve's lisp routine is more efficient if one doesn't know the name of the layer, but wants to match to ext'g geometry layer; saves a dialog box & a click (& that's not counting the Properies or List methods).
There is a use for both, depending on the circumstances; nice to have options.Yeah, pretty much all my stuff is command line - written in the early 90's when that's all there was!
0 -
Version 19 did not seem to have COPYTOLAYER. 20 does.
0 -
@Eric Ratliff said:
Version 19 did not seem to have COPYTOLAYER. 20 does.But the free Express Tools has it, at least since v16.
0 -
This worked perfectly for me, thank you!!!!IdahoDixon said:Got it ... thanks to @Eric Ratliff back in 2015 (paraphrased and added to by me):
- Make only 2 layers visible - the copy-from layer and the copy-to layer
- Press CTRL-C, then use whatever selection mode you want to select the entities that you wish to copy
- Press CTRL-V then ENTER to paste the copied entities in the exact same location in the SAME layer
- Enter SELGRIPS and then either press P then ENTER, or select 'Previous selection' from the SELGRIPS dialog box. This will re-select the original entities that you selected in #2 above. Press ENTER one more time to finish adding entities to the selection. Now, you will see all the grips (handles) show up and turn green (selected). Just the entities on the first layer are now selected, and none of the pasted entities are.
- Either in the Properties pane for your selected items or in the Layers dialog, select the destination layer to move the selected items to the destination layer.
- Done!
0