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

1

Adding Inlet To Compressor Through Vba (Hysys/unisim)

vba hysys unisim inlet compressor excel

4 replies to this topic
Share this topic:
| More

#1 Matylda

Matylda

    Brand New Member

  • Members
  • 7 posts

Posted 30 July 2024 - 02:37 AM

Hi everyone,

 

I am struggling to add Inlet stream to compressor using VBA. 

 

So like Set Compressor.Property("InletStream") = "MyStream"

 

Does anyone know how to fix this? 

 

Thank you in advance!



#2 Matylda

Matylda

    Brand New Member

  • Members
  • 7 posts

Posted 06 August 2024 - 03:14 AM

Hello!

 

I've managed to figure out so in case anyone needs the answer: 

 

Dim Compressor As HYSYS.CompressOp

Set Compressor = hyCase.Flowsheet.Operations.Add("compressor_name", "compressor")

Set Compressor = hyCase.Flowsheet.Operations().Item("compressor_name")

 

Dim InletStream As HYSYS.ProcessStream

Set InletStream = hyCase.Flowsheet.MaterialStreams.Add("InletStream")

Set InletStream = hyCase.Flowsheet.MaterialStreams("InletStream")

 

Compressor.FeedStream = InletStream 

 

ProductStream is Outlet Stream and Energy stream is energy stream :)


Edited by Matylda, 06 August 2024 - 03:14 AM.


#3 Dacs

Dacs

    Gold Member

  • Members
  • 416 posts

Posted 14 August 2024 - 12:22 AM

What are you trying to accomplish? Are you trying to define streams on the fly?



#4 Matylda

Matylda

    Brand New Member

  • Members
  • 7 posts

Posted 21 August 2024 - 06:39 AM

I was creating a stream that later goes as an inlet to compressor 



#5 Dacs

Dacs

    Gold Member

  • Members
  • 416 posts

Posted 22 August 2024 - 02:30 AM

Is it not possible to add it via normal means at the flowsheet?

 

Why is there a need to use VBA to create a stream?






Similar Topics