There is a python module that allows you to comfortably create a 3dm-File. 3dm is the default file format for rhino3d.
I myself have encapsulated this module again so that I can create my own geometry objects more comfortably in rhino3d.
The python module can create a system of rhino3d layers so that
the respective color reasonably matches the respective material, and
the individual sub-objects can be combined in a meaningful way.
Also, of course, it must contain all geometry information.
In addition, each individual object is given a unique name so that it can be found later by the plugin.