Quantcast
Channel: Scripting - McNeel Forum
Viewing all articles
Browse latest Browse all 5804

Copy an object to target points

$
0
0

I am trying to move a simple box extrusion to random points but I keep getting this error: Message: unsupported operand type(s) for -: ‘Guid’ and ‘Point3d’.

Here is my script:

import rhinoscriptsyntax as rs
import random

#Constants
targetPoints =

for n in range(5):
…randomPoints = rs.AddPoint(random.randrange(1, 300), random.randrange(1, 300), 0)
…targetPoints.append(randomPoints)

for i in targetPoints:
…Object = rs.GetObject(“Pick your box”, rs.filter.extrusion)
…startPoint = rs.GetPoint(“Point to copy from”)
…translation = i-startPoint
…rs.CopyObject(Object, translation)

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 5804

Trending Articles