import rhinoscriptsyntax as rs
class Dowel(object):
def __init__(self, line, radius=1.0, material):
#This (maybe?) creates a dowel object based on a input line
#and permanently stores the creation time and material with the geometry
self.pointStart = rs.CurveStartPoint(line)
self.pointEnd = rs.CurveEndPoint(line)
self.vector = self.pointStart.Subtract(self.pointEnd)
self.surface = rs.AddPipe(line, 0, radius, 0, 1)
self.creation = time.strftime("%y%m%d_%Hh%Mm")
self.material = material
#Now I make a bunch of dowel objects with different properties:
firstDowel = Dowel(line1, rad1, birch)
secondDowel = Dowel(line2, rad2, maple)
thirdDowel = Dowel(line3, rad3, oak)
dowels = [firstDowel, secondDowel, thirdDowel]
#This is the part I'm not totally clear on - how do modify those initial
#properties using rhinoscriptsyntax functions, while keeping the
#creation time and material intact?
for dowel in Dowels:
dowel.line = rs.MoveObject(dowel.line, [10,0,0])
#Now, hopefully use the newly moved dowel to make a hole at
#a new location in a board?
boardWithHole = rs.BooleanDifference(board, firstDowel.surface)
#And print the time that the dowel was created
print firstDowel.creation