利用matlab脚本代码控制Maxwell运行时,不能打开项目的问题,请教各位大佬如何解决
在下想学习利用matlab脚本控制Maxwell的方法。但是在实现过程中遇到了一些问题,求各位大侠指导我是已经创建了一个项目,想要利用MATLAB打开这个项目并做处理。我首先通过Maxwell脚本录制功能获得了一个脚本,再将这个脚本的VBS语言转化成matlab代码,转化好之后运行,确实可以打开Maxwell软件,当时在打开我制定的项目的时候总是失败,请问大家这是什么问题,怎么解决
Maxwell脚本:
Dim oAnsoftApp
Dim oDesktop
Dim oProject
Dim oDesign
Dim oEditor
Dim oModule
Set oAnsoftApp = CreateObject("AnsoftMaxwell.MaxwellScriptInterface")
Set oDesktop = oAnsoftApp.GetAppDesktop()
oDesktop.RestoreWindow
Set oProject = oDesktop.SetActiveProject("ShiYan")
Set oDesign = oProject.SetActiveDesign("Maxwell2DDesign1")
Set oEditor = oDesign.SetActiveEditor("3D Modeler")
oEditor.CreatePoint Array("NAME:PointParameters", "PointX:=", "0mm", "PointY:=",_
"85mm", "PointZ:=", "0mm"), Array("NAME:Attributes", "Name:=", "Point1", "Color:=",_
"(132 132 193)")
matlab代码
iMaxwell = actxserver('AnsoftMaxwell.MaxwellScriptInterface')
Desktop = iMaxwell.GetAppDesktop()
Desktop.RestoreWindow
Project = Desktop.SetActiveProject('ShiYan')
Design = Project.SetActiveDesign('Maxwell2DDesign1')
Editor = Design.SetActiveEditor('3D Modeler')
DefinitionManager=Project.GetDefinitionManager()
invoke(Editor,'CreatePoint',...
{'NAME:PointParameters', 'PointX:=', '0mm', 'PointY:=','85mm', 'PointZ:=', "0mm"}, ...
{'NAME:Attributes', 'Name:=', 'Point1', 'Color:=', '(132 132 193)'},...
delete(iMaxwell));
请问您现在解决这个问题了吗?想请教下该怎么做
页:
[1]