JJoossee
Structural
- Mar 29, 2017
- 4
Hi,
I ask you for your help in order to find the right way to save my results from a model analysis in SAP2000 through MATLAB using API. I already have the code but it doesn't work well beacause I need to save the results (in this case are points displacements) in a vector or matrix which will be call or use in other MATLAB code. I present you the part of the code where is the problem:
"...
AnalysisResults = NET.explicitCast(SapModel.Results,'SAP2000v19.cAnalysisResults');
AnalysisResultsSetup = NET.explicitCast(AnalysisResults.Setup,'SAP2000v19.cAnalysisResultsSetup');
ret = AnalysisResultsSetup.DeselectAllCasesAndCombosForOutput;
ret = AnalysisResultsSetup.SetCaseSelectedForOutput('DEAD')
SapResult = zeros(1,1,'double');
NumberResults = 0;
Obj = NET.createArray('System.String',2);
Elm = NET.createArray('System.String',2);
ACase = NET.createArray('System.String',2);
StepType = NET.createArray('System.String',2);
StepNum = NET.createArray('System.Double',2);
U1 = NET.createArray('System.Double',2);
U2 = NET.createArray('System.Double',2);
U3 = NET.createArray('System.Double',2);
R1 = NET.createArray('System.Double',2);
R2 = NET.createArray('System.Double',2);
R3 = NET.createArray('System.Double',2);
ret = AnalysisResults.JointDispl('ALL', 1, NumberResults, Obj, 2, ACase, StepType, StepNum, U1, U2, U3, R1, R2, R3);
SapResult = U1(1);
ret = SapObject.ApplicationExit(false()); "
I would appreciate everyone's help.
I ask you for your help in order to find the right way to save my results from a model analysis in SAP2000 through MATLAB using API. I already have the code but it doesn't work well beacause I need to save the results (in this case are points displacements) in a vector or matrix which will be call or use in other MATLAB code. I present you the part of the code where is the problem:
"...
AnalysisResults = NET.explicitCast(SapModel.Results,'SAP2000v19.cAnalysisResults');
AnalysisResultsSetup = NET.explicitCast(AnalysisResults.Setup,'SAP2000v19.cAnalysisResultsSetup');
ret = AnalysisResultsSetup.DeselectAllCasesAndCombosForOutput;
ret = AnalysisResultsSetup.SetCaseSelectedForOutput('DEAD')
SapResult = zeros(1,1,'double');
NumberResults = 0;
Obj = NET.createArray('System.String',2);
Elm = NET.createArray('System.String',2);
ACase = NET.createArray('System.String',2);
StepType = NET.createArray('System.String',2);
StepNum = NET.createArray('System.Double',2);
U1 = NET.createArray('System.Double',2);
U2 = NET.createArray('System.Double',2);
U3 = NET.createArray('System.Double',2);
R1 = NET.createArray('System.Double',2);
R2 = NET.createArray('System.Double',2);
R3 = NET.createArray('System.Double',2);
ret = AnalysisResults.JointDispl('ALL', 1, NumberResults, Obj, 2, ACase, StepType, StepNum, U1, U2, U3, R1, R2, R3);
SapResult = U1(1);
ret = SapObject.ApplicationExit(false()); "
I would appreciate everyone's help.