Etabs - Matlab(API)

时间:2015-12-10 23:10:14

标签: matlab api

(您需要在计算机中安装MATLAB和ETABS才能运行示例)

我开始使用API​​ MATLAB-ETABS,我发现了一个错误,我希望你可以帮我解决,接下来你会找到例子的代码:

clc, clear all, close all

NumberResults = NaN;
Obj = cellstr(' ');
Elm = cellstr(' ');
LoadCase = cellstr(' ');
StepType= cellstr(' ');
StepNum=NaN;
F1=zeros(1,1,'double');
F2=zeros(1,1,'double');
F3=zeros(1,1,'double');
M1=zeros(1,1,'double');
M2=zeros(1,1,'double');
M3=zeros(1,1,'double');

%    'create ETABS object
EtabsObject = actxserver('CSI.ETABS.API.ETABSObject')

%    'start ETABS application
ret = EtabsObject.ApplicationStart()

%    'create SapModel object
SapModel = EtabsObject.SapModel

%    'initialize model
ret = SapModel.InitializeNewModel()

%    'create steel deck template model
ret = SapModel.File.NewSteelDeck(4,12,12,4,4,24,24)

%    'run analysis
System.IO.Directory.CreateDirectory('c:\CSI_API_temp')
ret = SapModel.File.Save('C:\CSI_API_temp\example.edb')
ret = SapModel.Analyze.RunAnalysis

%    'deselect all cases and combos
ret = SapModel.Results.Setup.DeselectAllCasesAndCombosForOutput

%    'set case selected for output
ret = SapModel.Results.Setup.SetCaseSelectedForOutput('DEAD')

%    'get point displacements
ret = SapModel.Results.JointReact('1',1,NumberResults, Obj, Elm, LoadCase, StepType, StepNum, F1, F2, F3, M1, M2, M3)

%    'close ETABS
EtabsObject.ApplicationExit(1)

%    'clean up variables
clearvars SapModel EtabsObject

如果您运行该代码,将在您的命令窗口中显示:

No method 'JointReact' with matching signature found for class
'Interface.ETABS_2015_Application_Programming_Interface__API_.cAnalysisResults'.

2 个答案:

答案 0 :(得分:1)

我在VBA-ETABS中有类似的问题,当我改变了#34; NumberResults"到整数值,我的问题解决了。 另外,我建议你使用" SelectionElm" for" eItemTypeElm"。

答案 1 :(得分:1)

将两个应用程序设置为以管理员身份运行

你的问题将得到解决

我尝试了同样的方法,它对我有用,希望它适合你。