title: IronPython: Message: expected c_double, got c_double_Array_3
body: <p>I’m currently developing a script using the python script editor in Rhino. As I’m currently working in a Windows machine, the script editor uses IronPython as language.</p>
  
  <p>In the same script, I want to interact with an FE software (Straus7) which has a Python API. When doing so, I have experienced some problems as the ctypes module does not seem to work in IronPython the same way it does in <strong>regular Python</strong>. Especially, I’m finding problems when initializing arrays using the command:</p>
  
  <pre><code>ctypes.c_double*3
  </code></pre>
  
  <p>For example, if I want to obtain the XYZ coordinates of a node #1 in the FE model, I regular Python I would write the following:</p>
  
  <pre><code>XYZType = ctypes.c_double*3
  XYZ = XYZType()
  node_num = 1
  st.St7GetNodeXYZ(1,node_num,XYZ)
  </code></pre>
  
  <p>And this returns me a variable XYZ which is a 3D array such that:</p>
  
  <pre><code>XYZ -&gt; &lt;straus_userfunctions.c_double_Array_3 at 0xc5787b0&gt;
  XYZ[0] = -0.7xxxxx -&gt; (X_coord)
  XYZ[1] = -0.8xxxxx -&gt; (Y_coord)
  XYZ[2] = -0.9xxxxx -&gt; (Z_coord)
  </code></pre>
  
  <p>On the other side, I copy the same exact script in <strong>IronPython</strong>, the following error message appears</p>
  
  <pre><code>Message: expected c_double, got c_double_Array_3
  </code></pre>
  
  <p>Obviously, If I change the variable XYZ to c_double; then it becomes a double variable which contains only a single entry, which corresponds to the first element of the array (in this case, the X-coordinate)</p>
  
  <p>This situation is quite annoying as all FEM softwares, the usage of matrices and arrays is widely used. Consequently, I wanted to ask if anyone nows a simple fix to this situation.</p>
  
  <p>I was thinking of using the memory allocation of the first element of the array to obtain the rest but I’m not so sure how to do so.</p>
  
  <p>Thanks a lot. Gerard</p>