'this scheme consists of 3 surfaces, S1, St and Sm. By lofting them together we obtain a form that looks more or less like a section of a fish. In order to 'to create these 3 surfaces, we started by defining 4 curves: C1,C2,C1m and C2m function Curves() 'declare variables dim C1,C2,C3,C4,C5,C1m,C2m 'curves, C1m and C2m are mirror images of C1, C2 dim C1pt,C2pt,C3pt,C4pt 'series of positions along C1 and C2 dim C1pt1,C1pt2,C1pt3,C1pt4 'actual points on C1 and C2 dim C2pt1,C2pt2,C2pt3,C2pt4 'dim C3pt1,C3pt2,C3pt3,C3pt4 'dim C4pt1,C4pt2,C4pt3,C4pt4 dim C1mpt1,C1mpt2,C1mpt3,C1mpt4 dim C2mpt1,C2mpt2,C2mpt3,C2mpt4 dim C1ptset dim C2ptset 'dim C3ptset 'dim C4ptset dim C1mptset dim C2mptset C1pt1=array(0,0,0) C1pt2=array(-3,20,2) C1pt3=array(0,40,1) C1pt4=array(2,60,0) C1ptset=array(C1pt1,C1pt2,C1pt3,C1pt4) 'complete set of points on C1 C2pt1=array(5,0,27) C2pt2=array(1,20,25) C2pt3=array(2,40,20) C2pt4=array(4,60,15) C2ptset=array(C2pt1,C2pt2,C2pt3,C2pt4) 'complete set of points on C2 C1mpt1=array(90,0,0) C1mpt2=array(93,20,2) C1mpt3=array(90,40,1) C1mpt4=array(88,60,0) C1mptset=array(C1mpt1,C1mpt2,C1mpt3,C1mpt4) 'complete set of points on C1m C2mpt1=array(85,0,27) C2mpt2=array(89,20,25) C2mpt3=array(88,40,20) C2mpt4=array(86,60,15) C2mptset=array(C2mpt1,C2mpt2,C2mpt3,C2mpt4) 'complete set of points on C2m 'C3pt1=array(0.5,0,0) 'C3pt2=array(0,20,2) 'C3pt3=array(5,40,1) 'C3pt4=array(2.5,60,0) 'C3ptset=array(C3pt1,C3pt2,C3pt3,C3pt4) 'C4pt1=array(5.5,0,27) 'C4pt2=array(4,20,25) 'C4pt3=array(3,40,20) 'C4pt4=array(4.5,60,15) 'C4ptset=array(C4pt1,C4pt2,C4pt3,C4pt4) C1=rhino.addinterpcurve(C1ptset) 'creating C1 C2=rhino.addinterpcurve(C2ptset) 'creating C2 'C3=rhino.addinterpcurve(C3ptset) 'C4=rhino.addinterpcurve(C4ptset) C1m=rhino.addinterpcurve(C1mptset) C2m=rhino.addinterpcurve(C2mptset) call ribs(C1,C2,C2m,C1m) 'executing ribs end function 'curves 'create ribs between C1 and C2 function ribs(a,b,b1,a1) 'set ribs variable to a,b, for later substition of C1,C2 dim ribcurves 'declare ribcurves dim ribcurves1 'declare cross ribs dim ribcurves2 'declare ribcurves opposite 'dim riblines 'declare stright ribs dim i 'declare range dim param1,param2,param2a,param1a 'parameteres for curve domain dim Uval1,Uval2,Uval2a,Uval1a 'Umin and Umax dim pset1,pset2,pset2a,pset1a 'series of positions on C1 and C2 and C3 (mid points) redim pset3(2),pset3a(2),pset3b(2) 'series of midpoints across the 4 curves redim pset4(2),pset4a(2),pset4b(2) dim path,path2,path3,path4 'extrusion path dim subdiv 'number of subdivisions subdiv=10 redim ribsCrvset(subdiv) 'declare ribs group redim ribsCrvseta(subdiv) 'declare cross ribs group redim ribsCrvsetb(subdiv) 'declare ribs on mirror surface 'redim riblineset(subdiv) 'creating ribs for i=0 to subdiv 'i ranges from 0 to subdiv param1=rhino.curveDomain(a) 'param1 chooses curve domain, in this case C1 param2=rhino.curveDomain(b) 'param2 chooses curve domain, in this case C2 Uval1=((param1(1)-param1(0))/subdiv)*i 'determine subdivisions on UV scale on C1 Uval2=((param2(1)-param2(0))/subdiv)*i 'determine subdivisions on UV scale on C2 pset1=rhino.evaluateCurve(a,Uval1) 'mapping subdivisions (Uval1) on C1 pset2=rhino.evaluateCurve(b,Uval2) 'mapping subdivisions (Uval2) on C2 pset3(0)=(pset1(0)-(2*(subdiv-i))) 'x-coordinates of all mid points (C3) are adjusted pset3(1)=(pset1(1)) 'y-coordinates of all mid points (C3) are adjusted pset3(2)=(pset1(2)+pset2(2))/2 'z-coordinates of all mid points (C3) are adjusted pset4(0)=pset3(0)+1 'moving pset3 in x direction pset4(1)=pset3(1) 'other parameters remain as designated pset4(2)=pset3(2) param2a=rhino.curveDomain(b1) 'param2a,3a,4a refers to the parameters required for creating the top ribs Uval2a=((param2a(1)-param2a(0))/subdiv)*i pset2a=rhino.evaluateCurve(b1,Uval2a) pset3a(0)=(pset2a(0)+pset2(0))/2 'x-coordinates of mid points of cross ribs pset3a(1)=(pset2a(0)-(5*(subdiv-i)))'y-coordinates of mid points of corss ribs pset3a(2)=(pset2a(2)+(subdiv-i)) 'z-coordinates of mid points of cross ribs pset4a(0)=pset3a(0) 'dummy lines pset4a(1)=pset3a(1) 'dummy lines pset4a(2)=pset3a(2) 'dummy lines param1a=rhino.curvedomain(a1) 'create mirror curve Uval1a=((param1a(1)-param1a(0))/subdiv)*i pset1a=rhino.evaluateCurve(a1,Uval1a) pset3b(0)=(pset1a(0)+(2*(subdiv-i))) 'x-coordinates of all mid points are adjusted pset3b(1)=(pset1a(1)) 'y-coordinates of all mid points are adjusted pset3b(2)=(pset1a(2)+pset2a(2))/2 'z-coordinates of all mid points are adjusted ribcurves=rhino.addcurve(array(pset1,pset3,pset2)) 'produce rib curves ribcurves1=rhino.addcurve(array(Pset2,pset3a,pset2a)) 'produce cross ribs ribcurves2=rhino.addcurve(array(pset2a,pset3b,pset1a)) 'produce mirror ribs ribsCrvset(i)=ribcurves ribsCrvseta(i)=ribcurves1 ribsCrvsetb(i)=ribcurves2 path=rhino.addline(pset3,pset4) path2=rhino.addline(pset4,pset3) path3=rhino.addline(array(0,0,0),array(0,0,-0.5)) path4=rhino.addline(array(0,0,0),array(0,0,0.5)) call rhino.extrudecurve(ribcurves,path) call rhino.extrudecurve(ribcurves1,path3) call rhino.extrudecurve(ribcurves2,path2) next 'param3=rhino.curveDomain(c) 'param4=rhino.curveDomain(d) 'Uval3=((param3(1)-param3(0))/subdiv)*i 'determine subdivisions on UV scale on straight rib 1 'Uval4=((param4(1)-param4(0))/subdiv)*i 'determine subdivisions on UV scale on straight rib 2 'psets1=rhino.evaluatecurve(c,Uval3) 'psets2=rhino.evaluatecurve(d,Uval4) 'riblines=rhino.addline(psets1,psets2) 'riblineset(i)=riblines 'call rhino.extrudecurve(riblines,path) 'next 'next set of rib curves 'create positions on surface dim S1 'declare S1 as lofted surface S1=rhino.addloftsrf(ribscrvset) 'create Surface 1(left) dim St 'create top surface St=rhino.addloftsrf(ribscrvseta) dim Sm 'create mirror surface Sm=rhino.addloftsrf(ribscrvsetb) 'dim S2 'S2=rhino.addloftsrf(riblineset) dim j 'declare j range dim paramu,paramv,paramut,paramvt,paramum,paramvm 'declare parameters on u and v directions for surface domain for S1,St,Sm dim arrparam(1),arrparamt(1),arrparamm(1) 'declare Uvals and Vvals for subdivion dim arrpoint,arrpointt,arrpointm 'get a set of points on the surface in both U and V directions dim psetuv,psetuvt,psetuvm rhino.print "this is the limit: "+cstr(limit) dim limit limit=10 'limit number redim clpoints(limit,limit) redim clpointst(limit,limit) redim clpointsm(limit,limit) for j=0 to limit for k=0 to limit 'range of j paramu=rhino.surfacedomain(S1(0),0) 'set up paramu within S1 paramv=rhino.surfacedomain(S1(0),1) 'set up paramv arrparam(0)=paramu(0)+(((paramu(1)-paramu(0))/limit)*j) 'map out a series of U values along u direction of S1 arrparam(1)=paramv(0)+(((paramv(1)-paramv(0))/limit)*k) 'map out a serie sof V values along v direction of S1 arrpoint=rhino.evaluatesurface(S1(0),arrparam) 'Your code before 'psetuv=rhino.addpoints(arrpoint) 'You were calling rhino.addpoints('takes a multiple pt array') psetuv=rhino.addpoint(arrpoint) 'check to see if positions are successfully obtained clpoints(j,k)=arrpoint '========================================================== '===============YOU NEED TO COPY AND PASTE================= '=======================YOUR VARIABLES===================== '========================================================== 'Your problem was with the variable names you were using 'paramum twice instead of paramVm '===SAME WITH paramut paramut=rhino.surfacedomain(St(0),1) paramvt=rhino.surfacedomain(St(0),0) arrparamt(1)=(((paramut(1)-paramut(0))/limit)*j) arrparamt(0)=(((paramvt(1)-paramvt(0))/limit)*k) arrpointt=rhino.evaluatesurface(St(0),arrparamt) psetuvt=rhino.addpoint(arrpointt) clpointst(j,k)=arrpointt paramum=rhino.surfacedomain(Sm(0),1) paramvm=rhino.surfacedomain(Sm(0),0) arrparamm(1)=paramum(0)+(((paramum(1)-paramum(0))/limit)*j) arrparamm(0)=paramvm(0)+(((paramvm(1)-paramvm(0))/limit)*k) arrpointm=rhino.evaluatesurface(Sm(0),arrparamm) psetuvm=rhino.addpoint(arrpointm) clpointsm(j,k)=arrpointm next next 'important:psetuv returns a string, which is not usable when an array is required. 'next dim arrsrf,arrsrf1,arrsrf2 'declare group of surfaces for S1,St,Sm redim S3(limit-1,limit-1) 'single surface S3 redim Sst(limit-1,limit-1) 'single surface for top redim Ssm(limit-1,limit-1) 'single surface for mirror for j=0 to limit-1 'declare range for j, with limit-1 in order not to go out of range for k=0 to limit-1 'declare range for k, with limit-1 in order not to go out of range arrsrf=Rhino.AddSrfPt (array(clpoints(j,k),clpoints(j,k+1),clpoints(j+1,k+1),clpoints(1+j,k))) 'create group of surfaces by specifying points on S1. clpoints is a group S3(j,k)=arrsrf 'store S3 in arrsrf 'call addcircle3pt(array(clpoints(j+0.5,k+0.25),clpoints(j+0.25,k+0.5),clpoints(j+0.5,k+0.75))) arrsrf1=Rhino.AddSrfPt (array(clpointst(j,k),clpointst(j,k+1),clpointst(j+1,k+1),clpointst(1+j,k))) 'create group of surfaces by specifying points on S1. clpoints is a group Sst(j,k)=arrsrf1 arrsrf2=Rhino.AddSrfPt (array(clpointsm(j,k),clpointsm(j,k+1),clpointsm(j+1,k+1),clpointsm(1+j,k))) 'create group of surfaces by specifying points on S1. clpoints is a group Ssm(j,k)=arrsrf2 next next dim IsoCrv,isocrvt,isocrvm 'declare isocurve dim arrparameter,arrparametert,arrparameterm dim isoparam(1),isoparamt(1),isoparamm(1) 'declare isoparam: a set of uv values that are different from arrparam redim isoCrvset(limit),isoCrvsett(limit),isoCrvsetm(limit) 'define path2 for k=0 to limit isoparam(0)=paramu(0)+(paramu(1)-paramu(0)) 'u value of isoparam isoparam(1)=paramv(0)+(((paramv(1)-paramv(0))/limit)*k) 'v value of isoparam isopoint=rhino.evaluatesurface(S1(0),isoparam) rhino.print rhino.pt2str(isopoint) arrparameter=rhino.surfaceclosestpoint(S1(0),isopoint) rhino.command "_selcrv _hide" IsoCrv=Rhino.ExtractIsocurve(S1(0),arrparameter,0) 'extract isocurve in u direction isoCrvset(k)=isocrv call rhino.extrudecurve(isocrv(0),path2) rhino.print "this is the limit "+cstr(limit) 'setting up isocurves along top surface isoparamt(1)=paramut(0)+(paramut(1)-paramut(0)) 'set up isocurve parameter in v direction isoparamt(0)=paramvt(0)+(((paramvt(1)-paramvt(0))/limit)*k) 'set up isocurve paramter in u direction isopointt=rhino.evaluatesurface(St(0),isoparamt) 'establish points on surface, along which the isocurve is going to pass arrparametert=rhino.surfaceclosestpoint(St(0),isopointt) IsoCrvt=Rhino.ExtractIsocurve(St(0),arrparametert,1) 'extract isocurve in v direction isoCrvsett(k)=isocrvt call rhino.extrudecurve(isocrvt(0),path4) next call rhino.deleteobject(path) call rhino.deleteobject(path2) call rhino.deleteobject(s1(0)) end function curves