API Examples
API Examples
Example 1
Remarks
This example is written for Visual Basic for Applications (VBA). It can be run from a program such as
Microsoft Excel. It is based on the SAP2000 verification problem Example 1-001.
This example creates the example verification problem from scratch, runs the analysis, extracts results,
and compares the results with hand-calculated values.
Example
Sub VerificationExample1001()
'dimension variables
Dim SapObject As SAP2000.SapObject
Dim SapModel As cSapModel
Dim ret As Long
Dim i As Long
Dim ModValue() As Double
Dim PointLoadValue() As Double
Dim Restraint() As Boolean
Dim FrameName() As String
Dim PointName() As String
Dim NumberResults As Long
Dim Obj() As String
Dim Elm() As String
Dim LoadCase() As String
Dim StepType() As String
Dim StepNum() As Double
Dim U1() As Double
Dim U2() As Double
Dim U3() As Double
Dim R1() As Double
Dim R2() As Double
Dim R3() As Double
Dim SapResult() As Double
Dim IndResult() As Double
Dim PercentDiff() As Double
Dim SapResultString() As String
Dim IndResultString() As String
Dim PercentDiffString() As String
Dim msg As String
'initialize model
ret = SapModel.InitializeNewModel
Restraint(i) = True
Next i
For i = 2 To 5
Restraint(i) = False
Next i
ret = SapModel.FrameObj.GetPoints(FrameName(1), PointName(0), PointName(1))
ret = SapModel.PointObj.SetRestraint(PointName(1), Restraint)
'save model
ret = SapModel.File.Save("C:\SapAPI\API_1-001.sdb")
'close Sap2000
SapObject.ApplicationExit False
Set SapModel = Nothing
Set SapObject = Nothing
Release Notes
Initial release in version 11.03.
Changed nomenclature from Load Cases, Analysis Cases and Response Combinations to Load Patterns,
Load Cases and Load Combinations, respectively, in version 12.00.
This example creates the example verification problem from scratch, runs the analysis, extracts results,
and compares the results with hand-calculated values.
Example
4. Double click on the new button to bring up the Click procedure for the button and paste in the
following code.
'dimension variables
Dim SapObject As SAP2000.SapObject
Dim SapModel As SAP2000.cSapModel
Dim ret As Long
Dim i As Long
Dim ModValue() As Double
Dim PointLoadValue() As Double
Dim Restraint() As Boolean
Dim FrameName() As String
Dim PointName() As String
Dim NumberResults As Long
Dim Obj() As String
Dim Elm() As String
Dim LoadCase() As String
Dim StepType() As String
Dim StepNum() As Double
Dim U1() As Double
Dim U2() As Double
Dim U3() As Double
Dim R1() As Double
Dim R2() As Double
Dim R3() As Double
Dim SapResult() As Double
Dim IndResult() As Double
Dim PercentDiff() As Double
Dim SapResultString() As String
Dim IndResultString() As String
Dim PercentDiffString() As String
Dim msg As String
'initialize model
ret = SapModel.InitializeNewModel
'save model
ret = SapModel.File.Save("C:\SapAPI\API_1-001.sdb")
'close Sap2000
SapObject.ApplicationExit(False)
SapModel = Nothing
SapObject = Nothing
IndResult(3) = -0.2963
IndResult(4) = 0.3125
IndResult(5) = 0.11556
IndResult(6) = 0.00651
For i = 0 To 6
IndResultString(i) = Format(IndResult(i), "0.00000")
If Microsoft.VisualBasic.Left(IndResultString(i), 1) <> "-" Then
IndResultString(i) = " " & IndResultString(i)
End If
Next i
Release Notes
Initial release in version 11.03.
Changed nomenclature from Load Cases, Analysis Cases and Response Combinations to Load Patterns,
Load Cases and Load Combinations, respectively, in version 12.00.
This example creates the example verification problem from scratch, runs the analysis, extracts results,
and compares the results with hand calculated values.
Example
1. Create a new Visual C# 2005 project.
4. Double click on the new button to bring up the Click procedure for the button and paste in the
following code.
//dimension variables
SAP2000.SapObject SapObject;
SAP2000.cSapModel SapModel;
int ret;
int i;
double[] ModValue;
double[] PointLoadValue;
bool[] Restraint;
string[] FrameName;
string[] PointName;
int NumberResults;
string[] Obj;
string[] Elm;
string[] LoadCase;
string[] StepType;
double[] StepNum;
double[] U1;
double[] U2;
double[] U3;
double[] R1;
double[] R2;
double[] R3;
double[] SapResult;
double[] IndResult;
double[] PercentDiff;
string[] SapResultString;
string[] IndResultString;
string[] PercentDiffString;
string msg;
string temp_string1;
string temp_string2;
bool temp_bool;
//initialize model
ret = SapModel.InitializeNewModel((SAP2000.eUnits.kip_in_F));
Restraint[i] = true;
}
for (i = 4; i <= 5; i++)
{
Restraint[i] = false;
}
ret = SapModel.FrameObj.GetPoints(FrameName[0], ref temp_string1, ref temp_string2);
PointName[0] = temp_string1;
PointName[1] = temp_string2;
System.Array temp_SystemArray1 = Restraint;
ret = SapModel.PointObj.SetRestraint(PointName[0], ref temp_SystemArray1, 0);
PointName[1] = temp_string2;
PointLoadValue = new double[6];
PointLoadValue[2] = -10;
temp_SystemArray1 = PointLoadValue;
ret = SapModel.PointObj.SetLoadForce(PointName[0], "2", ref temp_SystemArray1, false, "Global", 0);
ret = SapModel.FrameObj.SetLoadDistributed(FrameName[2], "2", 1, 10, 0, 1, 1.8, 1.8, "Global",
System.Convert.ToBoolean(-1), System.Convert.ToBoolean(-1), 0);
//save model
ret = SapModel.File.Save("C:\\SapAPI\\API_1-001.sdb");
PointName[1] = temp_string2;
//close Sap2000
SapObject.ApplicationExit(false);
SapModel = null;
SapObject = null;
Release Notes
Initial release in version 11.03.
Changed nomenclature from Load Cases, Analysis Cases and Response Combinations to Load Patterns,
Load Cases and Load Combinations, respectively, in version 12.00.
This example creates the example verification problem from scratch, runs the analysis, extracts results,
and compares the results with hand-calculated values.
Example
1. Create an empty Intel Fortran project.
2. Using the Intel Fortran Module Wizard (under Tools menu), browse for Sap2000.exe, and
select all members to generate Sap2000.f90. The generated module contains explicit interfaces to
all objects and member functions of the SAP2000 API.
3. Add an empty source file by right clicking on the “Source Files” folder in Solution Explorer
and by selecting Add/New Item/Source.
4. Open the newly added file by double clicking on it and paste in the following code:
program APIExample
implicit none
!parameters
integer(kind=4), parameter :: nDimCON = 1 ! array dimension
!local variables
integer(kind=4) :: pSapObject ! pointer to a Sap object
integer(kind=4) :: pSapModel ! pointer to a model object
integer(kind=4) :: pFile ! pointer to a file object
integer(kind=4) :: pPropMaterial ! pointer to a material property object
integer(kind=4) :: pPropFrame ! pointer to a model object
integer(kind=4) :: pFrameObj ! pointer to a frame object
integer(kind=4) :: pView ! pointer to a view object
integer(kind=4) :: pPointObj ! pointer to a point object
integer(kind=4) :: pLoadPatterns ! pointer to a load patterns object
integer(kind=4) :: pAnalyze ! pointer to an analyze object
integer(kind=4) :: pAnalysisResults ! pointer to a analysis resutls object
integer(kind=4) :: pAnalysisResultsSetup ! pointer to a setup object
integer(kind=4) :: iStatus ! error code returned from COM subsystem
real(kind=8) :: dE
real(kind=8) :: dU
real(kind=8) :: dA
real(kind=8) :: dTemp
real(kind=8) :: dT3
real(kind=8) :: dT2
real(kind=8) :: dModValue
real(kind=8) :: dXi
real(kind=8) :: dYi
real(kind=8) :: dZi
real(kind=8) :: dXj
real(kind=8) :: dYj
real(kind=8) :: dZj
real(kind=8) :: dSelfWTMultiplier
real(kind=8) :: dDist1
real(kind=8) :: dDist2
real(kind=8) :: dVal1
real(kind=8) :: dVal2
real(kind=8) :: dSapResultsRA1(7)
real(kind=8) :: dIndResultsRA1(7)
logical(kind=2) :: bVisible
logical(kind=2) :: bFileSave
logical(kind=2) :: bZoom
logical(kind=2) :: bRestrained
logical(kind=2) :: bAddLoadCase
logical(kind=2) :: bReplace
logical(kind=2) :: bRelDist
logical(kind=2) :: bSelected
character(len=256) :: cFileName
character(len=256) :: cNotes
character(len=256) :: cGUID
character(len=256) :: cCsys
character(len=256) :: cLoadPat
character(len=256) :: cFrameName(3)
character(len=256) :: cPointName(2)
! pointers to SafeArrays
type(SA_BOUNDS) :: saBounds ! bounds object defining for SafeArray
integer(kind=4) :: pModValueSA ! property modifiers
integer(kind=4) :: pRestraintSA ! restraints
integer(kind=4) :: pPointLoadValueSA ! load values
integer(kind=4) :: pObjSA ! object names
integer(kind=4) :: pElmSA ! element names
integer(kind=4) :: pLCaseSA ! load case names
integer(kind=4) :: pStepTypeSA ! step type names
integer(kind=4) :: pStepNumSA ! step numbers
integer(kind=4) :: pU1SA ! displacements along u1
integer(kind=4) :: pU2SA ! displacements along u2
integer(kind=4) :: pU3SA ! displacements along u3
integer(kind=4) :: pR1SA ! displacements along r1
integer(kind=4) :: pR2SA ! displacements along r2
integer(kind=4) :: pR3SA ! displacements along r3
!initialize COM
call COMInitialize(iStatus)
!initialize model
iStatus = $$cSapModel_InitializeNewModel(pSapModel, iUnits, iRet)
iColor = -1
cNotes = ''
cGUID = ''
iStatus = $$cPropMaterial_SetMaterial(pPropMaterial, 'CONC', MATERIAL_CONCRETE, iColor,
cNotes, cGUID, iRet)
dT3 = 12.
dT2 = 12.
iColor = -1
cNotes = ''
cGUID = ''
iStatus = $$cPropFrame_SetRectangle(pPropFrame, 'R1', 'CONC', dT3, dT2, iColor, cNotes, cGUID,
iRet)
dXi = 0.; dYi = 0.; dZi = 0.; dXj = 0.; dYj = 0.; dZj = 10.
iStatus = $$cSapModel_GetFrameObj(pSapModel, pFrameObj)
iStatus = $$cFrameObj_AddByCoord(pFrameObj, dXi, dYi, dZi, dXj, dYj, dZj, cFrameName(1), 'R1',
'1', cCsys, iRet)
dXi = 0.; dYi = 0.; dZi = 10.; dXj = 8.; dYj = 0.; dZj = 16.
iStatus = $$cFrameObj_AddByCoord(pFrameObj, dXi, dYi, dZi, dXj, dYj, dZj, cFrameName(2), 'R1',
'2', cCsys, iRet)
dXi = -4.; dYi = 0.; dZi = 10.; dXj = 0.; dYj = 0.; dZj = 10.
iStatus = $$cFrameObj_AddByCoord(pFrameObj, dXi, dYi, dZi, dXj, dYj, dZj, cFrameName(3), 'R1',
'3', cCsys, iRet)
dSelfWTMultiplier = 0.
iStatus = $$cLoadPatterns_Add(pLoadPatterns, '2', iTypleLoadPat, dSelfWTMultiplier,
bAddLoadCase, iRet)
iStatus = $$cLoadPatterns_Add(pLoadPatterns, '3', iTypleLoadPat, dSelfWTMultiplier,
bAddLoadCase, iRet)
iStatus = $$cLoadPatterns_Add(pLoadPatterns, '4', iTypleLoadPat, dSelfWTMultiplier,
bAddLoadCase, iRet)
iStatus = $$cLoadPatterns_Add(pLoadPatterns, '5', iTypleLoadPat, dSelfWTMultiplier,
bAddLoadCase, iRet)
iStatus = $$cLoadPatterns_Add(pLoadPatterns, '6', iTypleLoadPat, dSelfWTMultiplier,
bAddLoadCase, iRet)
iStatus = $$cLoadPatterns_Add(pLoadPatterns, '7', iTypleLoadPat, dSelfWTMultiplier,
bAddLoadCase, iRet)
saBounds%lbound = 0
saBounds%extent = 6
pPointLoadValueSA = SafeArrayCreate(VT_R8, nDimCON, saBounds)
dModValue = 0.
do iCol = saBounds%lbound, saBounds%extent
iRet = SafeArrayPutElement(pPointLoadValueSA, iCol, loc(dModValue))
end do
dModValue = -10.
iRet = SafeArrayPutElement(pPointLoadValueSA, 2, loc(dModValue))
bReplace = .FALSE.
cCsys = 'Global'
iItemType = Object
iStatus = $$cPointObj_SetLoadForce(pPointObj, cPointName(1), '2', pPointLoadValueSA, bReplace,
cCsys, iItemType, iRet)
iMyType = 1
iDir = 10
dDist1 = 0.
dDist2 = 1.
dVal1 = 1.8
dVal2 = 1.8
cCsys = 'Global'
bRelDist = .TRUE.
bReplace = .TRUE.
iItemType = Object
iStatus = $$cFrameObj_SetLoadDistributed(pFrameObj, cFrameName(3), '2', iMyType, iDir, dDist1,
dDist2, dVal1, dVal2, cCsys, bRelDist, bReplace, iItemType, iRet)
dModValue = 0.
do iCol = saBounds%lbound, saBounds%extent
iRet = SafeArrayPutElement(pPointLoadValueSA, iCol, loc(dModValue))
end do
dModValue = -17.2
iRet = SafeArrayPutElement(pPointLoadValueSA, 2, loc(dModValue))
dModValue = -54.4
iRet = SafeArrayPutElement(pPointLoadValueSA, 4, loc(dModValue))
bReplace = .FALSE.
cCsys = 'Global'
iItemType = Object
iStatus = $$cPointObj_SetLoadForce(pPointObj, cPointName(2), '3', pPointLoadValueSA, bReplace,
cCsys, iItemType, iRet)
iRet = SafeArrayDestroy(pPointLoadValueSA)
dDist1 = 0.
dDist2 = 1.
dVal1 = 2.
dVal2 = 2.
cCsys = 'Global'
bRelDist = .TRUE.
bReplace = .TRUE.
iItemType = Object
iStatus = $$cFrameObj_SetLoadDistributed(pFrameObj, cFrameName(2), '4', iMyType, iDir, dDist1,
dDist2, dVal1, dVal2, cCsys, bRelDist, bReplace, iItemType, iRet)
dVal1 = -2.
dVal2 = -2.
iStatus = $$cFrameObj_SetLoadDistributed(pFrameObj, cFrameName(2), '5', iMyType, iDir, dDist1,
dDist2, dVal1, dVal2, cCsys, bRelDist, bReplace, iItemType, iRet)
dVal1 = -0.3744
dVal2 = 0.
iStatus = $$cFrameObj_SetLoadDistributed(pFrameObj, cFrameName(2), '6', iMyType, iDir, dDist1,
dDist2, dVal1, dVal2, cCsys, bRelDist, bReplace, iItemType, iRet)
iDir = 2
dDist1 = 0.5
dVal1 = -15.
cCsys = 'Local'
bRelDist = .TRUE.
bReplace = .TRUE.
iItemType = Object
iStatus = $$cFrameObj_SetLoadPoint(pFrameObj, cFrameName(2), '7', iMyType, iDir, dDist1, dVal1,
cCsys, bRelDist, bReplace, iItemType, iRet)
!save model
iStatus = $$cFile_Save(pFile, "c:\API_1-001.sdb", iRet)
dSapResultsRA1(:) = 0.
iItemType = ObjectElm
bSelected = .TRUE.
iStatus = $$cSapModel_GetResults(pSapModel, pAnalysisResults)
do iCol = 0, 6
iStatus = $$cAnalysisResults_GetSetup(pAnalysisResults, pAnalysisResultsSetup)
write (cLoadPat, '(I1)') iCol+1
iStatus = $$cAnalysisResultsSetup_DeselectAllCasesAndCombosForOutput
(pAnalysisResultsSetup, iRet)
else
iStatus = $$cAnalysisResults_JointDispl(pAnalysisResults, cPointName(1), iItemType,
iNumberResults, pObjSA, pElmSA, pLCaseSA, pStepTypeSA, pStepNumSA, pU1SA, pU2SA, pU3SA,
pR1SA, pR2SA, pR3SA, iRet)
iRet = SafeArrayGetElement(pU1SA, 0, loc(dModValue))
end if
dSapResultsRA1(iCol+1) = dModValue
end do
!uninitialize COM
call COMUninitialize()
!deallocate SafeArrays
iRet = SafeArrayDestroy(pObjSA)
iRet = SafeArrayDestroy(pElmSA)
iRet = SafeArrayDestroy(pLCaseSA)
iRet = SafeArrayDestroy(pStepTypeSA)
iRet = SafeArrayDestroy(pStepNumSA)
iRet = SafeArrayDestroy(pU1SA)
iRet = SafeArrayDestroy(pU3SA)
iRet = SafeArrayDestroy(pR1SA)
iRet = SafeArrayDestroy(pR2SA)
iRet = SafeArrayDestroy(pR3SA)
!display results
print *, 'LC Sap2000 Independent %Diff'
Release Notes
Initial release in version 11.03.
Changed nomenclature from Load Cases, Analysis Cases and Response Combinations to Load Patterns,
Load Cases and Load Combinations, respectively, in version 12.00.
This example creates the example verification problem from scratch, runs the analysis, extracts results,
and compares the results with hand calculated values.
Example
1. Create a Visual C++ Win32 project using the template “Win32 Console Application”.
2. In Win32 Application Wizard, add common header files for ATL under Application Settings
tab.
3. Create a folder named “tlb” under the project folder and copy “Sap2000.tlb” from the
installation folder to the “tlb” folder.
5. Open the .cpp file generated by the wizard by double clicking on it and paste in the
following code:
#include "stdafx.h"
#include <sstream>
#include <iomanip>
#include <math.h>
}
return (true);
}
// initialize COM
hRes = CoInitialize(NULL);
if(!CheckHRESULT(hRes, L"Error initializing COM subsystem!")) return (hRes);
try {
// start Sap2000 application
// CComBSTR is a wrapper for BSTRs.
CComBSTR bstrEmpty("");
res = pSapObject->ApplicationStart(kip_in_F, VARIANT_TRUE, bstrEmpty);
// initialize model
res = pSapModel->InitializeNewModel(kip_in_F);
pFile = pSapModel->Get_File();
res = pFile->NewBlank();
CComBSTR bstrPropFrame("R1");
res = pPropFrame->SetRectangle(bstrPropFrame, bstrPropMaterial, 12, 12, -1, bstrEmpty,
bstrEmpty);
CComQIPtr<_cPointObj> pPointObj;
pPointObj = pSapModel->Get_PointObj();
res = pPointObj->SetRestraint(PointName0, &(saRest.m_psa), Object);
CComBSTR bstrLoadPattern("1");
res = pLoadPatterns->Add(bstrLoadPattern, LTYPE_OTHER, SelfWTMultiplier,
AddLoadCase);
SelfWTMultiplier = 0.;
bstrLoadPattern = "2";
res = pLoadPatterns->Add(bstrLoadPattern, LTYPE_OTHER, SelfWTMultiplier,
AddLoadCase);
bstrLoadPattern = "3";
res = pLoadPatterns->Add(bstrLoadPattern, LTYPE_OTHER, SelfWTMultiplier,
AddLoadCase);
bstrLoadPattern = "4";
res = pLoadPatterns->Add(bstrLoadPattern, LTYPE_OTHER, SelfWTMultiplier,
AddLoadCase);
bstrLoadPattern = "5";
res = pLoadPatterns->Add(bstrLoadPattern, LTYPE_OTHER, SelfWTMultiplier,
AddLoadCase);
bstrLoadPattern = "6";
res = pLoadPatterns->Add(bstrLoadPattern, LTYPE_OTHER, SelfWTMultiplier,
AddLoadCase);
bstrLoadPattern = "7";
res = pLoadPatterns->Add(bstrLoadPattern, LTYPE_OTHER, SelfWTMultiplier,
AddLoadCase);
CComSafeArray<double> saPLoad(6);
for (int i = 0; i < 6; i++)
saPLoad[i] = 0.;
saPLoad[2] = -10.;
bstrLoadPattern = "2";
bstrCoordSys = "Global";
res = pPointObj->SetLoadForce(PointName0, bstrLoadPattern, &(saPLoad.m_psa),
VARIANT_FALSE, bstrCoordSys, Object);
res = pFrameObj->SetLoadDistributed(FrameName2, bstrLoadPattern, 1, 10, 0., 1., 1.8, 1.8,
bstrCoordSys, VARIANT_TRUE, VARIANT_TRUE, Object);
bstrLoadPattern = "3";
res = pPointObj->SetLoadForce(PointName1, bstrLoadPattern, &(saPLoad.m_psa),
VARIANT_FALSE, bstrCoordSys, Object);
// save model
CComBSTR bstrFileName("C:\\SapAPI\\API_1-001.sdb");
res = pFile->Save(bstrFileName);
pResults = pSapModel->Get_Results();
pResultsSetup = pResults->Get_Setup();
if (i==0) {
bstrLoadPattern = "1";
res = pResultsSetup->SetCaseSelectedForOutput(bstrLoadPattern, VARIANT_TRUE);
} else if (i==1) {
bstrLoadPattern = "2";
res = pResultsSetup->SetCaseSelectedForOutput(bstrLoadPattern, VARIANT_TRUE);
} else if (i==2) {
bstrLoadPattern = "3";
res = pResultsSetup->SetCaseSelectedForOutput(bstrLoadPattern, VARIANT_TRUE);
} else if (i==3) {
bstrLoadPattern = "4";
res = pResultsSetup->SetCaseSelectedForOutput(bstrLoadPattern, VARIANT_TRUE);
} else if (i==4) {
bstrLoadPattern = "5";
res = pResultsSetup->SetCaseSelectedForOutput(bstrLoadPattern, VARIANT_TRUE);
} else if (i==5) {
bstrLoadPattern = "6";
res = pResultsSetup->SetCaseSelectedForOutput(bstrLoadPattern, VARIANT_TRUE);
} else if (i==6) {
bstrLoadPattern = "7";
res = pResultsSetup->SetCaseSelectedForOutput(bstrLoadPattern, VARIANT_TRUE);
}
if (i <= 3)
PointName = PointName1;
else
PointName = PointName0;
if (i <= 3)
SapResult[i] = saResU3[0];
else
SapResult[i] = saResU1[0];
}
// print results
stringstream sMsg;
sMsg << fixed << setfill(' ');
sMsg << "LC Sap2000 Independent %Diff" << endl;
for (int i = 0; i < 7; i++)
sMsg << setprecision(5) << showpoint <<
setiosflags(ios::left)
<< setw(2) << i + 1 << " "
<< setw(11) << IndResult[i] << " "
// clean up objects
pFile.Release();
pPropMaterial.Release();
pPropFrame.Release();
pFrameObj.Release();
pPointObj.Release();
pView.Release();
pLoadPatterns.Release();
pAnalyze.Release();
pResults.Release();
pResultsSetup.Release();
pSapModel.Release();
pSapObject.Release();
// uninitialize COM
CoUninitialize();
// we're done!
return (res);
}
catch( _com_error& ex ) {
CheckHRESULT(ex.Error(), ex.ErrorMessage());
// uninitialize COM
CoUninitialize();
return (-1);
}
}
Release Notes
Initial release in version 12.0.1
This example creates the example verification problem from scratch, runs the analysis, extracts results,
and compares the results with hand calculated values.
Example
1. Create a folder named “C:\API” if it does not exist.
2. Create a MATLAB .m file using the built-in or any text editor and paste in the following code:
%% initialize model
ret = SapModel.InitializeNewModel;
end
ModValue(1,1) = 1000;
ModValue(2,1) = 0;
ModValue(3,1) = 0;
ret = SapModel.PropFrame.SetModifiers('R1', ModValue);
Restraint = logical(zeros(6,1));
for i = 1 : 4
Restraint(i,1) = true();
end
for i = 5 : 6
Restraint(i,1) = false();
end
for i = 3 : 6
Restraint(i,1) = false();
end
%% save model
ret = SapModel.File.Save('C:\API\API_1-001.sdb');
ret = SapModel.Results.Setup.DeselectAllCasesAndCombosForOutput;
ret = SapModel.Results.Setup.SetCaseSelectedForOutput(int2str(i));
if i <= 4
[ret, NumberResults, Obj, Elm, ACase, StepType, StepNum, U1, U2, U3, R1, R2, R3] =
SapModel.Results.JointDispl(PointName2, ObjectElm, NumberResults, Obj, Elm, ACase, StepType,
StepNum, U1, U2, U3, R1, R2, R3);
SapResult(i) = U3(1);
else
[ret, NumberResults, Obj, Elm, ACase, StepType, StepNum, U1, U2, U3, R1, R2, R3] =
SapModel.Results.JointDispl(PointName1, ObjectElm, NumberResults, Obj, Elm, ACase, StepType,
StepNum, U1, U2, U3, R1, R2, R3);
SapResult(i) = U1(1);
end
end
%% close Sap2000
ret = SapObject.ApplicationExit(false());
SapModel = 0;
SapObject = 0;
IndResult(2) = 0.06296;
IndResult(3) = 0.06296;
IndResult(4) = -0.2963;
IndResult(5) = 0.3125;
IndResult(6) = 0.11556;
IndResult(7) = 0.00651;
%% display results
SapResult
IndResult
PercentDiff
Release Notes
Initial release in version 12.0.1