First Beta version of GSPython.dll is now available. You can write Python code inside your c-script files.

At the moment the only thing you can pass back and forth between Python and Acknex are strings.

Any feedback would be appreciated.

Download Now

Example:

Code:
 
include <gspython.wdl>;

// Define a string for you to use. I default it to 1000 characters here.
string MyPythonString[1000];

text python_txt
{

layer = 1;
pos_x = 50;
pos_y = 50;
strings = 1;
font = standard_font;
string = MyPythonString;
alpha = 100;
flags = narrow, transparent, visible;

}

function EvaluatePython() {

dll_handle = dll_open("GSPython.dll");

// Fill our test string with something
str_cpy(MyPythonString,"123");

// Create and Initialize the Python Engine
Python_Init();

// Link MyPythonString to a string variable defined in Python named AckNexStr.
// Changes to one effect changes to the other.
Python_LinkStr("AckNexStr",MyPythonString);

// Evaluate code.
Python("

# Print goes nowhere right now
print 2+2

# Test the Acknex<->Python string interface
AckNexStr.Value = AckNexStr.Value + '456' + AckNexStr.Value

");

// Free the Python Engine
Python_Free();

dll_close(dll_handle);

}





Buy, Sell, & Archive Realtime 3D Content @ RedRock7.com *BETA* A5.5+ Plugin DLLs: GSADO, GSHTTP, GSImgLst, FreeMod, GSFlash, GSPython http://cellulear.slashbang.com/