cancel
Showing results for 
Search instead for 
Did you mean: 

FEMAP plots and source op2

Pioneer
Pioneer

Hi

Is it possible in FEMAP to display on the plot, the source op2 file which was used to generate the plot?

I notice that this information is available in the Model Info - Results - Analysis Study  information window. It is just a matter of presenting this on the screen for traceability once the plots is embedded in a report.

I am using FEMAP 11.2.0

Thanks

Peter

4 REPLIES

Re: FEMAP plots and source op2

Siemens Phenom Siemens Phenom
Siemens Phenom

Give this a try:

 

The HTML Clipboard

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

   Dim n As femap.Node
   Set n = App.feNode()

    Dim oSet As femap.OutputSet
    Set oSet = App.feOutputSet

    Dim rc As femap.zReturnCode

    Dim note As String
    Dim test As String
    Dim ModelName As String
    Dim ID As Long

    Dim xyz(8) As Double
   Dim t(2) As String

    ' The ID of the output set to put op2 text on screen
    oSet.SelectID("Select Output To Display .op2 Name")
    'oSet.Get(2)

    note = oSet.notes
    App.feAppMessage(FCM_NORMAL,test)

    i = Mid(note,InStrRev(note,"\")+1,)
    j = Mid(note,InStrRev(note,"Date"),)
    op2FileName = Left(i,Len(i)-Len(j)-2)

   n.Get(1)
   xyz(0) = n.x
   xyz(1) = n.y
   xyz(2) = n.z

   n.Get(2)
   xyz(3) = n.x
   xyz(4) = n.y
   xyz(5) = n.z

   n.Get(3)
   xyz(6) = n.x
   xyz(7) = n.y
   xyz(8) = n.z

   t(0) = op2FileName
   't(1) = ""
   't(2) = ""

    Boarder = False
    TextColor = FCL_WHITE

    rc  =  App.feTextMultiPut ( False, Boarder, False, 1, 2, -1, 1, 2, FCL_WHITE,FCL_WHITE, TextColor, 1, xyz, xyz,  t)
End Sub

Re: FEMAP plots and source op2

Pioneer
Pioneer

Thanks, however it doesn't place anything on the screen.

I am new to FEMAP API, but I understand the VBA. You definitely recover the op2 name, but I don't understand why it doesn't put it to the screen.

 

Is it possible to modify the "legend" so an extra line gets added to it?

Thanks

Re: FEMAP plots and source op2

Siemens Phenom Siemens Phenom
Siemens Phenom

You cannot add text to the legend, but I've modified the API to hopefully do what you want.  This should create a fixed text box above the legend.  You can play with the screen location where I have it set to 90, and 1 for the top right corner.  This is a % of the screen size so rescalling the window will shift your text box, but every view will be identical.

 

The HTML Clipboard

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

    Dim oSet As femap.OutputSet, txt As femap.text, nVar As femap.Var
    Set oSet = App.feOutputSet
    Set txt = App.feText
    Set nVar = App.feVar

    ' The ID of the output set to put op2 text on screen
    rc = oSet.Get(oSet.Active)
    If rc = 0 Then
        rc = oSet.Get(1)
    End If

    note = oSet.notes

    i = Mid(note,InStrRev(note,"\")+1,)
    j = Mid(note,InStrRev(note,"Date"),)
    op2FileName = Left(i,Len(i)-Len(j)-2)

    With txt
        .ModelPosition = False : .AllViews = True : .DrawPointer = False
        .DrawBorder = True : .BackColor = 149 : .layer = 1
    End With

            txt.TextPosition(0) = 90
            txt.TextPosition(1) = 1
            txt.text = op2FileName
            txt.Put(999999)

App.feViewRegenerate ( 0 )
End Sub

Re: FEMAP plots and source op2

Pioneer
Pioneer

Perfect. Thank you very much. It worked perfectly.

I assume the way to remove the textbox is to assign op2FileName to a blank string i.e. txt.text =""