Forgot password?

Create an account!

Forum

« back

RhinoScript – Type Mismatch in parameters Array Required

Messages

Please log in to write a message.

  • 4. Barronzo (Jun 11, 2010 11.55):

    Thank you so much for that! Solved my head-scratching problem too. Trying to forget everything I know about C and get my head around VB... :/

    B.

  • 3. lmbgm (Mar 16, 2010 23.13):

    Thanks, I finally figured that out this morning.

  • 2. Hanno (Mar 16, 2010 10.40):

    Hi,

    both methods do work. The error is simply that you dimension arrVertices with size 8 (which means 0-8 including 8) and you assign only 0-7, so arrVertices(8) is undefined.

    Regards

    Hanno

  • 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.

Recommend

Why are these buttons gray?