×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

SAP2000 API using MATLAB

SAP2000 API using MATLAB

SAP2000 API using MATLAB

(OP)
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.

RE: SAP2000 API using MATLAB

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...

RE: SAP2000 API using MATLAB

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

RE: SAP2000 API using MATLAB

Hi, sajeer379mms!

Have you figured it out? I have the same problem.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources