[Ironpython-users] out, in and byref
Lee Chaplin
lchaplin13 at gmail.com
Sun Jan 5 00:32:26 CET 2014
Hi,
I am trying to understand IPY by converting some VB.NET code to IPY and I
am stuck at some in/out and byref code.
In summary in VB I've got the line:
Call objEdge.GetFaces(NumFaces:=lngNumFaces, Faces:=objFaces)
where
Dim objFaces(1 To 2) As Geometry.Face
Dim lngNumFaces As Long
Public Sub GetFaces(ByRef *NumFaces* As Long, ByRef *Faces*() As Object)
ILSpy tells me that GetFaces (in a third party lib) has the definition (VB):
Sub GetFaces(<Out()> ByRef NumFaces As Integer,
<MarshalAs(UnmanagedType.SafeArray, SafeArraySubType =
VarEnum.VT_DISPATCH)> <[In]()> <Out()> ByRef Faces As Array)
I tried this
NumFaces = clr.Reference[float](2)
objFaces = clr.Reference[System.Array[Geometry.Face]]((None,None)) #?
NumFaces, objFaces = objEdge.GetFaces(NumFaces, objFaces)
but I've got an error saying:
Could not convert argument 1 for call to GetFaces.
Any help is greatly appreciated.
Lee
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20140105/8ff8bf92/attachment.html>
More information about the Ironpython-users
mailing list