It needs to change the ExecutionPolicy (if needed) and run the PowerShell console with Administrator privileges. ExecutionPolicy change to Unrestricted PS command: Set-ExecutionPolicy Today I received the same error "Invalid Class..." while saving the file. Tried to manually fix it by winmgmt, but it shows "all OK". Only the WMI-Fixer-Tool helps.
My resolution of the question: clr.AddReference("DWSIM.UnitOperations") from DWSIM.UnitOperations import UnitOperations #get refference to the pipeline primitive on the current Flowsheet pipe = Flowsheet.GetFlowsheetSimulationObject('PIPE-1') pipe = pipe.GetAsObject() ps = UnitOperations.Auxiliary.Pipe.PipeSection() #fill the pipeline Hydraulic profile ps.Indice = 1 # Segment index ps.Incrementos = 10 #Sections number (for result table rows) ps.Quantidade = 1 #Amount ps.DE = 150 / 25.4 # External...
My resolution of the question: clr.AddReference("DWSIM.UnitOperations") from DWSIM.UnitOperations import UnitOperations pipe = Flowsheet.GetFlowsheetSimulationObject('PIPE-1') pipe = pipe.GetAsObject() ps = UnitOperations.Auxiliary.Pipe.PipeSection() #fill the pipeline Hydraulic profile ps.Indice = 1 # Segment index ps.Incrementos = 10 #Sections number (for result table rows) ps.Quantidade = 1 #Amount ps.DE = 150 / 25.4 # External diameter in in ps.DI = 140 / 25.4 # Internal diameter in in ps.TipoSegmento...
This is work for me: pipe.Profile.Sections.Clear() pipe.Profile.Sections.Add(1,ps) pipe.Profile.Sections.Add(1,ps) instead of pipe.PipeProfile.Sections.Add(ps)
If I make correct code, this is work: pipe.Profile.Sections.Clear() pipe.Profile.Sections.Add(1,ps) pipe.Profile.Sections.Add(1,ps) instead of pipe.PipeProfile.Sections.Add(ps)
Hello, I tried to set pipeline lengths with the example shown above, but have the error AttributeError: 'Pipe' object has no attribute 'PipeProfile' on the line: pipe.PipeProfile.Sections.Add(ps) I tryed to add pipe = pipe.GetAsObject() but the same error Full code: import clr from System.IO import Directory, Path, File from System import String, Environment dwsimpath = "C:\\Users\\Serhii\\AppData\\Local\\DWSIM\\" Directory.SetCurrentDirectory(dwsimpath) clr.AddReference("DWSIM.UnitOperations") from...
Hi! I tried to make calculations using a Python Script for the Pipeline segment with different lengths (sets by table). How is I can change the pipe segment length from the Python script (see attached screenshot)? I found "<comprimento>1</comprimento>" in the output of the next code: pipeline = Flowsheet.GetFlowsheetSimulationObject('PIPE-1') PipProf = pipeline.Profile.SaveData() but how is I can modify the "Comprimento" ("length") field? I dig to PipeProfile Class but can't understand how is the...
I work in the natural gas industry and normal cubic meters per hour are the main units. It will be great to add it in future releases, including to the input form of stream parameters.