tlemonds
Aerospace
- Feb 1, 2014
- 20
Hey folks!
I'm attempting to use the Check Sum Forces tool in my API script. I'm a bit of rookie writing VBA but I have a little experience--but I have no experience writing VBA in the FEMAP API (as my pasted code probably shows). The goal of the script is to prompt the user to select a range of node IDs and have the Check Sum Forces tool sum the forces of the nodes around the global rectangular origin. I can't seem to get the feCheckSumForces2 command to work, I keep receive the error " Expecting '(' " for that line. Here is my code:
Sub Main
Dim model1 As femap.model
Dim set1 As femap.Set
Dim node1 As femap.Node
Set model1 = GetObject(,"femap.model")
Set set1 = model1.feSet
Set node1 = model1.feNode
set1.Select(FT_NODE,True,"Select Node(s)")
Do While set1.Next
node1.Get(set1.CurrentID)
Loop
Dim origin(2) As Long
Dim checkParam(3) As Boolean
origin(0) = 0 : origin(1) = 0: origin(2) = 0
checkParam(0) = False : checkParam(1) = False : checkParam(2) = True : checkParam(3) = True
Dim checkoutput(26) As femap.OutputSet
checkoutput.feCheckSumForces2(checkParam, set1, 0, 0, origin, 0)
End Sub
And for convenience, here is the help page on feCheckSumForces2 :
3.5.6.17 feCheckSumForces2
feCheckSumForces2
( useBodyLoad, expandGEOM, doLIST, useSETS, nodeSET, elemSET, loaddefSET, basePOINT, csysID, summedFORCES )
Description:
This function checks loads from the active load set and sums the forces around a specific location.
Input:
BOOL useBodyLoad
If True, body loads will be included in the calculation. If not, body loads will be ignored
BOOL expandGEOM
If True, geometric loads are expanded before the check. If not, nonexpanded geometric loads will be ignored.
BOOL doLIST
If True, a summary report is written.
BOOL useSETS
If True, nodeSET and elemSET OR loaddefSET must specify the nodes and elements OR load definitions to consider in the summation. To use nodeSET and elemSET, set loaddefSET = 0, otherwise, loaddefSET will be used. If False, the full model is used.
INT4 nodeSET
The ID of a selection set that contains the IDs of the nodes to check. Alternatively, if you specify a negative value, this is simply the ID of the single node to check. Only used if useSETS=True and loaddefSET = 0
INT4 elemSET
The ID of a selection set that contains the IDs of the elements to check. Alternatively, if you specify a negative value, this is simply the ID of the single element to check. Only used if useSETS=True and loaddefSET = 0.
INT4 loaddefSET
The ID of a selection set that contains the IDs of the load definitions to check. Alternatively, if you specify a negative value, this is simply the ID of the single load definition. Only used if useSETS=True.
REAL8 basePOINT[0..2]
The coordinates of the location to sum about. Must be in global rectangular coordinates.
INT4 csysID
The coordinate system used to report and returned the summed loads.
Output:
REAL8 summedFORCES[0..26]
The results of the force summation. Entries [0..5] are the nodal force summations. [6..8] contain the elemental force summation. [9..14] contain the total summation. [15-17] contain body translational acceleration. [18-20] contain body varying translational acceleration. [21-23] contain body rotational acceleration. [24-26] contain body rotational velocity.
I'm attempting to use the Check Sum Forces tool in my API script. I'm a bit of rookie writing VBA but I have a little experience--but I have no experience writing VBA in the FEMAP API (as my pasted code probably shows). The goal of the script is to prompt the user to select a range of node IDs and have the Check Sum Forces tool sum the forces of the nodes around the global rectangular origin. I can't seem to get the feCheckSumForces2 command to work, I keep receive the error " Expecting '(' " for that line. Here is my code:
Sub Main
Dim model1 As femap.model
Dim set1 As femap.Set
Dim node1 As femap.Node
Set model1 = GetObject(,"femap.model")
Set set1 = model1.feSet
Set node1 = model1.feNode
set1.Select(FT_NODE,True,"Select Node(s)")
Do While set1.Next
node1.Get(set1.CurrentID)
Loop
Dim origin(2) As Long
Dim checkParam(3) As Boolean
origin(0) = 0 : origin(1) = 0: origin(2) = 0
checkParam(0) = False : checkParam(1) = False : checkParam(2) = True : checkParam(3) = True
Dim checkoutput(26) As femap.OutputSet
checkoutput.feCheckSumForces2(checkParam, set1, 0, 0, origin, 0)
End Sub
And for convenience, here is the help page on feCheckSumForces2 :
3.5.6.17 feCheckSumForces2
feCheckSumForces2
( useBodyLoad, expandGEOM, doLIST, useSETS, nodeSET, elemSET, loaddefSET, basePOINT, csysID, summedFORCES )
Description:
This function checks loads from the active load set and sums the forces around a specific location.
Input:
BOOL useBodyLoad
If True, body loads will be included in the calculation. If not, body loads will be ignored
BOOL expandGEOM
If True, geometric loads are expanded before the check. If not, nonexpanded geometric loads will be ignored.
BOOL doLIST
If True, a summary report is written.
BOOL useSETS
If True, nodeSET and elemSET OR loaddefSET must specify the nodes and elements OR load definitions to consider in the summation. To use nodeSET and elemSET, set loaddefSET = 0, otherwise, loaddefSET will be used. If False, the full model is used.
INT4 nodeSET
The ID of a selection set that contains the IDs of the nodes to check. Alternatively, if you specify a negative value, this is simply the ID of the single node to check. Only used if useSETS=True and loaddefSET = 0
INT4 elemSET
The ID of a selection set that contains the IDs of the elements to check. Alternatively, if you specify a negative value, this is simply the ID of the single element to check. Only used if useSETS=True and loaddefSET = 0.
INT4 loaddefSET
The ID of a selection set that contains the IDs of the load definitions to check. Alternatively, if you specify a negative value, this is simply the ID of the single load definition. Only used if useSETS=True.
REAL8 basePOINT[0..2]
The coordinates of the location to sum about. Must be in global rectangular coordinates.
INT4 csysID
The coordinate system used to report and returned the summed loads.
Output:
REAL8 summedFORCES[0..26]
The results of the force summation. Entries [0..5] are the nodal force summations. [6..8] contain the elemental force summation. [9..14] contain the total summation. [15-17] contain body translational acceleration. [18-20] contain body varying translational acceleration. [21-23] contain body rotational acceleration. [24-26] contain body rotational velocity.