ok, I don’t have a file yet that isolates the issue, but boy I am in the middle of this project having a lot of layers and some layouts and I am getting layer objects getting mixed up. Exporting selected objects to a file and importing those objects back in another layout causing them to activate their previous layers and never really copying them, inserting, or pasting them. It’s just unhiding their original versions…
Identical to your image.
Yeah, it seems I cannot paste anything into an existing layer.
Hi Thomas - I guess I need the exact scenario, blow by blow, if it is repeatable…
-Pascal
It’s probably how Rhino always worked, but just now hit me hard for real.
-Make a layer active
-create a line in that layer
-select the line and CTRL+x to cut to clipboard
-Make another layer active
-CTRL+v
The objects never come to the active layer as expected. Maybe because I just spent a week in Illustrator copying and pasting objects between layers and Rhino’s behavior got me completely disoriented.
Same thing with insert. Exported objects always come in the same layers that exported them, not the one that’s active. My subliminal expectation was that once you copy an object to the clipboard it should be just geometry with no layer info.
Ah, OK - no, it has all of its attributes - it is really like Export/Import of the object in a Rhino file.
-Pascal
There ought to be a “copyPlainToClipboard” command that simply disregards (flattens all layer info) and origin layers and pastes objects as a pile in the current layer, with no questions asked.
Hi Thomas - it might help, in the short term at least, to make a PasteToCurrentLayer script like so-
import rhinoscriptsyntax as rs
def PasteToCurrentLayer():
rs.Command('Paste')
if rs.LastCommandResult()==0:
ids = rs.LastCreatedObjects()
rs.ObjectLayer(ids, rs.CurrentLayer())
if __name__ == "__main__": PasteToCurrentLayer()
Does that do anything useful?
-Pascal
Yes, it does help. Thanks !
Just a historical curiosity. Was Javascript ever considered as a scripting choice during the decision process to implement python in Rhino ?
The CopyToLayer command does what you want here (copying objects from one or multiple layers to another layer).