Specifications
A-6 Automation FAQ
A-6
6. How do I obtain component mass/molar/volume fractions
from a Fluid object?
Ans: Unfortunately, the Fluid object differs from the
ProcessStream object with regards to accessing component
mass/molar/volume fractions. The following table shows the
property object which is used to access the different types of
component fractions from the Fluid and ProcessStream
objects.
7. Why can’t I use the Calculate or CalculateAsFluid methods to
set a value as Calculated?
Ans: The Calculate and CalculateAsFluid methods can only
be used in the Execute function of an extension unit
operation.
8. Can I access the HYSYS Optimizer using Automation?
Ans: Unfortunately, the HYSYS Optimizer is not currently
available to Automation. However, there is a workaround,
which uses the SendKeys command. SendKeys is used to
send keystrokes to an application as if they were typed at
the keyboard. There are a few caveats:
• HYSYS must be visible to use the SendKeys command.
• HYSYS must be the active property view to use the
SendKeys command, SendKeys does not wait between
keystrokes, so if an application does not respond quickly
enough, then SendKeys will fail. To reduce the possibility
of SendKeys failing, a Windows “Sleep” function is used
to add a 0.1 second pause between each keystroke.
• Since there is currently no way to determine when the
HYSYS Optimizer has completed its calculations, the
Windows “Sleep” function is used to wait a specified
number of seconds for the HYSYS optimizer to solve.
After this period of time, a user-defined check can be
used to determine if the optimizer is complete. If not, the
“Sleep” for another period of time and check again.
Object Fluid ProcessStream
Mass MassFractions ComponentMassFraction
Molar MolarFractions ComponentMolarFraction
Volume IdealLiquidVolumeFractions ComponentVolumeFraction