Ros Example PDF
Ros Example PDF
version 6.0
R o b o t Open S t a n d ard v 6.0
Table of Contents
INTRODUCTION................................................................................................................................................3
DESCRIPTION OF COM TECHNOLOGY ...............................................................................................................3
THE SIMPLEST APPLICATION ..............................................................................................................................3
STRUCTURE MODELING...............................................................................................................................4
SETTING THE PROJECT PREFERENCES ................................................................................................................4
Parameters of mesh generation ...................................................................................................................5
MODELING THE MEMBERS (BEAMS, COLUMNS) ................................................................................................5
Section definition...........................................................................................................................................6
Material definition ........................................................................................................................................7
MODELING THE PANELS (OF SLABS, WALLS).....................................................................................................7
Hole definition...............................................................................................................................................9
MODELING THE SUPPORTS (SPREAD FOOTINGS)................................................................................................9
MODELING THE GROUND..................................................................................................................................10
MODELING THE LOADS .....................................................................................................................................10
Defining the regulations for load combinations .......................................................................................11
LAUNCHING THE CALCULATIONS.........................................................................................................12
STRUCTURAL ANALYSIS ...................................................................................................................................12
CALCULATING THE SLAB REINFORCEMENT .....................................................................................................13
GETTING THE RESULTS..............................................................................................................................15
GETTING THE RESULTS FOR MEMBERS ............................................................................................................15
GETTING THE RESULTS FOR NODES..................................................................................................................16
GETTING THE RESULTS FOR SLAB REINFORCEMENT .......................................................................................16
THE PROGRAM CODE..................................................................................................................................18
VISUAL BASIC ..................................................................................................................................................18
C++...................................................................................................................................................................24
Pag e 2
R o b o t Open S t a n d ard v 6.0
INTRODUCTION
The manual is intended for programmers who want to take advantage of the Robot
Millennium calculation kernel in their applications. It assumes that the reader has basic
knowledge of programming in Visual Basic v. 6.0 with the use of COM technology. The
manual is arranged in the form of comprehensive commentary to the code of the example
application, which carries out calculations of simple frame structure with slabs.
To run the example the User has to have Visual Basic or Visual C++ version 6.0 or more
recent, and installed Robot Millennium version 17.5.1.1764 or more recent.
Robot.Project.Structure.Nodes.Create 1, 0, 0, 0
Robot.Project.Structure.Nodes.Create 2, 3, 0, 0
Robot.Project.Structure.Bars.Create 1, 1, 2
Pag e 3
R o b o t Open S t a n d ard v 6.0
SupportData.RX = 0
SupportData.RY = 0
SupportData.RZ = 0
Robot.Project.Structure.labels.Store Label
Robot.Project.Structure.Nodes.Get(1).SetLabel I_LT_SUPPORT, "Support"
Robot.Project.Structure.Nodes.Get(2).SetLabel I_LT_SUPPORT, "Support"
STRUCTURE MODELING
We start the work with the structure in ROS by creating the new project and setting the
preferences. The manual cannot cover the detailed description of all options. In the example it
is also presented how to parametrize the task, this method may successfully be applied in
calculations of real structures, consisting of such elements as: beams, columns, slabs, walls,
continuous footing, spread footing (also on elastic ground), loaded by different types of dead
and live loads, wind or seismic loads.
The application code begins with creating ROS object model, applying the structure type – in
this case it is 3D structure with 6 degrees of freedom.
Dim Robot As New RobotApplication
Robot.Project.New I_PT_SHELL
Pag e 4
R o b o t Open S t a n d ard v 6.0
With str.Bars
.Create 1, 1, 5
.Create 2, 2, 6
.Create 3, 3, 7
.Create 4, 4, 8
.Create 5, 5, 6
.Create 6, 7, 8
End With
Pag e 5
R o b o t Open S t a n d ard v 6.0
Section definition
The User should assign the sections to the defined members. One section may be assigned to
the optional number of members. The most often used sections are steel and concrete sections,
which are defined in a different way because steel sections are selected from the base of steel
sections whereas the concrete sections should be defined by giving their size every time.
In the example below we define one square concrete section of 30cm of size and one steel
section named ”HEA 340” basing on ”RCAT” section database.
The concrete section is then assigned to the columns (members numbered 1 to 4), and steel
section is assigned to the beams (members numbered 5 and 6). Materials, from which the
elements of the given sections are made, will get default parameters selected by the program.
It is possible to change these parameters (description provided in the next chapter).
Dim labels As RobotLabelServer
Set labels = str.labels
Pag e 6
R o b o t Open S t a n d ard v 6.0
Material definition
In the real projects it is necessary to define the materials such as concrete, steel, timber with
their resistance parameters. The example below presents the method of material definition
(concrete type). This material may be later applied to any structural element, having the
concrete section. In the next chapter this material will be applied to the defined slab.
MaterialName = "Concrete 30"
Pag e 7
R o b o t Open S t a n d ard v 6.0
Preparing the list of points defining the slab contour; in the example below the contour
coordinates are equal to the coordinates of previously defined nodes, program will
automatically connect the slab contour with appropriate nodes in course of structural mesh
generation.
Dim points As RobotPointsArray
Set points = Kernel.CmpntFactory.Create(I_CT_POINTS_ARRAY)
points.SetSize 5
With points
.Set 1, 0, 0, 4
.Set 2, 3, 0, 4
.Set 3, 3, 3, 4
.Set 4, 0, 3, 4
.Set 5, 0, 0, 4
End With
Defining the slab section (thickness). This section may be assigned to any number of slabs.
SlabSectionName = "Slab 30"
Set Label = labels.Create(I_LT_PANEL_THICKNESS, SlabSectionName)
Dim thickness As RobotThicknessData
Set thickness = Label.Data
thickness.MaterialName = MaterialName
thickness.ThicknessType = I_TT_HOMOGENEOUS
Dim thicknessData As RobotThicknessHomoData
Set thicknessData = thickness.Data
thicknessData.ThickConst = 0.3
labels.Store Label
Defining the slab object and assigning the attributes: geometry and section to it. Additionally
we should set Meshed parameter to True, what means that the slab is the integral part of the
structure and will be meshed. Non-meshed contours are used for example in the hole
definition or as the auxiliary objects in the contour load definition.
Defining the contour we should give its number. Numbering of contours and members is
common and therefore we should make sure that the numbers of members and slabs do not
collide with one another. We may take advantage of FreeNumber method, returning the
successive available object number, which may be used in course of object definition.
Dim slab As RobotObjObject
objNumber = str.Objects.FreeNumber
str.Objects.CreateContour objNumber, points
Set slab = str.Objects.Get(objNumber)
slab.Main.Attribs.Meshed = True
slab.SetLabel I_LT_PANEL_THICKNESS, SlabSectionName
slab.Initialize
Pag e 8
R o b o t Open S t a n d ard v 6.0
Hole definition
The hole definition in the slabs is similar to the slab definition, however we should remember
about a few principles, which help to avoid the possible errors that may occur in course of
calculations. The hole contour should be located inside the slab contour and in its plane. We
may also define the holes comprising the several contacting slabs.
We should assign Meshed = False attribute to the holes without assigning the section.
With points
.Set 1, 1.1, 1.1, 4
.Set 2, 2.5, 1.1, 4
.Set 3, 2.5, 2.5, 4
.Set 4, 1.1, 2.5, 4
.Set 5, 1.1, 1.1, 4
End With
Pag e 9
R o b o t Open S t a n d ard v 6.0
Each load case has its unique number, in the example below self-weight load - 1, live load –
2, wind load – 3.
Defining the self-weight load applied to the whole structure:
Dim caseSW As RobotSimpleCase
Set caseSW = str.Cases.CreateSimple(1, "SW", I_CN_PERMANENT,
I_CAT_STATIC_LINEAR)
caseSW.Records.New I_LRT_DEAD
Dim LoadRec As RobotLoadRecord
Set LoadRec = caseSW.Records.Get(1)
LoadRec.SetValue I_DRV_Z, -1
LoadRec.SetValue I_DRV_ENTIRE_STRUCTURE, True
Defining the uniform load on contour, applied to the slab. The load is added to „Live” case,
which is created for that purpose. The load is in the opposite direction to Z axis direction and
its value is 10 [kN].
Dim LoadRecord As RobotLoadRecord
Pa ge 1 0
R o b o t Open S t a n d ard v 6.0
Pa ge 1 1
R o b o t Open S t a n d ard v 6.0
Structural analysis
Starting the static calculations of the structure with error reports and progress bar displayed.
Private WithEvents CalcEngine As RobotCalcEngine
-----------------------------------------------------------------------
----
Private Sub CalcEngine_CalcNotifyEx(ByVal nCaller As Long, ByVal
strText As String, ByVal strFullText As String, ByVal strCaption As
String, ByVal nType As Long, ByVal nDataType As Long, ByVal
strSelection As String, bHandled As Boolean, nReturnValue As Long)
If strText <> Empty Then
bHandled = True
Output.AddItem strText
End If
-----------------------------------------------------------------------
----
End Sub
Output.AddItem "Start Static Calculation..."
Kernel.CalcEngine.GenerationParams.GenerateNodes_BarsAndFiniteElems =
True
Kernel.CalcEngine.GenerateModel
Set CalcEngine = Kernel.CalcEngine
CalcEngine.UseStatusWindow = True
CalcEngine.StatusWindowParent = Form1.hWnd
If CalcEngine.Calculate = False Then
Output.AddItem "Failed!"
Else
Output.AddItem "Done!"
End If
Set CalcEngine = Nothing
CalcEngine_CalcNotifyEx function is generated automatically in Visual Basic environment.
The application has only to display the received message in the form of dialog window or add
it to report dialog window. The application may also abort the calculations as an error occurs,
when nReturnValue is set in appropriate way, e.g.:
Private Sub CalcEngine_CalcNotifyEx( . . . )
Pa ge 1 2
R o b o t Open S t a n d ard v 6.0
If after preliminary verification of the structure ROS starts the calculations, in case of large
structures the progress bar window may appear, as shown in the drawing below.
Pa ge 1 3
R o b o t Open S t a n d ard v 6.0
slabRnfParams.Method = I_RCM_WOOD_ARMER
slabRnfParams.GloballyAvgDesginForces = False
slabRnfParams.ForcesReduction = False
slabRnfParams.DisplayErrors = False
slabs.FromText ObjNumber
Pa ge 1 4
R o b o t Open S t a n d ard v 6.0
Pa ge 1 5
R o b o t Open S t a n d ard v 6.0
Pa ge 1 6
R o b o t Open S t a n d ard v 6.0
AxP = A
End If
A =
str.Results.FiniteElems.Reinforcement(ObjFEs.Get(N).Number).AY_BOTTOM
If A > AyM Then
AyM = A
End If
A =
str.Results.FiniteElems.Reinforcement(ObjFEs.Get(N).Number).AY_TOP
If A > AyP Then
AyP = A
End If
Next N
Pa ge 1 7
R o b o t Open S t a n d ard v 6.0
Visual Basic
Private WithEvents CalcEngine As RobotCalcEngine
‘----------------------------------------------------------------------
---
Private Sub CalcEngine_CalcNotifyEx(ByVal nCaller As Long, ByVal
strText As String, ByVal strFullText As String, ByVal strCaption As
String, ByVal nType As Long, ByVal nDataType As Long, ByVal
strSelection As String, bHandled As Boolean, nReturnValue As Long)
If strText <> Empty Then
Output.AddItem strText
bHandled = True
End If
End Sub
‘----------------------------------------------------------------------
---
Private Sub Go_Click()
Output.Clear
Output.AddItem "Launching Robot Millennium..."
With str.Nodes
.Create 1, 0, 0, 0
.Create 2, 3, 0, 0
.Create 3, 3, 3, 0
.Create 4, 0, 3, 0
.Create 5, 0, 0, 4
.Create 6, 3, 0, 4
.Create 7, 3, 3, 4
.Create 8, 0, 3, 4
End With
Pa ge 1 8
R o b o t Open S t a n d ard v 6.0
With str.Bars
.Create 1, 1, 5
.Create 2, 2, 6
.Create 3, 3, 7
.Create 4, 4, 8
.Create 5, 5, 6
.Create 6, 7, 8
End With
Pa ge 1 9
R o b o t Open S t a n d ard v 6.0
With points
.Set 1, 1.1, 1.1, 4
.Set 2, 2.5, 1.1, 4
.Set 3, 2.5, 2.5, 4
.Set 4, 1.1, 2.5, 4
.Set 5, 1.1, 1.1, 4
End With
FootName = "Foot"
Pa ge 2 0
R o b o t Open S t a n d ard v 6.0
labels.Store Label
Pa ge 2 1
R o b o t Open S t a n d ard v 6.0
slabRnfParams.Method = I_RCM_WOOD_ARMER
slabRnfParams.GloballyAvgDesginForces = False
slabRnfParams.ForcesReduction = False
slabRnfParams.DisplayErrors = False
slabRnfParams.CasesULS.FromText ("1 2 3 4 5 6 7 8")
slabs.FromText ObjNumber
'getting results My and Yz for beam (bar 5) with live load (case 2)
Dim Text As String
Output.AddItem "Bar 5, Live:"
Text = " My = " & str.Results.Bars.Forces.Value(5, 2, 0.5).MY / 1000 &
_
" [kN*m], Qz = " & -str.Results.Bars.Deflections.Value(5, 2,
0.5).UZ _
* 1000 & " [mm]"
Output.AddItem Text
Text = " Fz1 = " & str.Results.Bars.Forces.Value(5, 2, 0#).FZ / 1000 &
_
" Fz2 = " & str.Results.Bars.Forces.Value(5, 2, 1#).FZ / 1000 &
" [kN]"
Output.AddItem Text
'getting results Fx and Fy for column (bar 4) with wind load (case 3)
Output.AddItem "Bar 4, Wind:"
Text = " Fx = " & str.Results.Bars.Forces.Value(4, 3, 1#).FX / 1000 &
_
" Fy = " & str.Results.Bars.Forces.Value(4, 3, 1#).FY / 1000 &
_
" [kN]"
Output.AddItem Text
'getting results Fx, Fy, Fz, Mx, My, Mz for foot (node 1) with self-
weight (case 1)
Pa ge 2 2
R o b o t Open S t a n d ard v 6.0
Pa ge 2 3
R o b o t Open S t a n d ard v 6.0
End Sub
C++
The example was written taking advantage of Microsoft Visual C++ 6.0 compiler and MFC
4.2 library.
#include "stdafx.h"
#include "KernelForDummiesC.h"
#include <afxctl.h>
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
// Operations
public:
void OnCalcNotifyEx(long nCaller, LPCTSTR lpszText, LPCTSTR
lpszFullText, LPCTSTR lpszCaption, long nType, long nDataType, LPCTSTR
lpszSelection, BOOL* bHandled, long* nReturnValue);
// Implementation
protected:
DWORD m_dwCookie;
IRobotCalcEngine* m_pRobotCalcEngine;
DECLARE_DISPATCH_MAP()
DECLARE_INTERFACE_MAP()
};
CWinApp theApp;
::CoInitialize(NULL);
Pa ge 2 4
R o b o t Open S t a n d ard v 6.0
Pa ge 2 5
R o b o t Open S t a n d ard v 6.0
pBars->SetLabel(pSelectionBars, I_LT_BAR_SECTION,
ColumnSectionName.c_str());
Pa ge 2 6
R o b o t Open S t a n d ard v 6.0
Pa ge 2 7
R o b o t Open S t a n d ard v 6.0
pLoadRecord->GetObjects()->FromText("5");
IRConcrSlabRequiredReinfEnginePtr pConcrSlabRequiredReinfEngine =
pConcrCalcEngine->GetSlabRequiredReinf();
IRConcrSlabRequiredReinfCalcParamsPtr pSlabRnfParams =
pConcrSlabRequiredReinfEngine->GetParams();
pSlabRnfParams->PutMethod(I_RCM_WOOD_ARMER);
pSlabRnfParams->PutGloballyAvgDesginForces(VARIANT_FALSE);
pSlabRnfParams->PutForcesReduction(VARIANT_FALSE);
pSlabRnfParams->PutDisplayErrors(VARIANT_FALSE);
pSlabRnfParams->GetCasesULS()->FromText("1 2 3 4 5 6 7 8");
Pa ge 2 8
R o b o t Open S t a n d ard v 6.0
//getting results Fx and Fy for column (bar 4) with wind load (case
3)
cout << "Bar 4, Wind:" << endl;
cout << " Fx = " << pResults->GetBars()->GetForces()->Value(4, 3,
1.)->GetFX() / 1000 <<
" Fy = " << pResults->GetBars()->GetForces()->Value(4, 3,
1.)->GetFY() / 1000 << " [kN]" << endl;
//getting results Fx, Fy, Fz, Mx, My, Mz for foot (node 1) with
self-weight (case 1)
cout << "Node 1, Self-Weight:" << endl;
cout << " Fx = " << pResults->GetNodes()->GetReactions()->Value(1,
1)->GetFX() / 1000 <<
" Fy = " << pResults->GetNodes()->GetReactions()->Value(1,
1)->GetFY() / 1000 <<
" Fz = " << pResults->GetNodes()->GetReactions()->Value(1,
1)->GetFZ() / 1000 << " [kN]" <<
" Mx = " << pResults->GetNodes()->GetReactions()->Value(1,
1)->GetMX() / 1000 <<
" My = " << pResults->GetNodes()->GetReactions()->Value(1,
1)->GetMY() / 1000 <<
" Mz = " << pResults->GetNodes()->GetReactions()->Value(1,
1)->GetMZ() / 1000 << " [kN*m]" << endl;
Pa ge 2 9
R o b o t Open S t a n d ard v 6.0
return 0;
}
CRobotCalcEngineEvents::CRobotCalcEngineEvents(IRobotCalcEngine*
pRobotCalcEngine)
{
EnableAutomation(); // Needed in order to sink events.
m_pRobotCalcEngine = pRobotCalcEngine;
m_dwCookie = 0;
if (m_pRobotCalcEngine)
VERIFY(AfxConnectionAdvise(m_pRobotCalcEngine,
__uuidof(_IRobotCalcEngineEvents),
GetInterface(&IID_IUnknown), TRUE,
&m_dwCookie));
}
CRobotCalcEngineEvents::~CRobotCalcEngineEvents()
{
if (m_dwCookie && m_pRobotCalcEngine)
{
VERIFY(AfxConnectionUnadvise(m_pRobotCalcEngine,
__uuidof(_IRobotCalcEngineEvents),
GetInterface(&IID_IUnknown), TRUE,
m_dwCookie));
m_dwCookie = 0;
}
}
IMPLEMENT_DYNAMIC(CRobotCalcEngineEvents, CCmdTarget)
BEGIN_DISPATCH_MAP(CRobotCalcEngineEvents, CCmdTarget)
DISP_FUNCTION_ID(CRobotCalcEngineEvents, "CalcNotifyEx", 0x2,
OnCalcNotifyEx, VT_EMPTY, VTS_I4 VTS_BSTR VTS_BSTR
VTS_BSTR VTS_I4 VTS_I4 VTS_BSTR VTS_PBOOL VTS_PI4)
END_DISPATCH_MAP()
BEGIN_INTERFACE_MAP(CRobotCalcEngineEvents, CCmdTarget)
INTERFACE_PART(CRobotCalcEngineEvents,
__uuidof(_IRobotCalcEngineEvents), Dispatch)
END_INTERFACE_MAP()
Pa ge 3 0