<div dir="ltr"><div><div><div><div><div><div><div>Hi,<br><br></div>I am trying to understand IPY by converting some <a href="http://VB.NET">VB.NET</a> code to IPY and I am stuck at some in/out and byref code.<br></div>In summary in VB I've got the line:<br>
<br><span style="color:rgb(0,0,255)">Call</span> objEdge.GetFaces(NumFaces:=lngNumFaces, Faces:=objFaces)<br></div>where <br><span style="color:rgb(0,0,255)">Dim</span> objFaces(1 <span style="color:rgb(0,0,255)">To</span> 2) <span style="color:rgb(0,0,255)">As</span> Geometry.Face
<span style="color:rgb(0,0,255)"><br>Dim</span> lngNumFaces <span style="color:rgb(0,0,255)">As</span> <span style="color:rgb(0,0,255)">Long</span>
<br>Public Sub GetFaces(ByRef <i><a id="NumFacesPopupLink" class="">NumFaces</a></i> As Long, ByRef <i><a id="FacesPopupLink" class="">Faces</a></i>() As Object)<br><br></div>ILSpy tells me that GetFaces (in a third party lib) has the definition (VB):<br>
<span style="color:rgb(0,0,255)">Sub</span> GetFaces(<Out()> <span style="color:rgb(0,0,255)">ByRef</span> NumFaces <span style="color:rgb(0,0,255)">As</span> <span style="color:rgb(111,0,47)">Integer</span>, <MarshalAs(UnmanagedType.SafeArray, SafeArraySubType = VarEnum.VT_DISPATCH)> <[<span style="color:rgb(0,0,255)">In</span>]()> <Out()> <span style="color:rgb(0,0,255)">ByRef</span> Faces <span style="color:rgb(0,0,255)">As</span> Array)<br>
<br>I tried this <br> NumFaces = clr.Reference[float](2)<br> objFaces = clr.Reference[System.Array[Geometry.Face]]((None,None)) #?<br> NumFaces, objFaces = objEdge.GetFaces(NumFaces, objFaces)<br><br></div>but I've got an error saying:<br>
Could not convert argument 1 for call to GetFaces.<br><br></div>Any help is greatly appreciated.<br><br></div>Lee<br></div>