Once I have “extracted” the geometry of an doc object from its GUID with something like obj=rs.coercebrep(objID), is it possible to do the reverse and find the ID to whom the geometry originally belonged? Or do I have to keep track of the GUID list index of the object?
As far as I understand, the geometry objects are not aware of Rhino in any way. For that, they are ‘wrapped’ in a RhinoObject, which has also the object attributes that define how to draw the geometry. The RhinoObject also has the GUID.
So, rather than using coerebrep, you could use coercerhinoobject. This will get you the rhino object (holding the GUID) and its geometry:
rhObj = rs.coercerhinoobject(objID)
if rhObj is None:
return
guid = rhObj.Id
geom = rhObj.Geometry