interaction between matlab and SAP2000?

Hi,
I want to call CSI SAP2000 in matlab using the SAP2000 OAPI, but i can't find any documentation on how to do that. The CSI documentation includes examples on how to do it in Visual basic only. Any help with finding some reference or tutorial would be highly appreciated.
Thanks

3 件のコメント

Tan Nguyen
Tan Nguyen 2020 年 11 月 16 日
Hi,
I also face some problem about it:
ConstraintDef.SetDiaphragm
GroupDef.Count
etc.
I cannot iniciate any code with "Def" as seen before.
Could anyone help?
Reza
Reza 2021 年 5 月 26 日
Hi
Please see SM Toolbox.
regards
Mohammad Sadegh Eshaghi
Mohammad Sadegh Eshaghi 2023 年 9 月 27 日
You can find a comprehensive example in the link: https://github.com/eshaghi-ms/MATLAB-and-SAP2000

サインインしてコメントする。

その他の回答 (2 件)

Reza
Reza 2020 年 8 月 15 日
編集済み: Reza 2020 年 8 月 17 日

1 投票

There is a toolbox,called SM,that can call SAP2000(CSiBRiDGE) in MATLAB,
Follow the below link to make connection between SAP2000(CSiBRiDGE) and MATLAB

5 件のコメント

Daniel
Daniel 2022 年 6 月 26 日
編集済み: Walter Roberson 2023 年 9 月 27 日
Hi,
I am trying to open a sap2000.v21 model in MATLAB. I'm using the SM Toolbox Version 6.0.4 Instructions but it gives me an error in the syntax. I show you the code an the error. I'm sorry for my english.
Any help would be really appreciated.
Thanks
%clean up the workspace of matlab
clc;
clear;
%determine the type of application and its version
SM.App( 'sap' );
SM.Ver( '21' );
%create Sap2000 object
APIDLLPath ='C:\Program Files\Computers and Structures\SAP2000 21\SAP2000v1.dll';
ProgramPath ='C:\Program Files\Computers and Structures\SAP2000 21\SAP2000.exe';
[ Sobj ] = SM.Helper.CreateObject( ProgramPath,APIDLLPath );
%create SapModel object
[ Smdl ]=SM.SapModel();
%start Sap2000 application
SM.ApplicationStart;
%initialize model
ret = SM.InitializeNewModel;
%open an existing file
ModelName = 'Example 1-019a.sdb';
ModelPath = fullfile(pwd,'Analysis Examples',ModelName);
ret = SM.File.OpenFile(ModelPath);
%close Sap2000
SM.ApplicationExit (false);
Undefined function 'contains' for input arguments of type 'char'.
Error in SM.Helper.CreateObject (line 8)
Error in Ex_SM_File_OpenFile (line 10)
[ Sobj ] = SM.Helper.CreateObject( ProgramPath,APIDLLPath );
Walter Roberson
Walter Roberson 2022 年 6 月 26 日
Daniel, which MATLAB version are you using? contains was added about R2016b
Daniel
Daniel 2022 年 6 月 26 日
I am using Matlab Version 2015a
Walter Roberson
Walter Roberson 2022 年 6 月 26 日
The SM code you found is not compatible with your version of MATLAB.
However you might be able to get away with
function found = contains(base, pattern)
found = ~isempty(strfind(base, pattern)) ;
Daniel
Daniel 2022 年 7 月 2 日
Thank's a lot!

サインインしてコメントする。

Mohammad Sadegh Eshaghi
Mohammad Sadegh Eshaghi 2023 年 9 月 27 日

0 投票

You can find a comprehensive example in the link: https://github.com/eshaghi-ms/MATLAB-and-SAP2000

カテゴリ

ヘルプ センター および File ExchangeAudio Plugin Creation and Hosting についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by