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

Problem with AddBox

$
0
0

@Depix wrote:

Hello there,
So I am having a small problem with this piece of code: I was trying to create some boxes, but I keep getting this message : Message: unable to create brep from box
However, when I replace the BoxHeight value with a number, the code is working. I can't use the value of i to create elements ?

import rhinoscriptsyntax as rs
for i in range(10):
    BoxHeight = i
    corners = [(0,0,0),(0.5,0,0),(0.5,0.5,0),(0,0.5,0),(0,0,BoxHeight),(0.5,0,BoxHeight),(0.5,0.5,BoxHeight),(0,0.5,BoxHeight)]
    Box = rs.AddBox(corners)
    rs.MoveObject(Box,(i,0,0))

Thank you for your help in advance !

Posts: 4

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 5938

Trending Articles