从一个位置复制一个单一物件到另一个位置,或原地复制。
rhinoscriptsyntax.CopyObject (object_id, translation=None)
rhinoscript.object.CopyObject (object_id, translation=None)
object_id |
必须参数。字符串或 Guid。要复制物件的 ID 。 |
translation |
可选参数。三个数字构成的列表或者 Vector3d 对象。3-D 移动向量。 |
Guid |
执行成功,返回复制物件的ID。 |
None |
如果不能复制返回空值。 |
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 )