Cancel
Showing results for 
Search instead for 
Did you mean: 

Export Results Sets To CSV or MDB

Pioneer
Pioneer

I have a large FEM that has around 120 load cases in it. About a quarter of them are Nastran analysis results that are attached from *.op2 files, and the remaining three quarters are linear combinations created from the attached results. Unfortunately, the combined cases have now pushed my model up into the 90GB range.

 

I would like to export the results into discrete files for each load case so that I can reference them externally without bogging down Femap. I thought about using the API script "List Output to Excel", but I am fairly convident that this volume of data will cause Excel to crash.

 

Is there a way to export the combined cases into individual results files that can be attached as external references? Or perhaps someone may have already written a script written to export results to MS Access rather than Excel? (I am a novice when it comes to VBA).

 

Thank you for your help.

 

Thank you

7 REPLIES

Re: Export Results Sets To CSV or MDB

Siemens Phenom Siemens Phenom
Siemens Phenom

One thing you can do, is to never create all this internal data to begin with.  In FEMAP, we have Result Set Processing Data Surfaces.  When you create one of these, there are two options, one will create the data in the database, the other creates a virtual results set can be the linear combination you're looking for -

 

Output_Combo1.jpg

 

You can then create as many linear combination results sets as you want.  No data is ever created, it's all calculated on-the-fly as needed.  Everything works just like internalized data without dragging all that data around -

 

Output_Combo2.jpg

Output_Combo3.jpg

 

Mark.

Re: Export Results Sets To CSV or MDB

Siemens Phenom Siemens Phenom
Siemens Phenom

Also thought of this, since you already have the data all internalized, this API will kick out a FEMAP Binary Results file for each output set, and then attach to it.  FEMAP FNOs (FEMAP Neutral Output) are organized exactly like our internal database, it's the absolutely fastest way to access results data.  

 

This API will create one file for each output set, with the output set ID appended to the name, and attached to it.  Please verify all your data made it across as you expect, and then you can delete all the original data.  Let me know if all is working well, and we'll look at including this as a standard API we ship with FEMAP -

 

The HTML Clipboard

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

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

    Dim fno_Name As String

    rc = ouSets.Select( FT_OUT_CASE, True, "Select Output Sets to Export and then Attach" )

    Dim ouSetID As Long

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


    If ouSets.Count > 0 Then
            ouSetID = ouSets.First
            While ouSetID > 0
                fno_Name = "OutputSet_"+Str$(ouSetID)+".fno"
                tempSet.Clear
                tempSet.Add( ouSetID )
                rc = App.feFileWriteFNO( tempSet.ID, 0, 0, fno_Name )
                App.feFileAttachResults( FAP_NE_NASTRAN, fno_Name, False )
                ouSetID = ouSets.Next
            Wend
    End If

End Sub

Re: Export Results Sets To CSV or MDB

Pioneer
Pioneer

Thanks, Mark! Those are both solutions that I think I can work with. I'll try out the script and let you know how it works. At first glance, it seems to be a better solution for me than the "on the fly" calculation solution just because I will still have to do some enveloping of results across these linear combination cases. I would imagine that having to calculate each case on the fly and then envelope would be significantly more taxing on the Femap than storing the results and enveloping from there.

Re: Export Results Sets To CSV or MDB

Pioneer
Pioneer

The script worked! Thanks so much, Mark!

 

Not to push my luck, but how difficult would it be to modify the script to export results only for specific elements or groups? Also, is *.fno the only file type that Femap can produce on its own? One of the other challenges I'm facing is that my team took an unorthodox approach and created one large master FEM for use by multiple teams rather than having each team create their own FEMs and then just exchange superelements and interface loads. Because of this, if I could parsing the results sets into files by sub-structure would further aid in data transfer.

Re: Export Results Sets To CSV or MDB

Pioneer
Pioneer

Hi Mark, I've  I have a new model that I am using the technique you mentioned earlier for creating "As Needed" load cases. I am trying to write out the *.FNOs with the script you gave me, but I am having some difficulty. Does the feFileWriteFNO method work with "As Needed" results sets or must they be internalized before I can use it?

 

 

Re: Export Results Sets To CSV or MDB

Siemens Phenom Siemens Phenom
Siemens Phenom

The feFileWriteFNO method should work even if Results are created as needed.  If you could create a sample model that duplicates the issue we can take a look at it.

In a previous post, you mentioned limiting to groups.  I've modified Mark's original script with that included:

 

Groups.png

 


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

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

    Dim fno_Name As String

    If App.feSelectOutputSets("Select Output Sets to Export and then Attach",ouSets) <> FE_OK Then End

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

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

    Again:
    If gSet.Select(FT_GROUP,True,"Select Groups") <> FE_OK Then
        rc = MsgBox "Continue with All Elements?", vbYesNoCancel,"Groups"
        If rc = 2 Then End
        If rc = 7 Then
            GoTo Again:
        End If
        gSet.ID = 0
    End If

    While ouSets.Next
        fno_Name = "OutputSet_"+Str$( ouSets.CurrentID )+".fno"
        tempSet.Clear
        tempSet.Add( ouSets.CurrentID )
        rc = App.feFileWriteFNO( tempSet.ID, 0, gSet.ID, fno_Name )
        App.feFileAttachResults( FAP_NE_NASTRAN, fno_Name, False )
    Wend

End Sub

Re: Export Results Sets To CSV or MDB

Pioneer
Pioneer

I've noticed that the neutral output files do not have certain vectors written to them. In particular, Femap seems to keep omitting post-processed results vectors (e.g. principal stress, von Mises, etc.). Is this an issue with the function or am I doing something wrong?