大牛,请问如何用VBA代码定义station set和distance呢?我急做一个仓库的仿真,库位太多,不宜手动建立,只有用代码。我用宏录了一点,修改成以下的,但总是报错,也不知道为什么?
Private Sub ModelLogic_RunBeginSimulation()
Dim m As Model
Dim ASRS As Module
Dim myDis As Module
Set m = ThisDocument.Model
Set ASRS = m.Modules.Create("AdvancedTransfer", "Station", 1000, 100)
ASRS.Data("Name") = "ASRS"
ASRS.Data("Station Type") = "Set"
ASRS.Data("StAtt") = "index"
ASRS.Data("MemberStation(1)") = "location 1"
ASRS.Data("MemberStation(2)") = "location 2"
myDis = m.Modules.Create("AdvancedTransfer", "Distance", 0, 0)
myDis.Data("BegStation(1)") = "location 1"
myDis.Data("EndStation(1)") = "location 2"
myDis.Data("Distance(1)") = "2"
End Sub