hysys物料输出EXCEL工具
hysys物料输出EXCEL工具 下载来尝试一下,看看功能如何? 原来是hysys的,希望实用 输出工具没法打开啊,楼主怎么回事呢?谢谢! 这个工具所有hysys版本都能用么? 好人,好坛,好贴。好人,好坛,好贴。
好人,好坛,好贴。 温度(℃)演示版本,有限制
压力(kPa)演示版本,有限制
温度、压力等几个常用的量导不出,可能是hysys不是正版吧。 不好用么??? 好好琢磨琢磨。 楼主啊,高手啊 怎么样啊
看到有些问题 怎么样啊
看到有些问题 asw软件就可以到达这样的效果,不知道这个会怎么样 回复 1# Horse
好东西,如果能有截图说明下使用方法就更棒了。支持。 会用vba的话,要用excel检索hysys结果实际上很简单,比如
Dim hyCase As Object
Sub ConnectHYSYS()
On Error GoTo ErrorTrap
Set hyApp = GetObject(, "HYSYS.Application")
Set hyCase = hyApp.ActiveDocument
If hyCase Is Nothing Then
MsgBox "A HYSYS simulation case must be open."
Exit Sub
End If
Clear
GetStreamData
Exit Sub
ErrorTrap:
If Err = 429 Or Err = 483 Then
MsgBox "HYSYS is not currently running."
Else
MsgBox "The following error (" & Err & ") occurred: " & Error(Err)
End If
End Sub
Sub OpenHYSYS()
' Set hyApp = GetObject(, "HYSYS.Application")
' If Err = 483 Then MsgBox "HYSYS is not running."
On Error GoTo ErrorTrap
CaseName = Application.GetOpenFilename("HYSYS Simulation Case (*.hsc), *.hsc")
If CaseName = "False" Then
Exit Sub
End If
Set hyCase = GetObject(CaseName, "HYSYS.SimulationCase")
GetStreamData
hyCase.Close
Exit Sub
ErrorTrap:
MsgBox "The following error occurred:" & Error(Err), Buttons:=48
End Sub
'Get HYSYS stream data
Sub GetStreamData()
On Error GoTo ErrorTrap
Dim hyStreams As Object
Dim hyStream As ProcessStream
Dim xlSheet As Worksheet
Dim hyfluid As Fluid
Dim OptionButtons As OptionButtons
Dim OptionButton As OptionButton
Dim SIValue As Boolean
Set hyStreams = hyCase.Flowsheet.MaterialStreams
Set xlSheet = Worksheets("Stream Data")
Set OptionButtons = Worksheets("Main").OptionButtons
Clear
For Each OptionButton In OptionButtons
If OptionButton.Value = xlOn Then Exit For
Next
With xlSheet
i = 0
For Each hyStream In hyStreams
.Cells(3 + i, 1) = hyStream.Name
.Cells(3 + i, 2) = Format(hyStream.VapourFractionValue, "0.###")
.Cells(3 + i, 3) = Format(hyStream.Temperature.GetValue("K"), "##.###")
.Cells(3 + i, 4) = Format(hyStream.Pressure.GetValue("kg/cm2"), "0.###")
.Cells(3 + i, 5) = Format(hyStream.Pressure.GetValue("bar"), "0.###")
.Cells(3 + i, 6) = Format(hyStream.MolarFlow.GetValue("Nm3/h(gas)"), "0.##")
.Cells(3 + i, 7) = Format(hyStream.ComponentMolarFraction.Values(0), "0.000000")
.Cells(3 + i, 8) = Format(hyStream.ComponentMolarFraction.Values(1), "0.000000")
.Cells(3 + i, 9) = Format(hyStream.ComponentMolarFraction.Values(2), "0.000000")
.Cells(3 + i, 10) = Format(hyStream.ActualVolumeFlow.GetValue("m3/h"), "0.##")
.Cells(3 + i, 11) = Format(hyStream.MassFlow.GetValue("kg/h"), "0.##")
.Cells(3 + i, 12) = Format(hyStream.CpCv, "0.####")
If hyStream.Compressibility > 0 Then
.Cells(3 + i, 13) = Format(hyStream.Compressibility, "0.#####")
Else
.Cells(3 + i, 13) = "N/A"
End If
If hyStream.Viscosity > 0 Then
.Cells(3 + i, 14) = Format(hyStream.Viscosity, "0.#####")
Else
.Cells(3 + i, 14) = "N/A"
End If
.Cells(3 + i, 15) = Format(hyStream.MassDensity.GetValue("kg/m3"), "0.###")
Set hyfluid = hyStream.DuplicateFluid
On Error Resume Next
.Cells(3 + i, 17) = Format(hyfluid.BubblePointPressureValue / 100, "0.000")
i = i + 1
Next hyStream
Set hyStreams = hyCase.Flowsheet.EnergyStreams
For Each hyStream In hyStreams
.Cells(3 + i, 1) = " " + hyStream.Name
.Cells(3 + i, 4) = "kW"
.Cells(3 + i, 3) = Format(hyStream.Power, "#.#")
i = i + 1
Next hyStream
xlSheet.Select
Selection.Sort Key1:=Range("A3"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, SortMethod _
:=xlPinYin
End With
Exit Sub
ErrorTrap:
MsgBox "The following error occurred:" & Error(Err), Buttons:=48
End Sub
以上代码各个版本hysys都能使用,当然你需要先建立一个相应的excel页。 回复 1# Horse
用过了 我的2004的用软件能导出 单v7.1的不行 不知道v7.1的有什么办法 回复 15# home1984
您的程序怎么用啊 能不能说的详细点 谢谢 看不到啊,再看看 好东西,非常感谢:
好东西,非常感谢:
好东西,非常感谢:
好东西,非常感谢:
好东西,非常感谢: 好好学习一下,看对自己有用不