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

Move Object using BoundingBox measurements

$
0
0

@J11 wrote:

Hi,

Fairly new to scripting. This seems like something I should be able to accomplish on my own, but I’m struggling to solve.

I’m trying to move a group of object in the X axis. I’d like the move distance to be full distance of it’s bounding box + 3mm. Then I paste the original copy.

The result will be two identical objects next to each other with a gap of 3mm in the middle of the object.

I don’t fully understand how arrays work. but this is the code I have so far.

Thanks so much for any help!

Rhino.Command "-SelAll"
Rhino.Command "-Copy I Enter"
arrSelected = Rhino.SelectedObjects

Dim arrBoundingBox
arrBoundingBox = Rhino.BoundingBox(arrSelected)
'	arrSelected = Rhino.MoveObjects(arrSelected, Array(0, 0, 0), Array(0, 0, arrBoundingBox(0)(2)))

arrSelected = Rhino.MoveObjects(arrSelected, Array(arrBoundingBox(0)(2) + 3, 0, 0), Array(0, 0, 0))

Rhino.Command "-Paste"
Rhino.UnselectAllObjects

Posts: 5

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 5777

Trending Articles