how to pass an array to a VB array via COM

jelle jelleferinga at gmail.com
Tue Apr 26 17:21:22 EDT 2005


Thomas,

No, i went over the syntax extensively. The syntax is
RS.AddCurve(points, degree), so 3 represents the degree of a bezier
curve. I'm doing fine with all types of functions which use 2 x,y,z
coords, but all arrays -tuple of tuples- fail. The odd thing is that
when i use RS.GetPoints() which is a method to get back user-defines
x,y,z points, i get a tuple of tuples containing these points. Though
when i write these back to the program,  all fails:

I admit posting this problem also to the more specific python-win32
group, though no response there yet...

>>>s = RS.GetPoints()
>>>s
((-7.0, -30.0, 0.0), (15.0, -24.0, 0.0), (-7.0, 12.0, 0.0), (14.0,
29.0,
0.0), (28.0, 10.0, 0.0), (20.0, 1.0, 0.0))

Cool, I get to choose points in the GUI, right back into python,
wicked!
Though when I send these points back to the app:
RS.AddPolyline(s)
The same error all over again:
---
Traceback (most recent call last):
  File "<input> ", line 1, in ?
  File "c:\Python23\lib\site-packages\jf\interface\RhinoScript.py",
line
129, in AddPolyline
    return self._ApplyTypes_(85, 1, (12, 0), ((12, 0),), 'AddPolyline',
None,vaPoints)
  File "c:\Python23\lib\site-packages\win32com\client\__init__.py",
line
446, in _ApplyTypes_
    return self._get_good_object_(
com_error: (-2147352567, 'Exception occurred.', (6, 'RhinoScript_m',
'Type
mismatch in parameter.  One-dimensional array required.', 'C:\\Program
Files\\Rhinoceros 3.0\\RhinoScript_m.HLP', 393222, 0), None)
---




More information about the Python-list mailing list