I’m working in a worksession combining 3 parts of a design.
Each parts has it’s own set of 2D parts laid out.
I expected to be able to select all these (so including referenced geometry) and export it.
Is it an option to make this possible?
Export selection including geometry selected in Worksession reference files?
Sorry for digging that topic out… but even 5 years later, that feature would be pretty useful
I work on architectural projects and I’m used to store the projects gridlines into a separate rhino file, which I attach to all other files of the project.
It becomes not so handy by exporting things for clients, as the grid won’t export. It would be really neat, if attached files could behave like all other layers and be exported with all the rest if selected.
@jeffoulet I think I’d see about getting all the object attributes, then copy the object into the current file and apply attributes, making the required layers and materials for it if necessary, then export all of the objects in the usual way. And then a big Undo or Delete after,if needed.
Quick and dirty test to copy objects from an attached file into the current one.
import rhinoscriptsyntax as rs
import scriptcontext as sc
id = rs.GetObject()
oref = sc.doc.Objects.Find(id)
attrs = oref.Attributes
geo = oref.Geometry
newId = sc.doc.Objects.Add(geo)
sc.doc.Objects.ModifyAttributes(obj, attrs, True)
Thank you for your kind help.
Copying the objects attributes works so far, but I’m still struggling to copy the original layer structure from the reference file into the current file.
Is there a pretty way to reproduce the nested layer structure in the active file and also copy their Attributes (Layer Color, Linewidth etc…)?
Here’s what I want to achieve prior exporting the objects:
I tried with ‘Layer.CopyAttributesFrom’ and doing loops through the referenced layers hierarchy, but I don’t achieve to maintain the parent-children relationship of the newly created layers.
Ok, I finally manage to write a command which does what I expect (see attached). I guess the code is pretty inelegant and not really effective, but it seems to work though.
Last problem: I don’t get the ‘Undo’ command to work from the C# command. I also tried with an alias, launching the _cExport command, and then the _Undo (’_cExport _Undo’), but it still remain unsuccessful.
Could someone please explain me why it won’t work?
Typing the Undo command manually after the cExport one also work fine…
Thanks, so there is no way to perform an Undo right after a command?
But still good to know: I always thought that the aliases/macro behave similar as if an human typed the commands. I also understand that the ’_cExport _Undo’ is not treated as two distinct commands and the Undo doesn’t know what have been changed until the alias completion.
Jumping in to echo this. I’m using worksessions for a large file and it seems worksessions are not supported in Lumion, which is our renderer of choice for current tasks. The best way to quickly overcome this would be to simply “bake” all geometry referenced in a worksession and maintain all original attributes. Any thoughts on this version of the issue?