VarianAPIs / PyESAPI

Python interface to Eclipse Scripting API
MIT License
76 stars 32 forks source link

PyESAPI: Getting Started. Value cannot be null #33

Open AntonTroitskii opened 2 months ago

AntonTroitskii commented 2 months ago

I am trying to do what is described here on our T-Box station.

import pyesapi
import atexit
app = pyesapi.CustomScriptExecutable.CreateApplication('test')
atexit.register(app.Dispose)

I have an error in my ouput:

ArgumentNullException                     Traceback (most recent call last)
Cell In[1], line 3
      1 import pyesapi
      2 import atexit
----> 3 app = pyesapi.CustomScriptExecutable.CreateApplication('test')
      4 atexit.register(app.Dispose)

ArgumentNullException: Value cannot be null.
   at System.Threading.Monitor.Enter(Object obj)
   at VMS.TPS.Common.Model.ApplicationBase.remove_OnDataReload(Action value)
   at VMS.TPS.Common.Model.StructureCodeTable.ResetInstance()
   at VMS.TPS.Common.Model.ApplicationBase.UninitializeDataObjectCache()
   at VMS.TPS.Common.Model.ApplicationNonAppFrame._Dispose()
   at VMS.TPS.Common.Model.ApplicationNonAppFrame.Dispose(Boolean A_0)
   at VMS.TPS.Common.Model.ApplicationBase.Dispose()
   at VMS.TPS.Common.Model.API.Application.CreateApplicationCommon(String scriptName, Func`2 createExecutionGuardFunc)

I am using pipenv to create environment for my jupyter-notebook.

pyesapi==0.2.5 ├── numpy [required: Any, installed: 2.1.0] ├── pynetdicom [required: Any, installed: 2.1.1] │ └── pydicom [required: >=2.4,<2.5, installed: 2.4.4] ├── pythonnet [required: Any, installed: 3.0.3] │ └── clr-loader [required: >=0.2.6,<0.3.0, installed: 0.2.6] │ └── cffi [required: >=1.13, installed: 1.17.0] │ └── pycparser [required: Any, installed: 2.22] ├── pywin32 [required: Any, installed: 306] └── scipy [required: Any, installed: 1.14.1] └── numpy [required: >=1.23.5,<2.3, installed: 2.1.0]

Python 3.11.9

fizxmike commented 2 months ago

What version of Eclipse is on your T-Box? Also, you must set database to research mode in RT Admin.

AntonTroitskii commented 2 months ago

What version of Eclipse is on your T-Box?

We have 15.6 Eclipse on our T-box. By the way we have 16.1 version of our main Eclipse and I could connect via pyesapi using our common Eclipse station. But why can't I do this on our T-Box station?

Also, you must set database to research mode in RT Admin. I set DataBase to research mode in RT Admin and it didn't change anithing.