File3dm/FileIO vs RhinoDoc

Hello there,

I am trying to modify files from the “outside” - means I do not wanna open them manually.

Some time ago @stevebaer has been explaining to me how to import and export via a headless RhinoDoc. This works perfectly fine.

Now I have been asking myself how I would modify a document.
Is it state of the art to use a headless RhinoDoc again read a file, modify the content and then save it over the old document?

Or is there a more elgant way via FileIO and a File3dm?

Thanks,
T.

Hey @tobias.stoltmann,

Have you given File3dm a whirl? There are some nice samples to help you get started. I think File3dm would give you the results you need. The only thing to note is that File3dm doesn’t offer as much access for read/write that opening heedlessly would, but this is because it in theory offers more efficent ways to edit data without expanding it into a fully open document.
e.g. → I’m pretty sure File3dm doesn’t load ArchivableDictionaries on RhinoObjects

– cs

thanks @CallumSykes.

Sounds good.
What I am looking for is, that I want to update InstanceDefinitions in files.
https://developer.rhino3d.com/api/rhinocommon/rhino.fileio.file3dminstancedefinitiontable
As far as I see there is not an option for modifying definitions right?
So in this case I need a headless document, correct?

Basically I would also like to understand the differences between File3dm and RhinoDoc. What is the difference and what are advantages or purpose of useage of File3dm?

Thanks a lot!