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

Offset multiple curves Python

$
0
0

@brobes05 wrote:

Hi,

I am lost. Should I use a for loop to offset multiple curves? I don't understand how to allow a for loop to access each curve in a list sequentially.

I am trying to use Python's 'len' to gather the length of the curves selected to offset. The script is unfinished as I can only get it to work for one curve.

Thank you for the help!

import rhinoscriptsyntax as rs

crvList = []

crvs = rs.GetObjects("selectCrvs")
offsetDistance = .0625
crvList.append(crvs)

crvList2 = []

for i in range(len
    offsetA = rs.OffsetCurve(crvList, [0,1,0], offsetDistance )
    offsetB = rs.OffsetCurve(crvList, [0,-1,0], -offsetDistance )
    crvList2.append(offsetA)
    crvList2.append(offsetB)
    
    print crvList

rs.DeleteObject(crvs)
rs.ObjectLayer(crvList,"Thin")

Posts: 8

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 5871

Trending Articles