import rhinoscriptsyntax as rs allobjs = rs.AllObjects() rs.DeleteObjects(allobjs) initial = "C" hgt=60 size=40 # draw a closed curve in rhino mytext = rs.AddText(initial,(0,0,0),height=size, font="Arial") crv = rs.ExplodeText(mytext,True)[0] crv = rs.SelectObject(crv) # Extrude the curve crv = rs.Command("_ExtrudeCrv Solid=No DeleteInput=Yes 30 _Enter") srf = rs.FirstObject(select=True) #use handels to change the NURBS shape rs.SelectObjects(srf) rs.Command("-_Rebuild UPointCount=10 VPointCount=4 UDegree=3 VDegree=3 DeleteInput=Yes _Enter") rs.EnableObjectGrips(srf, True) """ pointlist = rs.ObjectGripLocations(srf) print pointlist for i,pt in enumerate(pointlist): cmd = "-Dot {} {} _Enter".format(str(i),str(pt)) rs.Command(cmd,False) """ rs.SelectObjectGrip(srf,23) rs.Command("-_Move 0,0,0 15,0,0 _Enter") rs.UnselectObjectGrip(srf,23) rs.SelectObjectGrip(srf,20) rs.Command("-_Move 0,0,0 15,0,0 _Enter") rs.UnselectObjectGrip(srf,20) rs.EnableObjectGrips(srf, False) # create contourlines in z-direction and extrude them rs.Command("Contour 0,0,0 0,0,1 3.0 _Enter") rs.Command("_ExtrudeCrv Solid=Yes DeleteInput=Yes 0.3 _Enter") # create contourlines in x-direction and use the pipe command rs.SelectObject(srf) rs.Command("Contour 0,0,0 1,0,0 2.0 _Enter") rs.Command("Pipe 0.2 _Enter") rs.DeleteObject(srf) rs.UnselectAllObjects() allobjs = rs.AllObjects() rs.DeleteObjects(allobjs) initial = "C" hgt=60 size=40 # draw a closed curve in rhino mytext = rs.AddText(initial,(0,0,0),height=size, font="Arial") crv = rs.ExplodeText(mytext,True)[0] crv = rs.SelectObject(crv) # Extrude the curve crv = rs.Command("_ExtrudeCrv Solid=No DeleteInput=Yes 30 _Enter") srf = rs.FirstObject(select=True) #use handels to change the NURBS shape rs.SelectObjects(srf) rs.Command("-_Rebuild UPointCount=10 VPointCount=4 UDegree=3 VDegree=3 DeleteInput=Yes _Enter") rs.EnableObjectGrips(srf, True) """ pointlist = rs.ObjectGripLocations(srf) print pointlist for i,pt in enumerate(pointlist): cmd = "-Dot {} {} _Enter".format(str(i),str(pt)) rs.Command(cmd,False) """ rs.SelectObjectGrip(srf,23) rs.Command("-_Move 0,0,0 15,0,0 _Enter") rs.UnselectObjectGrip(srf,23) rs.SelectObjectGrip(srf,20) rs.Command("-_Move 0,0,0 15,0,0 _Enter") rs.UnselectObjectGrip(srf,20) rs.EnableObjectGrips(srf, False) # create contourlines in z-direction and extrude them rs.Command("Contour 0,0,0 0,0,1 3.0 _Enter") rs.Command("_ExtrudeCrv Solid=Yes DeleteInput=Yes 0.3 _Enter") # create contourlines in x-direction and use the pipe command rs.SelectObject(srf) rs.Command("Contour 0,0,0 1,0,0 2.0 _Enter") rs.Command("Pipe 0.2 _Enter") rs.DeleteObject(srf) rs.UnselectAllObjects()