(save-preview-diagram)=
IDAES UI allows you to preview your flowsheet diagram at any time while working on it by calling export_flowsheet_diagram
.
The export_flowsheet_diagram function is used to return the current view of the flowsheet diagram at any time after you have initialized your model.
- It can save the diagram to your preferred path or the default path.
- It can display the current view of the flowsheet diagram in a Jupyter Notebook.
export_flowsheet_diagram
takes three parameters:
flowsheet
: The flowsheet objectname
: The diagram filename or full path where you prefer to save the diagram. The output format is determined by the file extension (".svg" for SVG and ".png" for PNG).display
: Boolean, to determent if you want to review current flowsheet in jupyter notebook
-
Import
export_flowsheet_diagram
function fromidaes_ui
packagefrom idaes_ui.fv.fsvis import export_flowsheet_diagram
-
Create your model. Here we assume the model is called
m
and the top-level flowsheet that you want to view ism.fs
. -
After initializing your model, you should have
m.fs
.
Then, you can callexport_flowsheet_diagram
.export_flowsheet_diagram(m.fs, '~/Download/my_flowsheet_diagram.svg', display=True)
-
Then, you can see the flowsheet diagram's saved path in the log.
- To view the image, after calling
export_flowsheet_diagram
, you can visit the path shown in the log. - To view the flowsheet diagram in a Jupyter Notebook, set
display=True
. This will automatically display the flowsheet diagram in the notebook.
:width: 800
:nocontrols:
:autoplay: true
:loop: