使用外部VB程序构建竞技场仿真模型
我需要使用完全独立的外部 VB 程序构建 Arena 模拟模型,而不是使用内置的 VBA 编程功能。我在构建此类程序方面取得了一些进展,但对其行为不满意。
- 是否可以在不启动 Arena.exe 的情况下创建模型?
- 如果在模型创建步骤期间程序由于任何原因(例如调试终止)而停止,则对 CreateObject 函数的后续调用将失败,并出现类似“无法创建 ActiveX/Com 对象”的结果。即使我通过任务管理器手动终止 Arena.exe,仍然会出现此错误。如何避免这种情况?
-- 当前代码 --
Try
arenaApp = CType(CreateObject("Arena.Application"), Arena.Application)
arenaModel = arenaApp.Models.Add
... some code to build model, adding modules, blah blah blah, ...
arenaModel.SaveAs(fileName)
Finally
If (arenaApp IsNot Nothing) Then arenaApp.Quit()
End Try
-- 平台 --
- 平台:Win 7 64
- Visual Studio:2010(Express 版)
- DotNet Framework:4.0
- Arena 版本:13.9
- VB 项目参考:C:\Program Files (x86)\Rockwell Software\Arena\ Arena.exe
非常感谢。
任汉
I have a requirement to construct a Arena simulation model using an entirely separated external VB program, instead of using the build-in VBA programming capabilty. I have some progress on building such program, but not satisfied with the behavior.
- Is it possible to create a Model without starting the Arena.exe?
- If the program halt for any reason (such as termination of debugging) during the model creation steps, the subsequent call to the CreateObject function failed with result like "Cannot create ActiveX/Com objects". This error still occurs even if I manually kill the Arena.exe via the Task Manager. How to avoid this?
-- Current Code --
Try
arenaApp = CType(CreateObject("Arena.Application"), Arena.Application)
arenaModel = arenaApp.Models.Add
... some code to build model, adding modules, blah blah blah, ...
arenaModel.SaveAs(fileName)
Finally
If (arenaApp IsNot Nothing) Then arenaApp.Quit()
End Try
-- Platform --
- Platform: Win 7 64
- Visual Studio: 2010 (Express edition)
- DotNet Framework: 4.0
- Arena version: 13.9
- VB Project Reference: C:\Program Files (x86)\Rockwell Software\Arena\Arena.exe
Thanks very much.
Yam Hon
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我无法直接回答你的问题。不过,我建议您查看以下有关竞技场集成和定制的讲义。
http://dept.lamar.edu/induscial/Underdown/Simulation /ch10.ppt
至于您遇到的错误,这些链接与 Arena 没有直接关系,但可能包含有关“无法创建 ActiveX/Com 对象”的解决方案错误。
I cannot answer your question directly. However, I would recommend looking over the following lecture notes regarding Arena Integration and Customization.
http://dept.lamar.edu/industrial/Underdown/Simulation/ch10.ppt
As for the error you are experiencing, these links are not directly related to Arena but might contain a solution regarding the "Cannot create ActiveX/Com objects" error.