Create Cut Planes presentation on a field of the imported MED file:
import os import salome import VISU import visu_gui # The directory containing MED files datadir = os.getenv("DATA_DIR") # Get VISU engine myVisu = visu_gui.myVisu # Import a MED file medFile = os.path.join(datadir,"MedFiles","fra.med") myResult = myVisu.ImportFile(medFile) # Create cut planes for the first timestamp of 'VITESSE' field meshName = 'LE VOLUME' fieldEntity = VISU.NODE fieldName = 'VITESSE' myCutPlanes = myVisu.CutPlanesOnField(myResult, meshName, fieldEntity, fieldName, 1) # Set the number of planes myCutPlanes.SetNbPlanes(15) # Set the planes orientation (parallel to XY), set rotation around Y to 0.5 radian myCutPlanes.SetOrientation(VISU.CutPlanes.XY, 0, 0.5) # Set the scale myCutPlanes.UseDeformation(True) myCutPlanes.SetVectorialField(fieldEntity, fieldName) myCutPlanes.SetScale(0.05) # Set the displacement myCutPlanes.SetDisplacement(0.1) # Update the object browser salome.sg.updateObjBrowser(1) # Display the newly created cut planes myViewManager = myVisu.GetViewManager() myView = myViewManager.Create3DView() myView.DisplayOnly(myCutPlanes) myView.FitAll()
Please, see CutPlanes interface reference documentation for more details.