Problem:
I have a complex region that I want to blank out and the Value Blanking menu doesn’t give me enough control over which parts of the plot I want to blank out.
Solution:
To solve this we will use the Pick & Change add-on. This add-on is not loaded by default so you must first load the add-on to use it.
Use the following steps to Blank out a region using the Pick & Change add-on:
- In your tecplot.add file (located in the installation directory), add the line: $!LOADADDON “tecutiltools_pickalter”
- Start Tecplot 360 and load your data.
- Create a new variable which will be used for Value Blanking. Here we will enter “{blank} = 0”. This will create a variable called blank which will be 0 to indicate values that should not be blanked.
- Activate Value Blanking (Plot->Blanking->Value Blanking). Set the blanking constraint to blank data when blank ==1.
- Launch Pick & Change from Data->Pick & Change.
- Orient your view to easily select the region of interest. Consider using the XY, YZ, or XZ axis views from the Plot Sidebar.
- Draw a rectangle or other geometry to select the region you would like to remove.
- Adjust the variable to be changed to “blank” and the modifier to “=1” and then press “Apply Alteration”
- You should now see only the area of your model that is outside of the rectangle drawn.
The above steps can be recreated in a PyTecplot script as well:
import tecplot as tp
tp.session.connect()
for t in tp.active_frame().dataset.solution_times:
tp.active_frame().plot().solution_time = t
tp.macro.execute_command("""$!AddOnCommand
AddOnID = 'Pick and Change'
Command = 'PICKRECTANGLE ANCHORX=-0.0449837 ANCHORY=-0.0611948 SIZEX=0.0921742 SIZEY=0.150568'""")
tp.macro.execute_command("""$!AddOnCommand
AddOnID = 'Pick and Change'
Command = 'ALTERAREA VARIABLE=\"blank\" MODIFIER=\"1\" RULE=ALLINSIDE'""")