- AddMultipleNodes
- AddNode
- ClearNodeSelection
- CreateMultipleNodes
- CreateNode
- DeleteNode
- GetLastNodeNo
- GetNodeCoordinates
- GetNodeCount
- GetNodeDistance
- GetNodeIncidence
- GetNodeIncidence_CIS2
- GetNodeList
- GetNodeNumber
- GetNodeUniqueID
- GetNoOfSelectedNodes
- GetSelectedNodes
- IsOrphanNode
- MergeNodes
- SelectMultipleNodes
- SelectNode
- SetNodeCoordinate
- SetNodeUniqueID
AddMultipleNodes #
This function adds multiple nodes with a specified array of node coordinates.
Parameters:
- [in] faCoordinates: A
VARIANT
array of dimensionsm * 3
containing coordinates of nodes:[Xi, Yi, Zi]
.
VBA Syntax:
' Add multiple nodes.
OSGeometryUI.AddMultipleNodes(faCoordinates)
AddNode #
This function adds a node with specified coordinates in the current model and returns the automatically assigned node number ID.
Parameters:
- [in] fCoordX: Nodal coordinate X in GLOBAL.
- [in] fCoordY: Nodal coordinate Y in GLOBAL.
- [in] fCoordZ: Nodal coordinate Z in GLOBAL.
Return Values:
- Node number ID assigned to the created node.
- 0: OK.
- -2004: Unable to add node.
VBA Syntax:
Dim fCoordX As Double = 3.0
Dim fCoordY As Double = 2.0
Dim fCoordZ As Double = 3.0
' Add a node (3.0, 2.0, 3.0).
Dim nNodeNo As VARIANT = OSGeometryUI.AddNode(fCoordX, fCoordY, fCoordZ)
ClearNodeSelection #
This function unselects all node items.
VBA Syntax:
' Clear Node Selection.
OSGeometryUI.ClearNodeSelection()
CreateMultipleNodes #
This function creates multiple nodes with specified node number IDs.
Parameters:
- [in] nNodeIdArray: Integer array containing node IDs:
[IDi]
. - [in] dCoordArray: Double array containing node coordinates
[Xi, Yi, Zi]
.
VBA Syntax:
Dim nNodeIdArray(1) As Integer
nNodeIdArray(0) = 91
nNodeIdArray(1) = 92
Dim dCoordArray(12) As Integer
dCoordArray(0) = 3
dCoordArray(1) = 5
dCoordArray(2) = 15
' Create multiple nodes.
objOpenSTAAD.Geometry.CreateMultipleNodes nNodeIdArray, dCoordArray
CreateNode #
This function creates a node with the specified coordinates in the structure.
Parameters:
- [in] nNodeNo: Node number ID to be assigned to the newly created node.
- [in] fCoordX: Nodal coordinate X in GLOBAL.
- [in] fCoordY: Nodal coordinate Y in GLOBAL.
- [in] fCoordZ: Nodal coordinate Z in GLOBAL.
VBA Syntax:
Dim fCoordX As Double = 3.0
Dim fCoordY As Double = 2.0
Dim fCoordZ As Double = 3.0
' Add a node (3.0, 2.0, 3.0) and call it node #10.
OSGeometryUI.CreateNode 10, fCoordX, fCoordY, fCoordZ
DeleteNode #
This function deletes a specified node.
Parameters:
- [in] nNodeNo: Node number ID to be deleted.
VBA Syntax:
Dim nNodeNo As Long = 25
' Delete node #25.
OSGeometryUI.DeleteNode nNodeNo
GetLastNodeNo #
This function returns the node number ID of the last node in the model.
Return Values:
- The number of the highest node ID in the model.
- -1: General error.
VBA Syntax:
' Get the last node number.
Dim LastNodeNo As VARIANT = OSGeometryUI.GetLastNodeNo()
GetNodeCoordinates #
This function returns the coordinates of a specified node.
Parameters:
- [in] nNodeNo: Node number ID.
- [out] fCoordX: Nodal coordinate X in GLOBAL.
- [out] fCoordY: Nodal coordinate Y in GLOBAL.
- [out] fCoordZ: Nodal coordinate Z in GLOBAL.
VBA Syntax:
code' Get coordinates of node #10.
OSGeometryUI.GetNodeCoordinates 10, fCoordX, fCoordY, fCoordZ
GetNodeCount #
This function returns the total number of nodes in the current model.
Return Values:
- The total number of nodes.
VBA Syntax:
' Get node count.
Dim lNodeCount As VARIANT = OSGeometryUI.GetNodeCount()
GetNodeDistance #
This function returns the distance between two specified nodes.
Parameters:
- [in] nNodeNoA: Node number ID of one node.
- [in] nNodeNoB: Node number ID of the other node.
Return Values:
- The distance as a double.
- -1: Cannot find either node.
VBA Syntax:
' Get the distance between node 2 and node 3.
Dim NodeDist As VARIANT = OSGeometryUI.GetNodeDistance(2, 3)
GetNodeIncidence #
This function returns the coordinates of the specified node.
Parameters:
- [in] nNodeNo: Node number ID.
- [out] fCoordX: Nodal coordinate X in GLOBAL.
- [out] fCoordY: Nodal coordinate Y in GLOBAL.
- [out] fCoordZ: Nodal coordinate Z in GLOBAL.
Return Values:
- 0: OK.
- -1: General error.
- -2001: Cannot find the node.
VBA Syntax:' Get coordinates of node #10.
Dim RetVal As VARIANT = OSGeometryUI.GetNodeIncidence(10, fCoordX, fCoordY, fCoordZ)
GetNodeIncidence_CIS2 #
This function returns the coordinates and unique string ID (GUID) of the specified node.
Parameters:
- [in] nNodeNo: Node number ID.
- [out] szName: Unique string ID (GUID).
- [out] fCoordX: Nodal coordinate X in GLOBAL.
- [out] fCoordY: Nodal coordinate Y in GLOBAL.
- [out] fCoordZ: Nodal coordinate Z in GLOBAL.
Return Values:
- 0: OK.
- -1: General error.
- -2001: Cannot find the node.
VBA Syntax:
' Get coordinates of node #10 and its unique ID.
Dim RetVal As VARIANT = OSGeometryUI.GetNodeIncidence_CIS2(10, szName, fCoordX, fCoordY, fCoordZ)
GetNodeList #
This function returns the list of all node number IDs in the current model.
Parameters:
- [out] nNodeList:
VARIANT
array of LONG type for storing returned node number IDs.
VBA Syntax:
' Get the list of all nodes.
OSGeometryUI.GetNodeList nNodeList
GetNodeNumber #
This function returns the number ID of the node at specified coordinates.
Parameters:
- [in] fCoordX: Nodal coordinate X in GLOBAL.
- [in] fCoordY: Nodal coordinate Y in GLOBAL.
- [in] fCoordZ: Nodal coordinate Z in GLOBAL.
Return Values:
- Node number ID.
- -1: Cannot find the node.
VBA Syntax:
' Get the node number for coordinates (3.0, 2.0, 3.0).
Dim nNodeNo As VARIANT = OSGeometryUI.GetNodeNumber(3.0, 2.0, 3.0)
GetNodeUniqueID #
This function returns the unique string ID (GUID) for the specified node.
Parameters:
- [in] nNodeNo: Node number ID.
Return Values:
- The unique string ID for the node.
- An empty string if the node is not found.
VBA Syntax:
' Get the unique ID of node #3.
Dim szName As VARIANT = OSGeometryUI.GetNodeUniqueID(3)
GetNoOfSelectedNodes #
This function returns the number of selected nodes.
Return Values:
- The number of selected nodes.
VBA Syntax:
' Get the total number of selected nodes.
Dim NoOfSelectedNodes As VARIANT = OSGeometryUI.GetNoOfSelectedNodes()
GetSelectedNodes #
This function returns a list of selected node number IDs.
Parameters:
- [out] naNodeNos: Returned selected node number IDs as a
VARIANT
array. - [in] nIsSorted: Selection order (1 for sorted, 0 for order of selection).
VBA Syntax:
' Get the selected nodes list in the order of selection.
OSGeometryUI.GetSelectedNodes naNodeNos, 0
IsOrphanNode #
This function checks if the specified node is an orphan node.
Parameters:
- [in] varNodeNo: Node number ID.
Return Values:
- 1: True (the node is an orphan node).
- 0: False (the node is not an orphan node).
VBA Syntax:
' Check if node #3 is an orphan node.
Dim RetVal As VARIANT = OSGeometryUI.IsOrphanNode(3)
MergeNodes #
This function merges multiple nodes into a single node. All members and elements connected to the nodes will be reconnected to the specified node.
Parameters:
- [in] varNodeNo: Node number ID to be assigned to the merged node.
- [in] nNodeIdArray: Array of node numbers to be merged (must contain more than one node).
Return Values:
- 1: Merging is successful.
- 0: Merging is unsuccessful.
VBA Syntax:
Option Explicit
Sub Main()
Dim objOpenSTAAD As Object
Dim varNodes(1) As Long
Dim nResult As Long
Set objOpenSTAAD = GetObject("StaadPro.OpenSTAAD")
varNodes(0) = 1
varNodes(1) = 4
nResult = objOpenSTAAD.Geometry.MergeNodes(1, varNodes)
If nResult > 0 Then
MsgBox "Merge node is successful"
Else
MsgBox "Merge node is unsuccessful"
End If
Set objOpenSTAAD = Nothing
End Sub
SelectMultipleNodes #
This function selects multiple nodes in the current model.
Parameters:
- [in] naNodeNos: Node number IDs as a
VARIANT
array.
VBA Syntax:
' Select multiple nodes.
OSGeometryUI.SelectMultipleNodes naNodeNos
SelectNode #
This function selects the specified node in the current model.
Parameters:
- [in] nNodeNo: Node number ID.
VBA Syntax:
' Select node #3.
OSGeometryUI.SelectNode 3
SetNodeCoordinate #
This function sets or replaces the coordinates of the specified node.
Parameters:
- [in] nNodeNo: Node number ID.
- [in] fCoordX: New coordinate X in GLOBAL.
- [in] fCoordY: New coordinate Y in GLOBAL.
- [in] fCoordZ: New coordinate Z in GLOBAL.
VBA Syntax:
' Change the coordinates of node #5 to (3.0, 2.0, 3.0).
OSGeometryUI.SetNodeCoordinate 5, 3.0, 2.0, 3.0
SetNodeUniqueID #
This function assigns a unique string ID (GUID) to the specified node.
Parameters:
- [in] nNodeNo: Node number ID.
- [in] szName: Unique string ID.
VBA Syntax:
' Set unique ID "NODESP" for node #3.
OSGeometryUI.SetNodeUniqueID 3, "NODESP"