'declarar de variables Dim arrCenter, dblRadius Dim arrCenter2, dblRadius2 Dim arrCenter3, dblRadius3 Dim arrCenter4, dblRadius4 Dim arrCenter5, dblRadius5 Dim arrCenter6, dblRadius6 dim curve1 dim curve2 dim curve3 dim curve4 dim curve5 dim curve6 dim superficie dim uDomain dim vDomain dim uParam dim vParam dim i dim j dim uSecciones dim vSecciones dblRadius = 8 arrCenter = Rhino.GetPoint("Center of circle") If IsArray(arrCenter) Then curve1 = Rhino.AddCircle( arrCenter, dblRadius ) End If dblRadius2 = 5 arrCenter2 = Rhino.GetPoint("Center of circle") If IsArray(arrCenter2) Then curve2 = Rhino.AddCircle( arrCenter2, dblRadius2 ) End If dblRadius3 = 5 arrCenter3 = Rhino.GetPoint("Center of circle") If IsArray(arrCenter3) Then curve3 = Rhino.AddCircle( arrCenter3, dblRadius3 ) End If dblRadius4 = 8 arrCenter4 = Rhino.GetPoint("Center of circle") If IsArray(arrCenter4) Then curve4 = Rhino.AddCircle( arrCenter4, dblRadius4 ) End If dblRadius5 = 25 arrCenter5 = Rhino.GetPoint("Center of circle") If IsArray(arrCenter4) Then curve5 = Rhino.AddCircle( arrCenter5, dblRadius5 ) End If dblRadius6 = 45 arrCenter6 = Rhino.GetPoint("Center of circle") If IsArray(arrCenter6) Then curve6 = Rhino.AddCircle( arrCenter6, dblRadius6 ) End If 'Loft circulos superficie = Rhino.AddLoftSrf(Array(curve1,curve2,curve3,curve4,curve5,curve6)) uSecciones = 9 vSecciones = 9 'coleccion de objetos colecciones para puntos redim colec2d(usecciones,vSecciones) 'get the u and v domain uDomain = Rhino.SurfaceDomain(superficie(0) , 0) vDomain = Rhino.SurfaceDomain(superficie(0) , 1) 'loop through the surface for i = 0 to uSecciones for j = 0 to vSecciones 'calculate the uParam 'uparam = Umin + (Umax-Umin)/secciones uParam = uDomain(0) + i*(uDomain(1)-uDomain(0))/uSecciones vParam = vDomain(0) + j*(vDomain(1)-vDomain(0))/uSecciones 'get the point array from the surface point = Rhino.EvaluateSurface(superficie(0) , array(uParam, vParam)) 'add point to rhino colec2d(i,j) = point next next 'an example of how point control works dim esquina1 dim esquina2 dim esquina3 dim esquina4 redim colec2pipe(usecciones,vSecciones) 'ciclos throug colec2d for i = 0 to uSecciones-1 for j = 0 to Vsecciones-1 'draw point in Rhino 'Rhino.addpoint(colec2d(i,j)) esquina1 = colec2d(i,j) esquina2 = colec2d(i+1,j) esquina3 = colec2d(i+1,j+1) esquina4 = colec2d(i,j+1) 'call a function that takes 4 points colec2pipe(i,j) = miFunction(esquina1, esquina2, esquina3, esquina4) next next function mifunction(pt1, pt2, pt3, pt4) 'cross truss dim radius redim cruz(0) redim cruz(1) redim cruz(2) redim cruz(3) radius = 1.0 call Rhino.addline(pt1, pt3) call Rhino.addline(pt2, pt4) call Rhino.addline(pt3, pt1) call Rhino.addline(pt4, pt2) cruz(0) = Rhino.addline(pt1, pt3) cruz(1) = Rhino.addline(pt2, pt4) cruz(2) = Rhino.addline(pt3, pt1) cruz(3) = Rhino.addline(pt2, pt4) Rhino.SelectObject(cruz(1)) Rhino.Command "_Pipe " & radius & " Enter " & radius & " Enter" Rhino.SelectObject(cruz(0)) Rhino.Command "_Pipe " & radius & " Enter " & radius & " Enter" Rhino.SelectObject(cruz(2)) Rhino.Command "_Pipe " & radius & " Enter " & radius & " Enter" Rhino.SelectObject(cruz(3)) Rhino.Command "_Pipe " & radius & " Enter " & radius & " Enter" mifunction = cruz end function Rhino.HideObject superficie(0)