How to get the source of a referenced object?

if IsReference is True for a RhinoObject, how can I find out from which referenced document the object is coming?
RhinoObject.Document seems to always return the active document.

Hi Fabian,

If you were using the C++ SDK, you’d call CRhinoObject::WorksessionReferenceModelSerialNumber to get the worksession reference model id. From this, you could query the worksession to get the file. I don’t see any of this available in RhinoCommon at this time. I’ve added a YouTrack item to get something added to a future Rhino.

Just curious, why do you need to know in which model a reference object resides?

Hi Dale,

thanks for the swift reply. Unfortunately it’s all Python and RhinoCommon here, so I’ll have to wait.

To answer your question: I am generating many shopdrawings in a blank file, gathering geometry and infos from a model referenced in the background - which makes it possible to just SaveAs dwg, 3dm and pdf and then swipe the file and create the next drawing. It would have been nice to put the name of the referenced file on the drawing - just for documentation reasons.


RH-34767 is fixed in the latest Service Release Candidate

1 Like

Many thanks!