Deleting Loads

A load is deleted from the model by calling the Delete method of the object that represents that load.  For example

‘Delete a node load
MyFrame.LoadCases(1).NodeLoads(2).Delete

’Delete a prescribed displacement
MyFrame.LoadCases(2).PrescribedDisps(1).Delete

’Delete an element load
MyFrame.LoadCases(1).ElementLoads(5).Delete

’Delete a thermal load
MyFrame.LoadCases(1).ThermalLoads(2).Delete

Groups of loads may also be deleted from a frame using the Delete method of the list objects associated with each of the different loading objects.  The following example uses the NodeLoadList object to delete all the loads attached to a particular node.

Dim myLoadList as New Multiframe.NodeLoadList
Dim myNode as Multiframe.Node
 
‘Delete all loads attached to node 6
Set myNode = MyFrame.Nodes(6)
Set myLoadList = myNode.Loads
myLoadList.Delete

In this code, the Loads properties of the Node object return lists of all the loads applied to node 6.  The code is this example is unnecessarily long and can be reduced to a single line as there is no real need to declare the NodeLoadList object.  An improved example that deletes all the loads applied to a specified node and element is as follows

‘Delete all loads attached to node 6
MyFrame.Nodes(6).Loads.Delete
MyFrame.Nodes(6).PreDisps.Delete

’Delete an loads applied to element 10
MyFrame.Elements(10).Loads.Delete
MyFrame.Elements(10).ThermalLoads.Delete

 

Note that loads will automatically be deleted from the frame when their parent node or element is deleted.