Copies a single object from one location to another, or in-place.
rhinoscriptsyntax.CopyObject (object_id, translation=None)
rhinoscript.object.CopyObject (object_id, translation=None)
object_id |
Required. String or Guid. The identifier of the object to copy. |
translation |
Optional. list of 3 numbers or Vector3d. The 3-D translation vector. |
Guid |
The identifier of the copied object if successful. |
None |
If not able to copy |
import rhinoscriptsyntax as rs
id = rs.GetObject("Select object to copy")
if id:
start = rs.GetPoint("Point to copy from")
if start:
end = rs.GetPoint("Point to copy to", start)
if end:
translation = end-start
rs.CopyObject( id, translation )