Jump to content



Featured Articles

Check out the latest featured articles.

File Library

Check out the latest downloads available in the File Library.

New Article

Product Viscosity vs. Shear

Featured File

Vertical Tank Selection

New Blog Entry

Low Flow in Pipes- posted in Ankur's blog

Hysys Vba/ User Variables

hysys vba uservariable

This topic has been archived. This means that you cannot reply to this topic.
1 reply to this topic
Share this topic:
| More

#1 ChurchMouth

ChurchMouth

    Brand New Member

  • Members
  • 1 posts

Posted 03 January 2013 - 01:08 AM

Hi all,

I would like to further improve upon my HYSYS skills by learning how to create functioning "user variables" and "Excel/ HYSYS VBA automation".

I have had reasonable success so far but my main problem is that I am wasting excessive amounts of time using 'trial and error' to learn the correct syntax to reference specific properties in HYSYS.

Infact I have just hit a wall. I am trying to access a straightforward stream property "actual volume flow - liquid". Using object explorer I can find "actualliqflow" tag, however it always gives a "empty value" ie. -62737.

Does anyone have some pointers to where I can find information or examples on accessing various property values in HYSYS, so I don't feel like I am searching in the dark? Furthermore if you could assist me in getting "actual liquid volume flow" that would be great.

Nicholas




Sub PostExecute()
On Error GoTo ErrorHandler
Dim mystream As ProcessStream
ActiveVariableWrapper.Variable.Erase
Set mystream = ActiveObject
LiquidActualVolume = mystream.ActualLiqFlow
MsgBox LiquidActualVolume
ActiveVariableWrapper.Variable.SetValue(LiquidActualVolume)
Exit Sub

ErrorHandler:
MsgBox "error"
Exit Sub
End Sub

Edited by ChurchMouth, 03 January 2013 - 01:11 AM.


#2 Bobby Strain

Bobby Strain

    Gold Member

  • Members
  • 3,529 posts

Posted 03 January 2013 - 11:00 AM

There is an Excel spreadsheet called Stream Reporter on the Aspen Tech support site. All the variables are easily determined by examining this code. And, you must be patient with your learning schedule. It will take a while before you feel proficient.

Good luck,
Bobby




Similar Topics