Cancel
Showing results for 
Search instead for 
Did you mean: 

Re: #Request# Code for meshing beams in API

Pioneer
Pioneer

Dear Yarko,

 

Can you check what's wrong with this piece of code?  I tried to define the element release with 6 dofs, but used it in the wrong way, syntax error probably.

 

 

            App.feModifyElemRelease(elem.ID,New Boolean[5(False;False;False;True;True;True),New Boolean[5(False;False;False;False;False;False) )

 

SIncerely,

Zhengyu

Re: #Request# Code for meshing beams in API

Pioneer
Pioneer

 

Hi Yarko

 

I made it with splitting the one line code into two lines.

 

Dim c As Boolean() = {Tx, Ty, Tz, Rx, Ry, Rz}
App.feModifyElemRelease(elem.ID, c, False)

 

Best,

Zhengyu

Re: #Request# Code for meshing beams in API

Pioneer
Pioneer

Good morning, Yarko,

 

I used the following command to add nodal constraint and it worked.

 

constraintNode.Add(nodeSet.ID,Tx,Ty,Tz,0,0,0)

 

Here the most important part it to define the  nodeSet..

I'd like to enquire if you have any method to get the node in Femap corresponding to the points in Grasshopper?

 

Best,

Zhengyu

Re: #Request# Code for meshing beams in API

Legend
Legend

Dear Zhengyu,

 

 

I didn't find any ready api function for this. My suggestion is to go through all nodes and check point coordinates with node coords. To make this routine quick I read all nodes using node.GetCoordArray:

 

In my example I'm looking node for one point with coords (10, 0, 0) but you can expand this to more points

 

 Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Dim App As femap.model
        App = GetObject(, "femap.model")

        Dim ids() As Integer
        Dim xyz() As Double

        'get all nodes using one transaction (good performance)
        GetNodes(App, ids, xyz)

        Dim pointCoordinate() As Double = {10.0, 0.0, 0.0}

        'loop through all nodes and check their coords
        Dim nodeId As Integer = 0
        For i As Integer = 0 To ids.Length - 1
            If (xyz(i * 3) = pointCoordinate(0) And
                xyz(i * 3 + 1) = pointCoordinate(1) And
                xyz(i * 3 + 2) = pointCoordinate(2)) Then
                nodeId = ids(i)
                Exit For
            End If
        Next

        'show node id if found
        If (nodeId <> 0) Then
            App.feAppMessage(femap.zMessageColor.FCM_NORMAL, "Node ID = " & nodeId)
        Else
            App.feAppMessage(femap.zMessageColor.FCM_ERROR, "Node not found")
        End If

    End Sub

    Public Overridable Function GetNodes(ByVal App As femap.model, ByRef ids() As Integer, ByRef xyz() As Double) As Boolean

        Try
            Dim Count As Integer
            Dim Node As femap.Node = App.feNode
            ids = Nothing
            xyz = Nothing
            Node.GetCoordArray(0, Count, ids, xyz)
            If ids Is Nothing Then
                ids = New Integer() {}
                xyz = New Double() {}
            End If

        Catch ex As Exception
            ids = New Integer() {}
            xyz = New Double() {}
            Return False
        End Try
        Return True
    End Function

 

 

 

Yarko

Re: #Request# Code for meshing beams in API

Pioneer
Pioneer

Thank you Yarko,

 

I have found another way to reach my goal without defining node according to points in Grasshopper..

 There is one last step towards my parametric design. I am looking for the command to add bolt connection in Femap(Connect - Bolt Connection). I searched the book API 11.2 but found nothing.. 

 

something I've found are

 

Dim reg As femap.ConnectionRegion = App.feConnectionRegion

CreateBoltRegion()          (Visual studio says this command is a type and cannot be used as an expression )

reg.AddContact()

 

I tried the following code but nothing happened.

 

Dim reg As femap.ConnectionRegion = App.feConnectionRegion
reg.AddContact(zConnectionRegionType.FRT_BOLT, Elem.ID, 1)

 

 

Expect your help.

Best ,Zhengyu

Re: #Request# Code for meshing beams in API

Legend
Legend

Dear Zhengyu,

 

 

I don't have ready function for creating bolts. Haven't worked with them much. 

I will check in the evening Api manual.

 

Yarko

Re: #Request# Code for meshing beams in API

Phenom
Phenom

A bolt connection region is a type of region used to apply a pre-load to a bolt cross-section.  The bolt itself must either be a beam element (typically a circular section), or a solid mesh where a cross-section of the solid mesh can be defined as a region to apply the preload.

A common approach for bolts would be to have two parallel washer areas with a rigid element covering each washer area, and then a beam element is used to connect between the centre (independent) nodes of the two rigid elements.  Then if you want to also include preload in the bolts (usually only relevant if you include contact at the bolted joint interface), you would then also use a bolt connection region attached to the beam element(s) as the means to apply the bolt pre-load.

The bolt connection region cannot be used without being applied to existing beam or solid element mesh.

I recommend you first create a bolt interface model (using beam and rigid elements) manually to help guide what you will need in any API approach.

 

Note there is already a Custom Tools -> Meshing -> Hole-to-Hole Fastener which is an existing API to connect rigid elements and a beam element bolt between two circular edges (holes).  This API could be modified to connect betwen "washer" surfaces rather than just edges - depending what is appropriate for your engineering.

Re: #Request# Code for meshing beams in API

Pioneer
Pioneer

Dear EndZ,

 

Thank you for making it clear how a bolt connection works. Indeed I apply them to beam elements to apply preload. However, I am making the model parametrically, thusmaking  the work automatically (or computationally) as much as possible is my goal.

 

Kind regars,

Zhengyu

Re: #Request# Code for meshing beams in API

Pioneer
Pioneer

Dear EndZ,

 

I want to ask how to apply prestress to cable system in Femap..

If I choose rod element, it seems impossible to apply bolt connection. 

If I apply beam/bar element, then bending moment occurs ..

 

Sincerely.,

Zhengyu

Re: #Request# Code for meshing beams in API

Phenom
Phenom

If it's a true cable system (very long and slender members) I would probably still use beam elements and use pin releases at each end to switch off the moment connection at each end (pin releases 5 and 6) of a cable section (ie. member between two other connection points).  If one cable section = one beam, then the pin releases would be applied to each beam element which is used as a cable.  If you want to make sure torsion is switched off, you would also apply pin release 4 at one end of a cable section.  If you apply pin release 4 to both ends, then you will get a singularity error (USER FATAL 9137) in linear analysis, and excessive long run times in non-linear.  Similarly, depending on the physical arrangement of your cable members, some care must be taken in applying the 5,6 pin releases everywhere, as this may also create mechanisms which produce singularities (linear) and extreme runtimes (non-linear).  If your cables are simply a few stays on some mast or stable structure, then you probably won't have to worry about releases 5 and 6 producing mechanisms.  But if you were modelling a suspension bridge, then you would have to be much more careful about the possibility of creating mechansims from pin releases..

And it is worth mentioning that if you are using the standard NX Nastran BOLTLD preload, then this cannot be used in SOL106 non-linear anyway.  If your engineering requires non-linear analysis (eg. anything with catenary self-weight effects), then it gets more complicated, and your preload might have to be applied using the pre-load capability of a gap element.

Finally, if you did not want to bother with pin releases, but still want to use pre-load easily, AND if only the tension matters for the cables (as one might expect), then you could fudge  reduced I1, I2 and J values on the beam property to reduce the bending & torsion stiffness of the elements without changing the tension stiffness.  If the results produce a negligible bending moment in a long cable, then the engineering consequence = zero.  Judgement is required.  But don't make the I1, I2, J values too low (eg. don't change 1e3 to 1e-6), as you will get singularity errors if, mathematically, the stiffness matrix has numbers where the outcome is close to being a mechanism (eg. some of the mesh can "float", unstrained.).  If using this method, best practice is to use the largest values of (reduced) I1 and I2 where the cable bending moments can be ignored.