python API boilerplate code

I would like to access the python API using external application. In previous versions of Plaxis, i had to add the following boilerplate at the beginning:

import imp,sys
sys.path.append("C:\Program Files\Plaxis\PLAXIS 2D\python\Lib\site-packages")
plaxis_path = r'C:\Program Files\Plaxis\PLAXIS 2D\python\Lib\site-packages'
found_module = imp.find_module('plxscripting', [plaxis_path])
plxscripting = imp.load_module('plxscripting', *found_module)
from plxscripting.easy import *
localhostport0 = 10000
s_i, g_i = new_server('localhost', localhostport0, password='*PASSWORD*')

What is the boilercode for the Plaxis CE version?

Parents Reply Children
No Data