print "Hello World" import rhinoscriptsyntax as rs allobjs = rs.AllObjects() rs.DeleteObjects(allobjs) initial = "K" initial1 = "F" hgt = 60 size = 40 # Surface 1 # 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) mytext = rs.AddText(initial,(0,0,0),height=size, font="Arial") crv = rs.ExplodeText(mytext,True) [0] rs.SelectObject(crv) # extrude the curve rs.Command("_ExtrudeCrv Solid=No DeleteInput=Yes {} _Enter".format(hgt)) srf1 = rs.FirstObject(select=True) # use handles to change Nurbes shape rs.Command("-_Rebuild UPointCount=10 VPointCount=4 UDegree=3 VDegree=3 DeleteInput=Yes _Enter") rs.EnableObjectGrips(srf1, True) """ pointlist = rs.ObjectGripLocations(srf1) print pointlist for i,pt in enumerate(pointlist): cmd = "-Dot {} {} _Enter" .format(str(i),str(pt)) rs.Command(cmd,False) """ rs.SelectObjectGrip(srf1, 10) rs.Command("-_Move 0,0,0 10,10,0 _Enter") rs.UnselectAllObjects() rs.SelectObjectGrip(srf1, 27) rs.Command("-_Move 0,0,0 20,10,0 _Enter") rs.UnselectAllObjects() rs.SelectObjectGrip(srf1, 16) rs.Command("-_Move 0,0,0 10,10,0 _Enter") rs.UnselectAllObjects() rs.SelectObjectGrip(srf1, 19) rs.Command("-_Move 0,0,0 -5,-5,0 _Enter") rs.UnselectAllObjects() rs.SelectObjectGrip(srf1, 28) rs.Command("-_Move 0,0,0 10,10,0 _Enter") rs.UnselectAllObjects() rs.SelectObjectGrip(srf1, 0) rs.SelectObjectGrip(srf1, 4) rs.Command("-_Move 0,0,0 -10,0,0 _Enter") rs.UnselectAllObjects() rs.SelectObjectGrip(srf1, 3) rs.SelectObjectGrip(srf1, 39) rs.Command("-_Move 0,0,0 -10,0,0 _Enter") rs.UnselectAllObjects() rs.EnableObjectGrips(srf1, False) # create contourlines in z-direction and extrude them (floor plates) rs.SelectObject(srf1) rs.Command("Contour 0,0,0 0,0,1 3.0 _Enter") rs.Command("_ExtrudeCrv Solid=yes 0.3 _Enter") # create coutourlines in x-direction and use the command pipe (vertical support) rs.SelectObject(srf1) rs.Command("Contour 0,0,0 1,0,0 2.0 _Enter") rs.Command("Pipe 0.2 _Enter") rs.DeleteObject(srf1) # Surface 2 # draw a closed curve in Rhino mytext = rs.AddText(initial1,(0,0,0),height=size, font="Arial") crv = rs.ExplodeText(mytext,True) [0] rs.SelectObject(crv) rs.Command("_Move 0,0,0 40,0,0 _Enter") # extrude the curve rs.Command("_ExtrudeCrv Solid=No DeleteInput=Yes 60 _Enter") srf2 = rs.FirstObject(select=True) # use handles to change Nurbes shape rs.Command("-_Rebuild UPointCount=10 VPointCount=4 UDegree=3 VDegree=3 DeleteInput=Yes _Enter") rs.EnableObjectGrips(srf2, True) """ pointlist = rs.ObjectGripLocations(srf2) print pointlist for i,pt in enumerate(pointlist): cmd = "-Dot {} {} _Enter" .format(str(i),str(pt)) rs.Command(cmd,False) """ rs.SelectObjectGrip(srf2, 4) rs.Command("-_Move 0,0,0 -10,10,0 _Enter") rs.UnselectAllObjects() rs.SelectObjectGrip(srf2, 7) rs.Command("-_Move 0,0,0 10,10,0 _Enter") rs.UnselectAllObjects() rs.SelectObjectGrip(srf2, 19) rs.Command("-_Move 0,0,0 10,10,0 _Enter") rs.UnselectAllObjects() rs.SelectObjectGrip(srf2, 16) rs.Command("-_Move 0,0,0 -10,0,0 _Enter") rs.UnselectAllObjects() rs.SelectObjectGrip(srf2, 39) rs.Command("-_Move 0,0,0 -5,-5,0 _Enter") rs.UnselectAllObjects() rs.SelectObjectGrip(srf2, 28) rs.SelectObjectGrip(srf2, 29) rs.Command("-_Move 0,0,0 5,5,0 _Enter") rs.UnselectAllObjects() rs.SelectObjectGrip(srf2, 32) rs.SelectObjectGrip(srf2, 36) rs.Command("-_Move 0,0,0 5,0,0 _Enter") rs.UnselectAllObjects() rs.SelectObjectGrip(srf2, 34) rs.SelectObjectGrip(srf2, 38) rs.Command("-_Move 0,0,0 0,15,0 _Enter") rs.UnselectAllObjects() rs.EnableObjectGrips(srf2, False) # create contourlines in z-direction and extrude them (floor plates) rs.SelectObject(srf2) rs.Command("Contour 0,0,0 0,0,1 3.0 _Enter") rs.Command("_ExtrudeCrv Solid=yes 0.3 _Enter") # create coutourlines in x-direction and use the command pipe (vertical support) rs.SelectObject(srf2) rs.Command("Contour 0,0,0 1,0,0 2.0 _Enter") rs.Command("Pipe 0.2 _Enter") rs.DeleteObject(srf2)