@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)