First of all, thanks for your help.
This solution is not exactly what I want to do.
I need to append an existing object.
import rhinoscriptsyntax as rs
fd = Rhino.UI.OpenFileDialog()
fd.Filter = 'Rhino 3D Models (*.3dm)|*.3dm||'
fname = get_open_filename()
if fname is None:
f = Rhino.FileIO.File3dm.Read(fname)
object = rs.GetObject(message="Select polysurface object:", filter=16, preselect=False, select=False, custom_filter=None, subobjects=False)
Message: expected File3dmObject, got Guid
line 20, in test_append_3dm, "C:\Users\mcr16\AppData\Local\Temp\TempScript.py"
line 23, in <module>, "C:\Users\mcr16\AppData\Local\Temp\TempScript.py"
How I can solve it?
f.Objects.Add(object) expects a File3dmObject but I have the ID. How I can get the File3dmObject of this object?.