Proper pyfemap commands and sequence to re-orient model and take a pic (repeat x-number of times)

Creator
Creator

Hello,

 

I have a VB script that captures the active view of a model to include modifying the Contour, FVI_Criteria_Pass, FVI_Criteria_limits, CriteriaMax/Min, etc.  Once updated, I perform a feFilePictureSave2.  From there I perform the following series of steps three times:  rotate --> autoscale --> take a pic.  Four pics in total.

 

In my current python script, I'm able to successfully capture the first picture (i.e., contour updates), but not successful in capturing subsequent pics.

 

My question is what are the proper pyfemap commands and sequence to capture the next set of pics after a change in orientation.  The 1:1 mapping of VB commands to python does not work.


fview.Contour = 2 #turn on criteria
fview.SetLabel(constants.FVI_CRITERIA_PASS,0)
fview.CriteriaMax=1.1
fview.CriteriaMin=0.5
fview.SetLabel(constants.FVI_CRITERIA_LIMITS,3)
fview.Put(viewID)
app.feViewRegenerate(viewID) #'refresh the display
fview.OutputSet = outSetID #select to display data from output set 1
fview.ContourData = outVecID
fview.AutoscaleAll(True)
fview.SetDraw(constants.FVI_NODE,False)
fview.Put(viewID)# 'write the view object data to Femap
app.feViewRegenerate(viewID) #'refresh the display

fview = app.feView
[rc, viewID] = app.feAppGetActiveView()
app.feFilePictureSave2(False,0,12,rpt_path+'\\Zpic_1_xy_'+strnum+'.png') #success


# Here's the transition from pic1 to pic 2. Commenting statements on/off to find right combo

#fview = app.feView
[rc, viewID] = app.feAppGetActiveView()

fview.OutputSet = outSetID #select to display data from output set 1
fview.ContourData = outVecID
fview.Rotate(0,0,0,1,0,0,-90)
fview.Rotate(0,0,0,0,1,0,90)
fview.AutoscaleAll(True)
fview.Put(viewID) #write the view object data to Femap
app.feViewRegenerate(viewID) #refresh the display

 

fview = app.feView
[rc, viewID] = app.feAppGetActiveView()
app.feFilePictureSave2(False,0,12,rpt_path+'\\Zpic_1_xy_'+strnum+'.png') # Pic 2 was not a success

 

Thank you

1 REPLY 1
Highlighted

Re: Proper pyfemap commands and sequence to re-orient model and take a pic (repeat x-number of times

Creator
Creator

Found the answer after stepping away from my desk. 

 

#model orientation

fview.Put(viewID) #write the view object data to Femap
app.feViewRegenerate(viewID) #refresh the display

app.feFilePictureSave2(False,0,12,rpt_path+'\\Zpic_2_xz_'+strnum+'.png') # pic 1

 

#start of pic 2

 

fview = app.feView
[rc, viewID] = app.feAppGetActiveView()
fview.Get(viewID)

#  Perform model orientation or what not

fview.Put(viewID) #write the view object data to Femap
app.feViewRegenerate(viewID) #refresh the display

app.feFilePictureSave2(False,0,12,rpt_path+'\\Zpic_2_xz_'+strnum+'.png') # pic 1

 

#repeat