Many methods in the Multiframe automation interface have parameters that are of variant data type. In many cases these parameters are often used to pass arrays of values such as an array of six boolean values representing the restrained degrees of freedom at a node. In other cases they allow an object or a list of objects to be identified in many different ways. A variant parameter identifying a single object will accept the integer index of the item or the actual object. A common example is a variant parameter representing a node. This parameter will accept an integer value of the nodes index or a Node object. For example, the first parameter of the AddSpring method is a variant specifying the node to which the spring is attached. This could be coded as
Dim mySpring as Multiframe.Spring
…
’Add spring to node 5 (by Index)
Set mySpring = myFrame.Spring.AddSpring(5,mfDOFx,12.5)
or
Dim mySpring as Multiframe.Spring
Dim myNode as Multiframe.Node
…
’Add spring to node 5 (by Object)
Set myNode = myFrame.Nodes(5)
Set mySpring = myFrame.Spring.AddSpring(myNode,mfDOFx,12.5)
A variant parameter representing a list of items will accept many different data types that identify the list of objects. This may be a single integer index, an object, a list object or even a collection of objects. A string containing a comma-delimited list of indices is also valid and may include ranges specified with a dash (e.g. “1,2,5-7”). For example, when a list of nodes is to be passed to a method, the variant parameter will accept a single integer index, a Node object, a NodeList object, a Nodes collections, an array of integer values of the nodes indices, or a string with a comma delimited list of nodes. For example, the Loads method of the Nodes object returns all the nodal force loads applied to the node. The Loads method has a single variant parameter specifying which load cases are to be considered. The following code demonstrates the many different parameters that may be passed to this function.
Dim myLoads as Multiframe.NodeLoadList
Dim myLCs as New Multiframe.LoadCaseList
…
’Get all node loads on node 3 applied in the first load case
Set myLoads = myFrame.Nodes(3).Loads(1)
’Get all node loads on node 3 applied in the third load case
Set myLoads = myFrame.Nodes(3).Loads(myFrame.LoadCases(3))
’Get all node loads on node 3 in load cases 5 and 6 (using array)
Set myLoads =
myFrame.Nodes(3).Loads(Array(5,6))
’Get all node loads on node 3 in load cases 5 and 6 (using list)
MyLCs.Add 5
MyLCs.Add 6
Set myLoads = myFrame.Nodes(3).Loads(MyLCs)
’Get all node loads on node 3 in any load case
Set myLoads = myFrame.Nodes(3).Loads(myFrame.LoadCases)