Cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted

FEMAP V11.4: API Solid Centerline Finder

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom

Hello!,

Very good the new feSolidExtractCenterlines API call exclusive of FEMAP V11.4: it generates not only 1-D geometry centerline & arcs automatically extracted from 3-D solids, but also compute & assign attributes to the newly created geometry of type beam cross section properties, so the end user simply needs to apply mesh density in centerline & arcs using commands MESH > MESH CONTROL > SIZE ALONG CURVE and mesh them using command MESH > GEOMETRY > CURVE.

  • For 3-D solids filled tubes the API creates shape CIRCULAR BAR CBEAM property.
  • For 3-D solids hollow tubes the API creates shape CIRCULAR TUBE CBEAM property.
  • For any 3-D solid arbitrary extruded cross section the API creates a General Section CBEAM property.

api-solid-centerline-finder-animated.gif

TUBO.png

For 3-D solids with un-symmetric cross sections the 1-D lines/arcs are created at neutral axis of cross section as well and the CBEAM GENERAL SECTION property is assigned to each curve, including reference point and orientation so they are fully ready to be meshed, quickly & fast!!

api-cross-section-no-circular-animated.gif

Here you are the API code, thanks to Mark Sherman!!

Sub Main
    Dim App As femap.model
    Set App = feFemap()

    Dim soSet As femap.Set
    Set soSet = App.feSet

soSet.Select( FT_SOLID, True, "Pick SOLID")

    App.feSolidExtractCenterlines( soSet.ID, -1,  False )
    
End Sub

Best regards,
Blas.

Blas Molero Hidalgo, Ingeniero Industrial, Director
IBERISA • 48004 BILBAO (SPAIN)
WEB: http://www.iberisa.com
Blog Femap-NX Nastran: http://iberisa.wordpress.com/
6 REPLIES 6

Re: FEMAP V11.4: API Solid Centerline Finder

Pioneer
Pioneer

This is really useful, thanks. When I try to run it on a lot of solids (thousands) it wants me to first create a material, which is fine, but then it wants me to select the material for each and every solid. Is there any way to automatically select a single material for all solids?

 

Later: So having read the manual: 

First create material number 1, then change the -1 in command to 1 and away you go, no more prompting for a new material for each solid...

App.feSolidExtractCenterlines( soSet.ID, -1, False )

Re: FEMAP V11.4: API Solid Centerline Finder

Pioneer
Pioneer

For some reason some of my solids (channel shape) don't convert. There is no warning or error given - just the following message:
1 Solid(s) Selected...

No line or property is created..

Any suggestions on why some solids don't convert?

Re: FEMAP V11.4: API Solid Centerline Finder

Siemens Phenom Siemens Phenom
Siemens Phenom

If you send me your .modfem file, we will take a look at it.

 

sherman dot mark at siemens dot com

 

Mark.

Re: FEMAP V11.4: API Solid Centerline Finder

Pioneer
Pioneer
Thanks Mark, I've emailed you a sample file...
Regards, Steve

Re: FEMAP V11.4: API Solid Centerline Finder

Siemens Phenom Siemens Phenom
Siemens Phenom

Received a FEMAP model file regarding this issue, turns out the solids were not solid, they were "sheet bodies", i.e. where all the surfaces are not closed, made a video of how to determine this

 

(view in My Videos)

 

and wrote this API to "cap" open solids to make them completely closed -

 

The HTML Clipboard

Dim App As femap.model
Dim connSet As femap.Set
Dim cuSet2 As femap.Set

Sub Main

    Set App = feFemap()

    Set connSet = App.feSet

    Dim feSolid As femap.Solid
    Set feSolid = App.feSolid

    Dim suSet As femap.Set
    Set suSet = App.feSet

    Dim cuSet As femap.Set
    Set cuSet = App.feSet

    Dim feSurf As femap.Surface
    Set feSurf = App.feSurface

    Dim suID As Long


    Set cuSet2 = App.feSet


    Dim suSet2 As femap.Set
    Set suSet2 = App.feSet

    Dim tempSet As femap.Set
    Set tempSet = App.feSet

    Dim cuID As Long

    Dim feTrack As femap.TrackData
    Set feTrack = App.feTrackData

    Dim boSet As femap.Set
    Set boSet = App.feSet

    While feSolid.Next
        If feSolid.IsSheet() Then

            feTrack.Clear
            feTrack.StartGeometry()
            suSet.Clear
            suSet.AddRule( feSolid.ID, FGD_SURFACE_ONSOLID )
            If suSet.Count > 1 Then
                cuSet.Clear
                cuSet.AddRule( feSolid.ID, FGD_CURVE_ONSOLID )

                cuID = cuSet.First
                While cuID > 0
                    suSet2.Clear
                    suSet2.AddRule( cuID, FGD_SURFACE_BYCURVE )

                    If suSet2.Count = 1 Then
                        cuSet2.Add( cuID )
                    End If

                    cuID = cuSet.Next
                Wend

                While cuSet2.Count > 0
                    cuID = cuSet2.First
                    connSet.Clear
                    BuildConnectedCurveSet( cuID )
                    connSet.Show( FT_CURVE )
                    cuSet2.RemoveSet( connSet.ID )

                    App.feBoundaryFromCurves( connSet.ID )

                Wend
                feTrack.StopAll
                feTrack.Created( FT_BOUNDARY, boSet.ID, True )
                suSet.Show( FT_SURFACE )
                suSet.Debug()
                boSet.Show( FT_BOUNDARY)
                boSet.Debug()
                suSet.AddSet( boSet.ID )
                App.feSolidStitch( suSet.ID, 0.01 )
            End If
        End If
    Wend
End Sub

Sub BuildConnectedCurveSet( cuID As Long )
    Dim bAdded As Boolean
    Dim ptSet As femap.Set
    Set ptSet = App.feSet
    Dim cuID2 As Long

    Dim cuSet3 As femap.Set
    Set cuSet3 = App.feSet

    bAdded = True
    connSet.Add( cuID )
    While bAdded
        bAdded = False
        cuSet3.Clear
        ptSet.AddSetRule( connSet.ID, FGD_POINT_ONCURVE )
        cuSet3.AddSetRule( ptSet.ID, FGD_CURVE_BYPOINT )

        cuID2 = cuSet3.First
        While cuID2 > 0
            If cuSet2.IsAdded( cuID2 ) Then
                If Not connSet.IsAdded( cuID2 ) Then
                    connSet.Add( cuID2 )
                    bAdded = True
                End If
            End If
            cuID2 = cuSet3.Next
        Wend



    Wend

End Sub

Re: FEMAP V11.4: API Solid Centerline Finder

Siemens Phenom Siemens Phenom
Siemens Phenom

I was asked to update the API to prompt for solids to process instead of doing them all - updated API -

 

The HTML Clipboard

Dim App As femap.model
Dim connSet As femap.Set
Dim cuSet2 As femap.Set

Sub Main

    Set App = feFemap()

    Set connSet = App.feSet

    Dim feSolid As femap.Solid
    Set feSolid = App.feSolid

    Dim suSet As femap.Set
    Set suSet = App.feSet

    Dim cuSet As femap.Set
    Set cuSet = App.feSet

    Dim feSurf As femap.Surface
    Set feSurf = App.feSurface

    Dim suID As Long


    Set cuSet2 = App.feSet


    Dim suSet2 As femap.Set
    Set suSet2 = App.feSet

    Dim tempSet As femap.Set
    Set tempSet = App.feSet

    Dim cuID As Long

    Dim feTrack As femap.TrackData
    Set feTrack = App.feTrackData

    Dim boSet As femap.Set
    Set boSet = App.feSet

    Dim soSet As femap.Set
    Set soSet = App.feSet

    If soSet.Select( FT_SOLID, True, "Pick Solid(s) to Process" ) = FE_OK Then
        While feSolid.NextInSet( soSet.ID ) = FE_OK
            If feSolid.IsSheet() Then

                feTrack.Clear
                feTrack.StartGeometry()
                suSet.Clear
                suSet.AddRule( feSolid.ID, FGD_SURFACE_ONSOLID )
                If suSet.Count > 1 Then
                    cuSet.Clear
                    cuSet.AddRule( feSolid.ID, FGD_CURVE_ONSOLID )

                    cuID = cuSet.First
                    While cuID > 0
                        suSet2.Clear
                        suSet2.AddRule( cuID, FGD_SURFACE_BYCURVE )

                        If suSet2.Count = 1 Then
                            cuSet2.Add( cuID )
                        End If

                        cuID = cuSet.Next
                    Wend

                    While cuSet2.Count > 0
                        cuID = cuSet2.First
                        connSet.Clear
                        BuildConnectedCurveSet( cuID )
                        connSet.Show( FT_CURVE )
                        cuSet2.RemoveSet( connSet.ID )

                        App.feBoundaryFromCurves( connSet.ID )

                    Wend
                    feTrack.StopAll
                    feTrack.Created( FT_BOUNDARY, boSet.ID, True )
                    suSet.Show( FT_SURFACE )
                    suSet.Debug()
                    boSet.Show( FT_BOUNDARY)
                    boSet.Debug()
                    suSet.AddSet( boSet.ID )
                    App.feSolidStitch( suSet.ID, 0.01 )
                End If
            End If
        Wend
    End If
End Sub

Sub BuildConnectedCurveSet( cuID As Long )
    Dim bAdded As Boolean
    Dim ptSet As femap.Set
    Set ptSet = App.feSet
    Dim cuID2 As Long

    Dim cuSet3 As femap.Set
    Set cuSet3 = App.feSet

    bAdded = True
    connSet.Add( cuID )
    While bAdded
        bAdded = False
        cuSet3.Clear
        ptSet.AddSetRule( connSet.ID, FGD_POINT_ONCURVE )
        cuSet3.AddSetRule( ptSet.ID, FGD_CURVE_BYPOINT )

        cuID2 = cuSet3.First
        While cuID2 > 0
            If cuSet2.IsAdded( cuID2 ) Then
                If Not connSet.IsAdded( cuID2 ) Then
                    connSet.Add( cuID2 )
                    bAdded = True
                End If
            End If
            cuID2 = cuSet3.Next
        Wend
    Wend
End Sub