I have 3 issues with trying to use the GetResultantForceAlongLineForPlateList function that I suppose are probably the cause I can't retrieve yet the resultant forces along a line of cut plates thus
any example, supplementary data or help would be truly appreciated (RetVal is always returning FALSE thus all retrieved values in "forces" vector are zero).
1.- The manual for openstaad reads the following to call this function (7 parameters)
VARIANT OSOutputUI::GetResultantForceAlongLineForPlateList | ( | VARIANT FAR & | plateList, |
| | const VARIANT FAR & | nplates, |
| | VARIANT FAR & | loadIdList, |
| | VARIANT FAR & | startNode, |
| | VARIANT FAR & | endNode, |
| | const VARIANT FAR & | isTransformForceToGlobal, |
| | VARIANT FAR & | resultantForces |
| ) |
but in the description below it refers to another parameter "facingnode" that I don't know how to pass of if it is not needed at all (i called the function with 8 parameters just for a test and it gave me an error)
Returns forces and moments along the cut line for a particular load case.
- Parameters
[in] | plateList | List of plates IDs. a) All plates in model, b) plates through which the cut line crosses (both would work but 'a' is computationally expensive) |
[in] | nplates | No of plates in plateList |
[in] | loadId | the load case for plate analysis |
[in] | startNode | x, y, z values of the start node at indexes 0, 1 and 2. API always expects an array size of 3. |
[in] | endNode | x, y, z values of the end node at indexes 0, 1 and 2. API always expects an array size of 3. |
[in] | facingNode | x, y, z values of the facing node at indexes 0, 1 and 2. API always expects an array size of 3. Definition of facingNode: It is the node which sits on the tip of a vector which is orthogonal to the vector startNode -> endNode and lies in the same plane as that of the plates through which the cut line passes. |
[in] | isTransformForceToGlobal | 1: return force in Global System 0: return forces in local system of cut line |
[out] | resultantForces | Fx, Fy, Fz, Mx, My, Mz at array indexes 0, 1, 2, 3, 4, 5 |
2.- the example provided in the manual calls for another function instead GetResultantForceAlongLineForParametricSurface
Dim objOpenStaad As Object
Dim stdFile As String
Dim RetVal As Variant
Dim surfaceName As String
Dim loadId As Long
Dim startNode(2) As Double
Dim endNode(2) As Double
Dim forces(5) As Double
Dim transformToGlobal As Long
Dim fx,fy,fz,mx,my,mz As Double
Set objOpenStaad = GetObject(,"StaadPro.OpenSTAAD")
objOpenStaad.GetSTAADFile stdFile, "TRUE"
If stdFile="" Then
MsgBox"Bad"
Set objOpenStaad = Nothing
Exit Sub
End If
surfaceName = "WALL 1 "
loadId = 1
startNode(0) = 0
startNode(1) = 15
startNode(2) = 0
endNode(0) = 0
endNode(1) = 54
endNode(2) = 60
transformToGlobal = 1
fx = forces(0)
fy = forces(1)
fz = forces(2)
mx = forces(3)
my = forces(4)
mz = forces(5)
3.- I'm not sure what is the format required for the list of plates to be provided in the string parameter plateList; ¿space or blank or comma between values?
The sub I'm using is this so far -not working-; the coordinates of the nodes are in my model in the ends of a line that crosses 10 plates
Sub OpenSTAADresultantes()
Dim objOpenStaad As Object
Dim stdFile As String
Dim RetVal As Variant
Dim numerodeplacas As Variant
Dim surfaceName As String
Dim loadId As Long
Dim startNode(2) As Double
Dim endNode(2) As Double
Dim FacingNode(2) As Double
Dim forces(5) As Double
Dim transformToGlobal As Long
Dim fx, fy, fz, mx, my, mz As Double
Set objOpenStaad = GetObject(, "StaadPro.OpenSTAAD")
objOpenStaad.GetSTAADFile stdFile, "TRUE"
If stdFile = "" Then
MsgBox "Bad"
Set objOpenStaad = Nothing
Exit Sub
End If
'surfaceName = "110 130 150 170 190 210 230 250 270 290"
surfaceName = "110,130,150,170,190,210,230,250,270,290"
numerodeplacas = 10
loadId = 1
startNode(0) = 4.75
startNode(1) = 0
startNode(2) = 0
endNode(0) = 4.75
endNode(1) = 0
endNode(2) = 5
FacingNode(0) = 4.75 'NOTA en la ayuda pide este punto pero no está en los argumentos
FacingNode(1) = 5
FacingNode(2) = 5
'1: return force in Global System 0: return forces in local system of cut line
transformToGlobal = 1
RetVal = objOpenStaad.Output.GetResultantForceAlongLineForPlateList(surfaceName, numerodeplacas, loadId, startNode, endNode, transformToGlobal, forces)
'RetVal = objOpenStaad.Output.GetResultantForceAlongLineForPlateList(surfaceName, numerodeplacas, loadId, startNode, endNode, FacingNode, transformToGlobal, forces)
fx = forces(0)
fy = forces(1)
fz = forces(2)
mx = forces(3)
my = forces(4)
mz = forces(5)
MsgBox fz
MsgBox mx
End Sub