Message 1 of 5
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all,
I'm writing a python script inside dynamo and I want to rotate a curve from a defined angles list, and I'm stuck on how to set the rotation function, please check below a part of my code :
# curve to rotate
curv = IN[0][0].ToRevitType()
# circle defining path rotation
out_path = IN[0][1].ToRevitType()
spacing = IN[1]/0.3048
# computing rotation angle
def rebar_rotation(circle, space):
sweepAngle = (space * 360) / (circle.Radius * 2 * math.pi)
return sweepAngle
angle = rebar_rotation(out_path, spacing)
# angle count around 360°
count = int(math.ceil(360/angle))
for i in range(0, count):
a= i*angle
# I'm stuck to define the rotation function
rebar_curve = curv.Rotate(Line.CreateBound(XYZ(0,0,0), XYZ(0,0,1)), a)
Thanks for your help in advance
Solved! Go to Solution.