import rhinoscriptsyntax as rs allobj = rs.AllObjects() rs.DeleteObjects(allobj) #both of my initials are the letter H initial = "H" hgt = 60 size = 40 #variable for the distance between the 2 letters distance = 1500 #draw a closed curve #rs.Command("-_Curve Degree=2 0,0,0 20,-1,0 20,12,0 0,10,0 Close _Enter") #crv = rs.FirstObject(select=True) def create_H(offset): #draw the letter H at the offset mytext = rs.AddText(initial,(offset,0,0),height=size, font="Verdana") crv = rs.ExplodeText(mytext,True)[0] rs.SelectObject(crv) #extrude the curve rs.Command("-_ExtrudeCrv Solid=No {} _Enter".format(hgt)) srf = rs.FirstObject(select=True) #change the shape of the NURBS using the handles/ rebuild it rs.Command("-_Rebuild UPointCount=20 VPointCount=4 UDegree=3 Vdegree=3 DeleteInput=Yes _Enter") #enable grips rs.EnableObjectGrips(srf, True) #commented for the photos """ pointList = rs.ObjectGripLocations(srf) print pointList #enumerate through the points and place a dot for visual refrence for i, pt in enumerate(pointList): cmd = "-Dot {} {} _Enter".format(str(i),str(pt)) rs.Command(cmd, False) """ #move control points to change the shape(aestethics) rs.SelectObjectGrip(srf, 23) rs.Command("-_Move 0,0,0 -15,0,0 _Enter") rs.UnselectAllObjects() rs.SelectObjectGrip(srf, 27) rs.Command("-_Move 0,0,0 -10,0,0 _Enter") rs.UnselectAllObjects() #disable grips rs.EnableObjectGrips(srf, False) #create floor-plates: create and extrude contourlines in the Z-direction rs.SelectObject(srf) rs.Command("Contour 0,0,0 0,0,1 3.0 _Enter ") rs.Command("_ExtrudeCrv Solid=Yes 0.3 _Enter") #create floor-plates: create and extrude contourlines in the X-direction rs.SelectObject(srf) rs.Command("Contour 0,0,0 1,0,0 2.0 _Enter ") rs.Command("Pipe 0.2 _Enter") #delete the original srf rs.DeleteObject(srf) #function to create the first H at the 0 create_H(0) #function to create the second H at the defined distance create_H(distance)