import rhinoscriptsyntax as rs #define variables and delete all former created objects allobjs = rs.AllObjects() rs.DeleteObjects(allobjs) initial = "A" initial2 = "H" hgt=60 size=40 """ #draw a closed curve in Rhino rs.Command("-_Curve Degree=2 0,0,0 20,-1,0 20,12,0 0,10,0 Close _Enter") crv = rs.FirstObject(select=True) """ #write a text and transform it into a curve mytext = rs.AddText(initial,(0,0,0),height=size, font="Century Gothic") crv = rs.ExplodeText(mytext,True) [0] rs.SelectObject(crv) #extrude the curve rs.Command("-_ExtrudeCrv Solid=No {} _Enter".format(hgt)) rs.UnselectAllObjects() srf = rs.FirstObject(select=True) #use handles to change NURBS shape rs.Command("-Rebuild UPointCount=20 VPointCount=4 UDegree=3 VDegree=3 DeleteInput=Yes _Enter") rs.EnableObjectGrips(srf, True) """ #show the points pointlist = rs.ObjectGripLocations(srf) print pointlist for i, pt in enumerate(pointlist): cmd = "-Dot {} {} Enter".format(str(i),str(pt)) rs.Command(cmd, False) """ #use handles to change NURBS shape rs.SelectObjectGrip(srf,60) rs.SelectObjectGrip(srf,61) rs.SelectObjectGrip(srf,62) rs.SelectObjectGrip(srf,63) rs.Command("-_Move 0,0,0 10,0,0 _Enter") rs.UnselectAllObjects() rs.SelectObjectGrip(srf,4) rs.SelectObjectGrip(srf,5) rs.SelectObjectGrip(srf,6) rs.SelectObjectGrip(srf,7) rs.Command("-_Move 0,0,0 30,0,0 _Enter") rs.UnselectAllObjects() rs.SelectObjectGrip(srf,0) rs.SelectObjectGrip(srf,1) rs.SelectObjectGrip(srf,2) rs.SelectObjectGrip(srf,3) rs.Command("-_Move 0,0,0 10,0,0 _Enter") rs.UnselectAllObjects() rs.EnableObjectGrips(srf, False) rs.SelectObject(srf) #create conoutlines in z-direction and extrude them rs.Command("Contour 0,0,0 0,0,1 3 Enter") rs.Command("ExtrudeCrv Solid=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 Enter") rs.Command("Pipe 0.2 Enter") rs.DeleteObject(srf) #write a text and transform it into a curve mytext = rs.AddText(initial2,(50,0,0),height=size, font="Century Gothic") crv = rs.ExplodeText(mytext,True) [0] rs.SelectObject(crv) #extrude the curve rs.Command("-_ExtrudeCrv Solid=No {} _Enter".format(hgt)) rs.UnselectAllObjects() srf = rs.FirstObject(select=True) #use handles to change NURBS shape rs.Command("-Rebuild UPointCount=17 VPointCount=4 UDegree=3 VDegree=3 DeleteInput=Yes _Enter") rs.EnableObjectGrips(srf, True) """ #show the points pointlist = rs.ObjectGripLocations(srf) print pointlist for i, pt in enumerate(pointlist): cmd = "-Dot {} {} Enter".format(str(i),str(pt)) rs.Command(cmd, False) """ #use handles to change NURBS shape rs.SelectObjectGrip(srf,16) rs.SelectObjectGrip(srf,17) rs.SelectObjectGrip(srf,18) rs.SelectObjectGrip(srf,19) rs.Command("-_Move 0,0,0 -10,0,0 _Enter") rs.UnselectAllObjects() rs.SelectObjectGrip(srf,4) rs.SelectObjectGrip(srf,5) rs.SelectObjectGrip(srf,6) rs.SelectObjectGrip(srf,7) rs.Command("-_Move 0,0,0 -15,0,0 _Enter") rs.UnselectAllObjects() rs.EnableObjectGrips(srf, False) rs.SelectObject(srf) #create conoutlines in z-direction and extrude them rs.Command("Contour 0,0,0 0,0,1 3 Enter") rs.Command("ExtrudeCrv Solid=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 Enter") rs.Command("Pipe 0.2 Enter") rs.DeleteObject(srf)