CopyToClipboard

Is there any way to manipulate the objects that are in the CopyToClipboard zone or at the time of the paste?

I want to transfer objects from one document to another (copy/paste ) but for some reason the userdata from the old document is being imported into the new document, it doesn’t make much sense because it’s userdata from the document and not from the object.

I wanted to eliminate this, somehow??

Hi @MatrixRatrix,

You might try this:

Using some event watchers:

Watch for the beginning of the Paste command. When this happens, so this:

var sn_start = RhinoObject.NextRuntimeSerialNumber;

Watch for the ending of the Paste command. When this happens, so this:

var sn_end = RhinoObject.NextRuntimeSerialNumber;

Now, search all of the newly pasted objects and purge your user data if needed.

for (var sn = sn_start; sn < sn_end; sn++)
{
  var obj = doc.Objects.Find(sn);
  if (null != obj)
  {
    // TODO...
  }
}

– Dale

2 Likes