Search code examples
python.netclrironpythonpython.net

Inca Open Experiment Python


I am working on python and i need to use a Tool named "Inca". Now i am able to run remotely this tool but i can't to open an experiment located in a specific workspace.

import sys,clr
sys.path.append("*path*")
clr.AddReference("incacom")

from de.etas.cebra.toolAPI.Inca import*

targetFolder = None
myDB = None
tempItemm = None

a = Inca()

myDB = a.GetCurrentDataBase()

tempItem = myDB.GetItemInFolder("*par1"*, "*par2*")

w = myDB.GetActivehardwareConfiguration()
exp = w.GetAssignedExperimentEnviroment()
e = exp.OpenExperiment()

Solution

  • It looks like you have a configuration problem. Either you don't have an active hardware configuration, or an experiment environment wasn't assigned to it. As a result, one of your calls returns None, which you don't check for, and the next call fails because NoneType doesn't have the method you expect.

    Nevertheless, if you know the name of your experiment environment, you can always find it via BrowseItem call on your Inca database:

    a.GetCurrentDataBase().BrowseItem('MyExperiment')[0].OpenExperiment()