Object keeps Guid after pasting

I have here some weird situation when an object is pasted to a new document it keeps its Guid and then after importing a file with such surface which has the same id this one gets different Guid.

Is there a way of knowing if this Guid will change to react to preserve “link” to this object? (I’m storing Guids of objects to differentiate which was picked by user) - in particular, this is causing unexpected behavior while doing import to a file that contains an object with the same Guid.

Shouldn’t the pasted object change the Guid on paste - not the imported one?

This case is also happening on the doubled import of the same file.

The purpose of object ids is to ensure that each object in the document has a unique id. The purpose is not to ensure that each object id is unique across all documents.

When Rhino add a new object to the document (either by Paste, Import, or any other way), Rhino checks to see if the object’s id is already in use. If not, the Rhino just uses that id. Otherwise, it generates a new id.

No, not that I know of.

– Dale

Thanks, @dale but … Even with some deeper work with events? I don’t remember which ones are launched on paste action. ReadDocument - obviously - I could eventually detach those and let know user this happened… but any others that I could try to find some way of doing equalities between current doc read doc and state after reading doc?

Any thoughts?

Hi @D-W,

Perhaps you need to attached your own ID as user data?

– Dale