Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

SAP2000 API using MATLAB

Status
Not open for further replies.

samt99

Structural
Jun 26, 2013
1
Hi,

I've written the code of analysis and report for a structure using SAP2000 API and Matlab and I want to get the Total weight of structure using API, however I can get it in SAP2000 from: Display > Show table > Miscellaneous data > Material List > table : Material List - by Object Type.

how can I Export the total weight of structure in API using Matlab? is there any code in SAP2000_API_Documentation manual for that?
I would appreciate any help.
Thank you.
 
Replies continue below

Recommended for you

Hi Friends,
I'm using Sap2000 OAPI from Matlab
now I know how to open, run, save, hide, close
ie, this is my code,

%% clean-up the workspace & command window
clear;
clc;
%% pass data to Sap2000 as one-dimensional arrays
feature('COM_SafeArraySingleDim', 1);
%% pass non-scalar arrays to Sap2000 API by reference
feature('COM_PassSafeArrayByRef', 1);
%% create Sap2000 object
SapObject = actxserver('sap2000v15.SapObject');
%% start Sap2000 application
SapObject.ApplicationStart;
%% create SapModel object
Sap = SapObject.SapModel;
%% Hide Application, Hide <=> Visible
% SapObject.Hide;
%% open file
Sap.File.OpenFile('C:\Users\BRNS 1_8 WITH INFILL WITH OPENING MESHING.sdb');
%% run model (this will create the analysis model)
Sap.Analyze.RunAnalysis();
%% save model
Sap.File.Save('C:\Users\BRNS 1_8 WITH INFILL WITH OPENING MESHING.sdb');
%% close Sap2000
SapObject.ApplicationExit(false());
SapModel = 0;
SapObject = 0;

%% END

this working properly. but I don't know how to edit time history value(functn), load case, area edge constrains and how I can get result like frequency, so please help me to get those results...

%% get modal period
NumberResults = 'As Long';
LoadCase = 'As String';
StepType = 'As String';
StepNum = 'As Double';
Period = 'As Double';
Frequency = 'As Double';
CircFreq = 'As Double';
EigenValue = 'As Double';

Sap.Results.ModalPeriod(NumberResults, LoadCase, StepType, StepNum, Period, Frequency, CircFreq, EigenValue)

%% END

I used this to get frequency but it showing some error like this

No method 'ModalPeriod' with matching signature found for class
'Interface.020E9225_C884_4E04_ABD2_B91D15E6A45B'.

Error in my_sap_working (line 45)
Sap.Results.ModalPeriod(NumberResults, LoadCase, StepType, StepNum, Period, Frequency, CircFreq, EigenValue)


I found some people used $2k file, how use that? please help me...
 
I had this problem also
There is no direct way to do this you should run a loop for all your elements and computing ecah element mass or volume and add this to the total
 
Hi, sajeer379mms!

Have you figured it out? I have the same problem.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor