Use the method app.feElem.GetNodeList ( listINDEX, nodecount, node, face, weight, dof ).
Sample code below to list out the DOFs for Dependent/Independent Nodes on a Rigid Element:
The HTML Clipboard
Sub Main Dim App As femap.model Set App = feFemap() Dim rc As femap.zReturnCode Dim el As femap.Elem Set el = App.feElem Dim elID As Long Dim nc As Long Dim nodeIDs As Variant Dim nodeID As Long Dim faceIDs As Variant Dim wgts As Variant Dim DOFs As Variant Dim msgString As String SelectRigidElement: rc = App.feSet.SelectID ( FT_ELEM, "Select Rigid Element", elID ) If rc <> FE_OK Then End End If el.Get ( elID ) If el.type <> 29 Then GoTo SelectRigidElement el.Put ( elID ) End If el.GetNodeList ( 0, nc, nodeIDs, faceIDs, wgts, DOFs ) el.Put ( elID ) App.feAppMessage ( FCM_HIGHLIGHT, _ ("For Rigid Element ID" + Str$(nodeIDs(0)) + ":") ) For i = 1 To nc-1 nID = nodeIDs(i) msgString = " Node" + Str$(nodeIDs(i)) + " DOFs =" For dof = 0 To 5 msgString = msgString + Str$(DOFs((i*6)+dof)) Next dof App.feAppMessage ( FCM_HIGHLIGHT, msgString ) Next i End Sub
Thanks Chip for the quick reply and sample code.
However, this accesses and lists the DOFs for the independent nodes of a RBE3. I have no issue with this part, and used the inverse (.PutNodeList) to generate the RBE3 in the first place.
I am looking for a way to assign the UM DOF. See below.
The API does not have a method for assigning UM DOFs for RBE3 elements.
A workaround would be to embed a Program File into your API where you first generate the RBE3, prompt for the UM Nodes and DOFS, then use these to generate a Program File. You could also just edit the created RBE3 to start a Program File that prompts for the UM Nodes.
Ah ok understood.
To the powers that be - might be worth adding that note to the documentation somewhere, so others don't spend a pile of time digging around for it.
Thanks again for the replies!
Are they RBE2s or RBE3s?
You can try this:
The HTML Clipboard
Sub Main Dim App As femap.model Set App = feFemap() Dim rElem As femap.Elem Set rElem = App.feElem Dim eSet As femap.Set Set eSet = App.feSet Dim eID As Long Dim nc As Long Dim nodeIDs As Variant Dim nodeID As Long Dim faceIDs As Variant Dim wgts As Variant Dim DOFs As Variant Dim newDOFs(10000) As Variant eSet.AddRule(29, FGD_ELEM_BYTYPE) While eSet.Next eID = eSet.CurrentID rElem.Get(eID) '''For RBE3s''' rElem.GetNodeList ( 0, nc, nodeIDs, faceIDs, wgts, DOFs ) For i = 0 To nc - 1 j = 6*i newDOFs(j) = 1 newDOFs(j+1) = 1 newDOFs(j+2) = 1 newDOFs(j+3) = 0 newDOFs(j+4) = 0 newDOFs(j+5) = 0 Next rElem.PutNodeList( 0, nc, nodeIDs, faceIDs, wgts, newDOFs) '''For RBE2s''' rElem.release(0, 0) = 1 rElem.release(0, 1) = 1 rElem.release(0, 2) = 1 rElem.release(0, 3) = 0 rElem.release(0, 4) = 0 rElem.release(0, 5) = 0 rElem.Put(eID) Wend End Sub
How to update the master node to 123456 instead of 123 from the code
Because the API updates only the dependent nodes for both Rbe2 and Rbe3 .
is that we can control the DOF for independent node for both Rbe2 and Rbe3..?