I need to use Binary Interaction Parameters for Wilson property package in Hysys Micro Language Editor.
I need your help for my classroom project.
Some thing like:
------ 276.756
975.486 ----
Aij for H2O-Ethanol
Source code like :
?? = ?? WilsonPropPkg.Aij .??
Waiting for your kind help
Please help me
|

Binary Interaction Parameters
Started by satsat, Jan 07 2009 01:00 PM
3 replies to this topic
Share this topic:
#1
Posted 07 January 2009 - 01:00 PM
#2
Posted 12 January 2009 - 08:13 AM
Dear,
Could you give the further details of your problem as it is hard to interprete from your post.
Could you give the further details of your problem as it is hard to interprete from your post.
#3
Posted 12 January 2009 - 11:59 AM
QUOTE (satsat @ Jan 7 2009, 11:00 AM) <{POST_SNAPBACK}>
I don't know the Hysys macro language editor very well - it is not very userfriendly IMHO - but here is the VBA code to retrieve the Aij values. You can probably adapt it to suit your situation.
CODE
Sub GetAij()
Const hyEMPTY As Integer = -32767
Dim h As HYSYS.Application
Dim s As SimulationCase
Dim fp As FluidPackage
Dim wp As WilsonPropPkg
Dim a As Variant
Dim nc As Integer, i As Integer, j As Integer
'Link to the open HYSYS case
Set h = GetObject(, "HYSYS.Application")
Set s = h.ActiveDocument
'Link to the desired fluid package (here named "Basis-1)
Set fp = s.BasisManager.FluidPackages("Basis-1")
Set wp = fp.PropertyPackage
'Get the number of components
nc = fp.Components.Count
'Get the Aij parameter values as a two-dimensional array of dimension nc,nc
a = wp.Aij.GetValues("")
'Print the values, display nice --- instead of <empty> value (-32767)
For i = 0 To nc - 1
For j = 0 To nc - 1
If CInt(a(i, j)) = hyEMPTY Then
Debug.Print "---",
Else
Debug.Print a(i, j),
End If
Next j
Debug.Print
Next i
End Sub
#4
Posted 15 January 2009 - 03:00 AM
Dear joerd
Thank you
it solved my problem
Thank you
it solved my problem

Similar Topics
![]() Kinetic Parameters Of Primary/secondary ReactionsStarted by Guest_sayoub_* , 12 Mar 2024 |
|
![]() |
||
Co2 Degasser Design ParametersStarted by Guest_AnnaV_* , 26 Feb 2024 |
|
![]() |
||
Typical Design Parameters For Atr Sizing- Help NeededStarted by Guest_daraj_* , 28 Jan 2023 |
|
![]() |
||
Binary Interaction Parameters DatasetStarted by Guest_SickPuppy0_* , 10 Dec 2022 |
|
![]() |
||
Python Control Library Step_Info Returning Nan For All ParametersStarted by Guest_HWIK_* , 08 Oct 2022 |
|
![]() |