本文介绍了启动EA编程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想打开通过Windows服务的EA会议并做幕后的一些动作。结果
我使用Repository API,但是,不知道如何正确初始化。
I would like to open an EA session via Windows service and do some action behind the scenes.
I use the Repository API, however, don't know how to initialize it correctly.
EA.Repository repository = ?;
repository.OpenFile(@"C:\test.eap");
repository.Exit();
任何想法?
Any ideas?
推荐答案
下面的代码示例演示如何打开EA COM对象并打开EA的项目文件,然后拿到项目模型的列表
the code sample below demonstrate how to open EA COM Object and open EA project file then get list of the project models
// connect to EA COM object
EA.Repository _repository = new EA.RepositoryClass();
// Open EA project file
bool fileOpened = _repository.OpenFile(filePath);
if(fileOpened)
Collection models = _repository.Models; // collection of models inside of opened project
这篇关于启动EA编程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!