PDA

View Full Version : Draw axes to the circles



vittorio
05-07-2010, 08:51 PM
every note is welcome


import rhinoscriptsyntax as rs
import rhinoscript
# function that drawing circles axes
def fff(idcerchio):
pc=rs.CircleCenterPoint(idcerchio)
if pc!=None:
r=rs.CircleRadius(idcerchio)
raggio=r*1.3
k=1.3
x=pc[0]
y=pc[1]
z=pc[2]
k=1.3
ps=[x+raggio,y,z]
pe=[x-raggio,y,z]
asseX=rs.AddLine(ps,pe)
rs.RotateObject(asseX,pc,90,copy=True)

strObjects=rs.GetObjects("select circles")
rs.EnableRedraw (False)
for cir in strObjects :
if rs.IsCurveClosed(cir):
fff(cir)
rs.EnableRedraw (True)