How i get the details of result from sap2000 with matlab

11 次查看(过去 30 天)
i wrote a Matlab code to access Sap2000 v22 trial version. this code can start the program and open a structure file and analyze it and then design the steel elements. Up to here all is good. In here start a problem for me. i try to get the detail of the result for example "ffa" values or "P" values. and i use this code for this problem;
...
NumberItems=0;
FrameName=cellstr(' ');
Value=cellstr(' ');
[~,~,~,TableS,NumberSItems,FrameNameS,ValueS] = SapModel.DesignSteel.GetDetailResultsValue( ...
"8", SAP2000v1.eItemType.Objects, 2, "DesignSect", NumberItems, FrameName(), Value());
I get this error;
" No appropriate method, property, or field 'GetDetailResultsValue' for class 'SAP2000v1.wDesignSteel'. "
and if i change the code like this;
NumberItems=0;
FrameName=cellstr(' ');
Value=cellstr(' ');
[~,~,~,TableS,NumberSItems,FrameNameS,ValueS] = DesignSteel.GetDetailResultsValue( ...
"8", SAP2000v1.eItemType.Objects, 2, "DesignSect", NumberItems, FrameName(), Value());
I get this error;
No method 'GetDetailResultsValue' with matching signature found for class 'SAP2000v1.cDesignSteel'.
What is my fault at this code? Thank You

回答(1 个)

Riya
Riya 2024-1-23
Hello,
The errors you're encountering suggest that there is either a mistake in the method name or the way you are calling it. The error messages indicate that MATLAB cannot find a method called GetDetailResultsValue for the DesignSteel class in the SAP2000v1 API.
Here is a generic example of how you might correctly call a method from the SAP2000 API in MATLAB:
% Initialize the SAP2000 application
SapObject = actxserver('SAP2000v22.SapObject');
SapModel = SapObject.SapModel;
% Start SAP2000 application
ret = SapObject.ApplicationStart();
% Open an existing model
ret = SapModel.File.OpenFile('path\to\your\model.sdb');
% Run analysis
ret = SapModel.Analyze.RunAnalysis();
% Obtain results - this is where you need to adapt based on correct API usage
% For example, if GetDetailResultsValue is a correct method, ensure you have the right instance:
DesignSteelInstance = SapModel.DesignSteel; % Get the DesignSteel instance
% Now call the method on the instance with the correct parameters
[ret, TableS, NumberSItems, FrameNameS, ValueS] = DesignSteelInstance.GetDetailResultsValue(...);
Additionally, ensure that the COM object SAP2000v22.SapObject matches the version of SAP2000 you are using. If you're using a different version, you'll need to adjust the object name accordingly.
For more information you can refer the following documentation:

类别

Help CenterFile Exchange 中查找有关 Logical 的更多信息

产品


版本

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by