Add Objects from dxf via Rhino.FileIO.FileReference with their original attributes

Hi all,
I have a question concerning Rhino.FileIO.FileReference…

I am able to create the object one, but not able to insert them as real objects into a new Rhino file.
If inserted they should keep their attributes from the original file (LayerColorSources, etc…).
I guess it will not matter if it’s a dxf-file, because so far the Instance of the object was created perfectly fine.

Thanks,
T.

Hi @tobias.stoltmann,

I think you’ve confused the terms “file reference” with “reference file”.

A FileReference is really nothing more than a file path helper class.

A “reference file” is file that has been inserted as a linked block or that has been attached to a worksession. In this context, the reference file is read-only.

Does this help at all?

– Dale

@dale, thanks.
Now this is getting a bit clearer to me:


So I thought that I also could insert the content of the file reference as objects only.
Is there such an option to in RhinoCommon? So far I am inserting files via the command line, but sometimes it is getting a bit bulky.

Thanks, T.

Hi @tobias.stoltmann,

Scripting the Insert command is still the best option.

– Dale

@dale thanks.
Are you planning to make this possible in RhinoCommon in the future?

Hi @tobias.stoltmann,

I’m sure this is on somebody’s list.

Just curious, what advantage would a RhinoCommon method provide you over just scripting the command?

– Dale

@dale, sometimes command line solutions seem a bit bulky to me as a user.
Methods in RhinoCommon are very convenient and easier to use.

To me it also seems that RhinoCommon methods run faster than command line scripts, right?

T.