Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

SAP OAPI with MATLAB : for design result

Status
Not open for further replies.

farshad123

Structural
Sep 5, 2017
1
hi
I wrote the following code to compare the design results.
My goal is to choose the best level.
But in matlab the following error is displayed.
Can someone help me?


Code:
FrameName      = NET.createArray('System.String',NumberItems);
MyOption       = 1;
Location       = NET.createArray('System.Double',NumberItems);
ErrorSummary   = NET.createArray('System.String',NumberItems);
WarningSummary = NET.createArray('System.String',NumberItems);
NumberItems    = 3;
TopCombo       = NET.createArray('System.String',NumberItems);
TopArea        = NET.createArray('System.Double',NumberItems);
BotCombo       = NET.createArray('System.String',NumberItems);
BotArea        = NET.createArray('System.Double',NumberItems);
VmajorArea     = NET.createArray('System.Double',NumberItems);
TLCombo        = NET.createArray('System.String',NumberItems);
TLArea         = NET.createArray('System.Double',NumberItems);
TTCombo        = NET.createArray('System.String',NumberItems);
TTArea         = NET.createArray('System.Double',NumberItems);

Ret = Analyze.CreateAnalysisModel
DOF = NET.createArray('System.Boolean',6);

for i = 1 : 6

   DOF (i) = true();

end
Ret = Analyze.GetActiveDOF(DOF)
Ret = Analyze.RunAnalysis();

View.RefreshView();
if Ret ~= 0
    disp('!Add beam object View.RefreshView')
end
%% Design
disp('Design')
DesignConcrete = ...
        NET.explicitCast(SapModel.DesignConcrete,'SAP2000v19.cDesignConcrete');
 View = NET.explicitCast(SapModel.View,'SAP2000v19.cView');

    Ret = DesignConcrete.SetCode('ACI 318-11')
    Ret = DesignConcrete.StartDesign

View.RefreshView();
if Ret ~= 0
    disp('!Add beam object View.RefreshView')
end
[ret,NumberItems, FrameName,...
     Location, TopCombo, TopArea, BotCombo, BotArea, VmajorCombo, VmajorArea, TLCombo, TLArea, ...
     TTCombo, TTArea, ErrorSummary, WarningSummary] = ...
     DesignConcrete.GetSummaryResultsBeam(', NumberItems, FrameName,...
     Location, TopCombo, TopArea, BotCombo, BotArea, ...
     VmajorCombo, VmajorArea, TLCombo, TLArea, ...
     TTCombo, TTArea, ErrorSummary, WarningSummary,SAP2000v19.eItemType.Group);
 if Ret ~= 0
        disp('! Error at Design concrete.GetSummaryResultsBeam ')
 end
 for i=1:5
    if (TopArea(i)<= 0.08 & TopArea(i)>= 0.01)
     TopArea(i+1) >= TopArea(i)
    end
 end[/color]

But for this line:
      [COLOR=#4E9A06]if (TopArea(i)<= 0.08 & TopArea(i)>= 0.01)[/color]
The error below shows 
[COLOR=#4E9A06]Message: Index was outside the bounds of the array.
Source:
HelpLink:




Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor