Activity for AlbertoB

  • AlbertoB AlbertoB modified a comment on discussion Developer's Corner

    Dear all! Cloning commit (cccce25) and building it using Visual Studio 2019 DWSIM.sln Debug-x64 under Windows 11 raises an excpetion flag whenever Python.Net is selected under a Python UO or Script Manager. The exception is as follows: System.TypeInitializationException: The type initializer for 'Python.Runtime.UcsMarshaler' threw an exception. ---> System.IO.FileNotFoundException: Could not load file or assembly Any ideas how to solve it? UPDATE 1: Trying different commits some of them work and...

  • AlbertoB AlbertoB modified a comment on discussion Developer's Corner

    Dear all! Cloning commit (cccce25) and building it using Visual Studio 2019 DWSIM.sln Debug-x64 under Windows 11 raises an excpetion flag whenever Python.Net is selected under a Python UO or Script Manager. The exception is as follows: System.TypeInitializationException: The type initializer for 'Python.Runtime.UcsMarshaler' threw an exception. ---> System.IO.FileNotFoundException: Could not load file or assembly Any ideas how to solve it? UPDATE: Trying different commits some of them work and others...

  • AlbertoB AlbertoB modified a comment on discussion Developer's Corner

    Dear all! Cloning commit (cccce25) and building it using Visual Studio 2019 DWSIM.sln Debug-x64 under Windows 11 raises an excpetion flag whenever Python.Net is selected under a Python UO or Script Manager. The exception is as follows: System.TypeInitializationException: The type initializer for 'Python.Runtime.UcsMarshaler' threw an exception. ---> System.IO.FileNotFoundException: Could not load file or assembly Any ideas how to solve it? UPDATE: Trying different commits some of them work and others...

  • AlbertoB AlbertoB modified a comment on discussion Developer's Corner

    Dear all! Cloning commit (cccce25) and building it using Visual Studio 2019 DWSIM.sln Debug-x64 under Windows 11 raises an excpetion flag whenever Python.Net is selected under a Python UO or Script Manager. The exception is as follows: System.TypeInitializationException: The type initializer for 'Python.Runtime.UcsMarshaler' threw an exception. ---> System.IO.FileNotFoundException: Could not load file or assembly Any ideas how to solve it? Best regards

  • AlbertoB AlbertoB posted a comment on discussion Developer's Corner

    Dear all! Cloning commit (cccce25) and building it using Visual Studio 2019 DWSIM.sln Debug-x64 under Windows 11 raises an excpetion flag whenever Python.Net is selected under a Python UO or Script Manager. The exception is as follows: System.TypeInitializationException: The type initializer for 'Python.Runtime.UcsMarshaler' threw an exception. ---> System.IO.FileNotFoundException: Could not load file or assembly Any ideas how to solve it? Best regards

  • AlbertoB AlbertoB modified a comment on discussion Python Scripting

    Solution UPDATE: Going through all object contained inside a flowsheet using a for loop. For each object generate a IScript dictionary as follows: import clr import System import uuid clr.AddReference("DWSIM.Interfaces") from System.Collections.Generic import List, Dictionary import DWSIM.Interfaces def createScript(obj_name): #GUID = str(uuid.uuid1()) GUID = obj_name Flowsheet.ScriptCollection.Add(GUID, DWSIM.FlowsheetSolver.Script()) #By not declaring the ID the tabs of each script is not loaded...

  • AlbertoB AlbertoB posted a comment on discussion Python Scripting

    Solution UPDATE: Going through all object contained inside a flowsheet using a for loop. For each object generate a IScript dictionary as follows: import clr import System clr.AddReference("DWSIM.Interfaces") from System.Collections.Generic import List, Dictionary import DWSIM.Interfaces def createScript(obj_name): #GUID = str(uuid.uuid1()) GUID = obj_name Flowsheet.ScriptCollection.Add(GUID, DWSIM.FlowsheetSolver.Script()) #By not declaring the ID the tabs of each script is not loaded #Flowsheet.ScriptCollection.TryGetValue(GUID)[1].ID...

  • AlbertoB AlbertoB posted a comment on discussion Python Scripting

    Sure, the problem is that I do not know which object is being calculated. Ideally would be to have an event which tells that a new calculation in an object started and which object is being calculated. In that way I can have a single function which is getting that info and doing something instead of having a script link to an event for every object in my flow sheet.

  • AlbertoB AlbertoB posted a comment on discussion Python Scripting

    Dear all I am programming a series of functions which they need to be linked to the start of the calculation of each specific object. I know I can do it through the script manager and that works great. The problem comes when I have over 50 objects. I don't want to have 50 scripts each one linked to their own object. Is there a way I can catch the calculationStarted event so I can run an specific function? I went through the code and apparently there is no event creation it is just a direct call to...

  • AlbertoB AlbertoB posted a comment on discussion Dynamic Simulation

    Dear all, I am staring to play around the dynamic simulation utility. As a first trial (after going through all the examples) I want to control the level and pressure of a tank using as an inlet stream Ethanol/CO2 . I am using PR and at steady state solves perfectly. As soon as a switch to dynamic mode, within the first 1 or 2 seconds I get the following error: System.Exception: V-1: Index was outside the bounds of the array. ---> System.IndexOutOfRangeException: Index was outside the bounds of the...

  • AlbertoB AlbertoB modified a comment on discussion Python Scripting

    Dear all, I have a dll written in C and I am trying to access it using the ironpython implementation on DWSIM. Whenever call the dll using the interactive IronPython Console it works perfectly. But when I try to import ctypes on the Script Manager of DWSIM it return the error: importError: No module named ctypes. Are the ironPython versions used in the console and script manager different? Best regards UPDATE: In order to load the standard library the following lines are needed: import sys sys.path.append(r"C:............\DWSIM6\Lib")...

  • AlbertoB AlbertoB modified a comment on discussion Python Scripting

    Dear all, I have a dll written in C and I am trying to access it using the ironpython implementation on DWSIM. Whenever call the dll using the interactive IronPython Console it works perfectly. But when I try to import ctypes on the Script Manager of DWSIM it return the error: importError: No module named ctypes. Are the ironPython versions used in the console and script manager different? Best regards UPDATE: In order to load the standard library the following lines are needed: import sys sys.path.append(r"C:\...\...\...\...\DWSIM6\Lib")...

  • AlbertoB AlbertoB posted a comment on discussion Python Scripting

    Dear all, I have a dll written in C and I am trying to access it using the ironpython implementation on DWSIM. Whenever call the dll using the interactive IronPython Console it works perfectly. But when I try to import ctypes on the Script Manager of DWSIM it return the error: importError: No module named ctypes. Are the ironPython versions used in the console and script manager different? Best regards

1