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:
clr.AddReference("DWSIM.UnitOperations")fromDWSIM.UnitOperationsimportUnitOperations#get refference to the pipeline primitive on the current Flowsheetpipe=Flowsheet.GetFlowsheetSimulationObject('PIPE-1')pipe=pipe.GetAsObject()ps=UnitOperations.Auxiliary.Pipe.PipeSection()#fill the pipeline Hydraulic profileps.Indice=1# Segment indexps.Incrementos=10#Sections number (for result table rows)ps.Quantidade=1#Amountps.DE=150/25.4# External diameter in inps.DI=140/25.4# Internal diameter in inps.TipoSegmento="Straight Tube Section"ps.Material="PVC"ps.Comprimento=50#Length of the sectionps.PipeWallRugosity=1.5E-6#Rugosityps.Elevacao=2#Elevation difference in meterspipe.Profile.Sections.Clear()pipe.Profile.Sections.Add(1,ps)
👍
1
Last edit: Serhii Krushnevych 2024-01-07
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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:
but how is I can modify the "Comprimento" ("length") field?
I dig to PipeProfile Class
but can't understand how is the next steep.
Thanks.
https://sourceforge.net/p/dwsim/discussion/scripting/thread/2ac50b698f/?limit=25#53d7
My resolution of the question:
Last edit: Serhii Krushnevych 2024-01-07