import rhinoscriptsyntax as rs allobjs = rs.AllObjects() rs.DeleteObjects(allobjs) initial = "H" hgt= 60 size= 30 #draw 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) #Buchstabe 1 mytext = rs.AddText(initial,(0,0,0),height=size, font="Arial") crv = rs.ExplodeText(mytext,True)[0] rs.SelectObject(crv) #extrude curves rs.Command("_ExtrudeCrv Solid=No DeleteInput=Yes {} _Enter" .format(hgt)) srf = rs.FirstObject(select=True) #NURBS shape (handles) rs.Command("-_Rebuild UPointCount=33 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,20) rs.SelectObjectGrip(srf,51) rs.Command("-_Move 0,0,0 10,0,0 _Enter") rs.UnselectAllObjects() rs.SelectObjectGrip(srf,7) rs.Command("-_Move 0,0,0 -20,0,0 _Enter") rs.UnselectAllObjects() rs.SelectObjectGrip(srf,115) rs.Command("-_Move 0,0,0 -15,20,0 _Enter") rs.UnselectAllObjects() rs.SelectObjectGrip(srf,75) rs.Command("-_Move 0,0,0 -5,10,0 _Enter") rs.UnselectAllObjects() rs.SelectObjectGrip(srf,112) rs.Command("-_Move 0,0,0 -15,20,0 _Enter") rs.UnselectAllObjects() rs.SelectObjectGrip(srf,72) rs.Command("-_Move 0,0,0 -10,10,0 _Enter") rs.UnselectAllObjects() rs.SelectObjectGrip(srf,8) rs.Command("-_Move 0,0,0 12,-8,0 _Enter") rs.UnselectAllObjects() rs.EnableObjectGrips(srf, False) #contour Z-direction extrude contour (floor plates) rs.SelectObject(srf) rs.Command("_Contour 0,0,0 0,0,1 3.0 _Enter") rs.Command("_ExtrudeCrv Solid=Yes 0.3 _Enter") #contour X-direction and pipe command (vertical support 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() #Buchstabe 2 letter = "G" mytext = rs.AddText(letter,(50,0,0),height=size, font="Arial") crv = rs.ExplodeText(mytext,True)[0] rs.SelectObject(crv) #extrude curves rs.Command("_ExtrudeCrv Solid=No DeleteInput=Yes {} _Enter" .format(hgt)) srf = rs.FirstObject(select=True) #NURBS shape control points (handles) rs.Command("-_Rebuild UPointCount=30 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,24) rs.SelectObjectGrip(srf,25) rs.Command("-_Move 0,0,0 10,0,0 _Enter") rs.UnselectAllObjects() rs.SelectObjectGrip(srf,23) rs.Command("-_Move 0,0,0 -10,0,0 _Enter") rs.UnselectAllObjects() rs.SelectObjectGrip(srf,7) rs.Command("-_Move 0,0,0 12,0,0 _Enter") rs.UnselectAllObjects() rs.SelectObjectGrip(srf,75) rs.Command("-_Move 0,0,0 12,18,0 _Enter") rs.UnselectAllObjects() rs.SelectObjectGrip(srf,107) rs.Command("-_Move 0,0,0 -5,0,0 _Enter") rs.UnselectAllObjects() rs.SelectObjectGrip(srf,7) rs.Command("-_Move 0,0,0 -5,0,0 _Enter") rs.UnselectAllObjects() rs.EnableObjectGrips(srf, False) #contour Z-direction extrude contour (floor plates) rs.SelectObject(srf) rs.Command("_Contour 0,0,0 0,0,1 3.0 _Enter") rs.Command("_ExtrudeCrv Solid=Yes 0.3 _Enter") #contour X-direction and 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)