×
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

OAPI (sap2000-matlab)

OAPI (sap2000-matlab)

OAPI (sap2000-matlab)

(OP)
hi Im new in OAPI , i cant exract farme force in code, and all the time isee erorr, plz help if any one have any code or idea,
my code
close all
clc

% Link Sap2000 and matlab for passing one-dimensional arrays
feature('COM_SafeArraySingleDim', 1);

% Link Sap2000 and matlab for passing non-scalar arrays by reference
feature('COM_PassSafeArrayByRef', 1);

% Create Link Between Matlab and SAP
SapObject = actxserver('Sap2000v15.SapObject');

% Start SAP
SapObject.ApplicationStart;
% Create SAP Model
SapModel = SapObject.SapModel;
% initialize model
ret = SapModel.InitializeNewModel;
%open an existing file
ret = SapObject.SapModel.File.OpenFile('C:\API\idin2');

% Run model (this will create the analysis model)
ret = SapModel.Analyze.RunAnalysis();


ret = SapObject.SapModel.Results.Setup.DeselectAllCasesAndCombosForOutput;
ret = SapObject.SapModel.Results.Setup.SetCaseSelectedForOutput('DEAD');

Name = '38';
Element = 1;
NumberResults = 0;
(Object);
ObjSta = zeros(1,1,'double');
(Elm );
ElmSta = zeros(1,1,'double');
(LoadCase);
(StepType);
StepNum = zeros(1,1,'double');
P = zeros(1,1,'double');
V2 = zeros(1,1,'double');
V3 = zeros(1,1,'double');
T = zeros(1,1,'double');
M2 = zeros(1,1,'double');
M3 = zeros(1,1,'double');

[ret, NumberResults, Obj, ObjSta, Elm, ElmSta, LoadCase, StepType, StepNum, P, V2, V3, T, M2, M3] = SapObject.SapModel.Results.FrameForce(Name, Element, NumberResults, Obj, ObjSta, Elm, ElmSta, LoadCase, StepType, StepNum, P, V2, V3, T, M2, M3);

RE: OAPI (sap2000-matlab)

Try defining string type inputs as cell strings
Object = cellstr(' ');
Elm = cellstr(' ');
LoadCase = cellstr(' ');
StepType = cellstr(' ');

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