Quantcast
Channel: Measurement Studio for .NET Languages topics
Viewing all articles
Browse latest Browse all 2011

3D surface plot image handled by IronPython as a batch operation

$
0
0

Hi, All

 

I wrote a data acquisition package based on the Measuresurement Studio 2012. In the package the data can be interactively displayed in 3D graphics (not intensity image) by CW3DGraph activeX component. Because we are doing a process and take images every 5 second, so the whole process will have a few thousand images. I implemented IronPython im my C# application (Measurement Studio in C#), and trying to use the IronPython script to handle files in batch mode. However, when I try to create the class from the script, error message shows like:

 

"ActiveX control '2afa9f10-0b6a-11d2-a250-00a024d8324d' cannot be instantiated because the current thread is not in a single-threaded apartment."

 

Here are the class:

publicclassplr3DImage

{

public plr3DImage()

{

Initialize();

}

[STAThread]

privatevoid Initialize()

{

#error msg at the following line

AxCW3DGraphLib.AxCWGraph3D graph3D = new AxCW3DGraphLib.AxCWGraph3D();

graph3D.CreateControl();

}

}

 

 

please note that I have already add a [STAThread] before the method to inform the enviroment will be Single Thread Appartment.

 

Anybody can tell me how to get around the problem? Thank you in advance.

 

Dufei


Viewing all articles
Browse latest Browse all 2011

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>