1. lmbgm (Mar 15, 2010 23.16):
I'm fairly experienced with programming, but not with VBScript. I am trying to write a simple script to import meshes from a file listing vertices and faces.
When I use the script example for addmesh, it works fine. When I change from assiging array elements one by one to doing it in a loop, I get an error saying "Type Mismatch in parameters. Array Required". I tried "vartype" in both cases and get 8204 as a result for both, so I'm not sure what the issue is. I must use a loop to assign array elements since I plan to read in a file.
Code example below: If I assign elements of ArrVertices like show below, I get the error. If I assign arrVertices elements one by one like arrFaceVertices, then I get no error.
Dim index
Dim arrVertices(8)
index = 0
While index < 8
arrVertices(index) = Array(0.0, 0.0, 0.0)
index=index+1
Wend
Dim arrFaceVertices(7)
arrFaceVertices(0) = Array(0,1,4,4)
arrFaceVertices(1) = Array(2,4,1,1)
arrFaceVertices(2) = Array(0,4,3,3)
arrFaceVertices(3) = Array(2,5,4,4)
arrFaceVertices(4) = Array(3,4,6,6)
arrFaceVertices(5) = Array(5,8,4,4)
arrFaceVertices(6) = Array(6,4,7,7)
arrFaceVertices(7) = Array(8,7,4,4)
Rhino.AddMesh arrVertices, arrFaceVertices
I'd greatly appreciate some help. Thanks.