function initMXPscriptingAPI
% MotorXP-AFM scripting API initialization
addpath([cd '/m']);
addpath([cd '/bin']);
addpath([cd '/Circuits']);
addpath([cd '/SimScripts']);
addpath(genpath([cd '/CustomScripts']));
addpath([cd '/m/scrptapi']);
addpath([cd '/m/scrptapi/TSEMO']);
addpath([cd '/m/scrptapi/TSEMO/NGPM_v1.4']);
addpath([cd '/m/scrptapi/TSEMO/Mex_files/invchol']);
addpath([cd '/m/scrptapi/TSEMO/Mex_files/pareto front']);
addpath([cd '/m/scrptapi/TSEMO/Mex_files/hypervolume']);
addpath([cd '/m/scrptapi/TSEMO/Direct']);
addpath([cd '/m/scrptapi/TSEMO/minimizef']);
if libisloaded('MotorXPStub')
    unloadlibrary('MotorXPStub')
end
[notfound,warnings] = loadlibrary('MotorXPStub.dll', 'MotorXP.h');
if ~checklicense_()
    error('License expired or not valid');
end