Menu

NullReferenceException

2021-08-20
2021-12-10
  • Vikram Sundara

    Vikram Sundara - 2021-08-20

    Hi,

    I tried to run Automation.Automation2() but it throws up a NullReferenceException. Is there an issue?

    process=DWSIM.Automation.Automation2()

    NullReferenceException: Object reference not set to an instance of an object.
    at DWSIM.Automation.Automation2..ctor() in C:\Users\Daniel\source\repos\DanWBR\dwsim6\DWSIM.Automation\Interface.cs:line 145

     
  • Lucas Francisco dos Santos

    Hey Vikram Sundara,

    Have you figured out how to solve this issue with Automation2()? I am facing the same problem whenever I try to instanciate a second interface object with Automation2().

     
  • Lucas Francisco dos Santos

    Perhaps the answer is in my previous comment: there must be only one instance of automation manager for multiple flowsheet objects.

    from DWSIM.Automation import Automation2
    
    if ('interf' not in locals()):    # create automation manager
        interf = Automation2()
    
    flowsheet1 = interf.LoadFlowsheet('path/to/simulation1')
    flowsheet2 = interf.LoadFlowsheet('path/to/simulation2')
    

    That worked for me.

     
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.