Horse 发表于 2009-7-24 23:37:06

hysys物料输出EXCEL工具

hysys物料输出EXCEL工具

flyfire816 发表于 2009-10-19 09:07:39

下载来尝试一下,看看功能如何?

zzuwngshilei 发表于 2009-10-19 09:46:56

原来是hysys的,希望实用

新钻石 发表于 2009-10-29 13:34:38

输出工具没法打开啊,楼主怎么回事呢?谢谢!

Fadingaway 发表于 2009-11-10 14:41:26

这个工具所有hysys版本都能用么?

wwwcwnu 发表于 2009-11-27 20:59:28

好人,好坛,好贴。
好人,好坛,好贴。
好人,好坛,好贴。

wwwcwnu 发表于 2009-11-28 09:18:38

温度(℃)演示版本,有限制
压力(kPa)演示版本,有限制

温度、压力等几个常用的量导不出,可能是hysys不是正版吧。

Fadingaway 发表于 2010-1-17 16:06:54

不好用么???

mmlsz 发表于 2010-1-17 16:12:46

好好琢磨琢磨。

tytz2008 发表于 2010-4-8 23:17:46

楼主啊,高手啊

phill30 发表于 2010-4-17 22:51:39

怎么样啊
看到有些问题

phill30 发表于 2010-4-17 22:52:34

怎么样啊
看到有些问题

aspenwater 发表于 2010-5-17 10:48:42

asw软件就可以到达这样的效果,不知道这个会怎么样

hyowinner 发表于 2010-6-3 10:13:34

回复 1# Horse


    好东西,如果能有截图说明下使用方法就更棒了。支持。

home1984 发表于 2010-6-18 09:23:33

会用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页。

chenfeiyan3025 发表于 2010-9-28 09:18:28

回复 1# Horse


    用过了 我的2004的用软件能导出 单v7.1的不行 不知道v7.1的有什么办法

chenfeiyan3025 发表于 2010-9-28 09:20:06

回复 15# home1984


    您的程序怎么用啊 能不能说的详细点 谢谢

叶筱晴 发表于 2010-12-23 16:49:23

看不到啊,再看看

wuwutao 发表于 2011-2-20 13:42:20

好东西,非常感谢:
好东西,非常感谢:
好东西,非常感谢:
好东西,非常感谢:
好东西,非常感谢:

817xw 发表于 2011-3-19 17:16:00

好好学习一下,看对自己有用不
页: [1] 2 3
查看完整版本: hysys物料输出EXCEL工具