Now, we're trying to access pipesegment on Aspen Hysys 7.3 through VBA. This post is an answer of previous post comment.
Here is the example
Create a table as shown figure
Then add following VBA code
Option Explicit
Public hyApp As HYSYS.Application
Public simCase As SimulationCase
Public pStream As ProcessStream
Public psegment As PipeSegment
Public Sub StartHYSYS()
Dim filename As String
Dim ITEM As Integer
Dim lengthVar As Variant
Dim p_length, p_elev, p_rough, p_idiam, p_odiam, p_cond As Variant
' HYSYS CUSTOMATION THROUGH EXCEL TO ACCESS PIPE SEGMENT
' LOADING HYSYS SIMULATION FILE
Set hyApp = CreateObject("HYSYS.Application")
hyApp.Visible = True
Set simCase = hyApp.ActiveDocument
If simCase Is Nothing Then
filename = Worksheets("HYSYS").Range("C4").Text
If filename <> "False" And simCase Is Nothing Then
Set simCase = GetObject(filename, "HYSYS.SimulationCase")
simCase.Visible = True
End If
End If
' define operation
Set psegment = simCase.Flowsheet.Operations("pipeseg").ITEM("pipe-100")
' define pipesegment's parameters
p_length = psegment.SegmentLengthValue
p_elev = psegment.SegmentElevationChangeValue
p_rough = psegment.RoughnessValue
p_idiam = psegment.SegmentInnerDiamValue
p_odiam = psegment.SegmentOuterDiamValue
p_cond = psegment.PipeConductValue
' collecting data as variant
For ITEM = 1 To 4
p_length(ITEM - 1) = Cells(6, ITEM + 2)
p_elev(ITEM - 1) = Cells(7, ITEM + 2)
p_odiam(ITEM - 1) = Cells(8, ITEM + 2)
p_idiam(ITEM - 1) = Cells(9, ITEM + 2)
p_rough(ITEM - 1) = Cells(10, ITEM + 2)
p_cond(ITEM - 1) = Cells(11, ITEM + 2)
Next ITEM
' inputting data to hysys
psegment.SegmentLength.Values = p_length
psegment.SegmentElevationChange.Values = p_elev
psegment.Roughness.Values = p_rough
psegment.SegmentInnerDiam.Values = p_idiam
psegment.SegmentOuterDiam.Values = p_odiam
psegment.PipeConduct.Values = p_cond
' FINISH
End Sub
As you can see, Hysys model is just as simple as following figure.
And now, pipe segment is on your hand :D
Hi Alex,
ReplyDeleteCan you post an example for changing the split ratio value from excel?
Thanks a lot for posting this interesting code.
Mayembe
Mayembe,
ReplyDeleteI've generate VBA code to access splitter on hysys, and I'll post it soon.
Alex
Thanks a lot
ReplyDeleteHave you got any idea how can I set elbows(fittings) instead of pipe?
ReplyDeleteVba code for pipesys?
ReplyDeletehello, one question i have a simulation that no solver but in the realy this is pumped, I will can to send the simulation for your understand the explaint, thank you for help me.
ReplyDeleteyurtdışı kargo
ReplyDeleteresimli magnet
instagram takipçi satın al
yurtdışı kargo
sms onay
dijital kartvizit
dijital kartvizit
https://nobetci-eczane.org/
3860QZ
Litvanya yurtdışı kargo
ReplyDeleteLüksemburg yurtdışı kargo
Macaristan yurtdışı kargo
Malta yurtdışı kargo
Polonya yurtdışı kargo
56Z
Portekiz yurtdışı kargo
ReplyDeleteRomanya yurtdışı kargo
Slovakya yurtdışı kargo
Slovenya yurtdışı kargo
İngiltere yurtdışı kargo
MKTİBT
Yunanistan yurtdışı kargo
ReplyDeleteAfganistan yurtdışı kargo
Amerika Birleşik Devletleri yurtdışı kargo
Amerika Samoası yurtdışı kargo
Angola yurtdışı kargo
O023
Hello Alex. I was wondering how do you know to put the string "pipeseg" in the operations function? Did you get them from a list? Or from using a function on the operations object?
ReplyDeletevan
ReplyDeleteelazığ
bayburt
bilecik
bingöl
6H4U
bartın evden eve nakliyat
ReplyDeleteedirne evden eve nakliyat
mersin evden eve nakliyat
sinop evden eve nakliyat
siirt evden eve nakliyat
551NH
C0269
ReplyDeleteEdirne Lojistik
Ağrı Evden Eve Nakliyat
Artvin Evden Eve Nakliyat
Şırnak Lojistik
Bayburt Lojistik
61AEA
ReplyDeleteBolu Şehirler Arası Nakliyat
Edirne Evden Eve Nakliyat
Niğde Şehirler Arası Nakliyat
Erzurum Evden Eve Nakliyat
Antalya Lojistik
Aydın Şehir İçi Nakliyat
Mardin Lojistik
Bartın Şehir İçi Nakliyat
Amasya Şehirler Arası Nakliyat
8B1E6
ReplyDeleteAğrı Evden Eve Nakliyat
Urfa Lojistik
Bitlis Parça Eşya Taşıma
Altındağ Fayans Ustası
Nevşehir Şehirler Arası Nakliyat
İzmir Parça Eşya Taşıma
Muş Şehirler Arası Nakliyat
Çerkezköy Boya Ustası
Ordu Şehirler Arası Nakliyat
شركة تسليك مجارى بالجبيل
ReplyDeleteشركة تسليك مجارى بالخبر
شركة تسليك مجاري بالاحساء
13169
ReplyDeleteurfa canlı görüntülü sohbet siteleri
sesli sohbet odası
hatay canli sohbet bedava
sohbet odaları
igdir rastgele görüntülü sohbet uygulamaları
siirt yabancı görüntülü sohbet siteleri
nanytoo sohbet
tokat canlı sohbet odaları
zonguldak sesli sohbet mobil
878F5
ReplyDeleteafyon telefonda görüntülü sohbet
Çanakkale Sohbet Muhabbet
manisa random görüntülü sohbet
yozgat ücretsiz sohbet uygulaması
nevşehir ucretsiz sohbet
bolu görüntülü sohbet odaları
kırşehir canli sohbet bedava
Adıyaman Canli Sohbet Bedava
ardahan yabancı canlı sohbet
91700
ReplyDeleteuwu lend
dextools
raydium
safepal
satoshi
roninchain
quickswap
ledger wallet
poocoin
مكافحة الحشرات بالاحساء hVST9b2IHE
ReplyDeleteمكافحة الحشرات بالاحساء L35o7DJZWW
ReplyDelete