-_Runscript ( Option Explicit 'Script written by Lucio Zadra 'Script copyrighted by Zadra Giuseppe Stampaggio Metalli 'Script version sabato 24 settembre 2016 20:51:18 Call CopyCentroid() Sub CopyCentroid Dim oggetti, objs, orig, i, nump objs = Rhino.Getobjects("Seleziona gli oggetti da copiare") If IsArray(objs) Then orig = Rhino.GetPoint("Seleziona il punto origine") If IsArray(orig) Then oggetti = Rhino.GetObjects("Seleziona gli oggetti Target") If IsArray(oggetti) Then Rhino.EnableRedraw(False) Rhino.UnselectAllObjects For i=0 To Ubound(oggetti) If Rhino.IsCurveClosed(oggetti(i)) Then nump = Rhino.CurveAreaCentroid(oggetti(i)) Rhino.CopyObjects objs, orig, nump(0) ElseIf Rhino.IsSurface(oggetti(i)) Or Rhino.IsPolysurface(oggetti(i)) Then nump = Rhino.SurfaceAreaCentroid(oggetti(i)) Rhino.CopyObjects objs, orig, nump(0) End If Next End If End If End If Rhino.UnselectAllObjects Rhino.EnableRedraw(True) End Sub )