3 \page tui_cut_segment_page Cut Segment
5 Create <b>Cut Segment</b> presentation on a field of the imported MED file:
15 # The directory containing MED files
16 datadir = os.getenv("DATA_DIR")
19 myVisu = visu_gui.myVisu
22 medFile = os.path.join(datadir,"MedFiles","fra.med")
23 myResult = myVisu.ImportFile(medFile)
25 # Create a cut segment for the first timestamp of 'VITESSE' field
26 meshName = 'LE VOLUME'
27 fieldEntity = VISU.NODE
29 myCutSegment = myVisu.CutSegmentOnField(myResult, meshName, fieldEntity, fieldName, 1)
31 # Set the first point of the segment
32 myCutSegment.SetPoint1(0, 0, 0)
34 # Set the second point of the segment
35 myCutSegment.SetPoint2(0.41, 0.0685, 1.082)
37 # Invert the resulting curve
38 myCutSegment.SetAllCurvesInverted(True)
40 # Update the object browser
41 salome.sg.updateObjBrowser(1)
43 # Display the newly created cut segment
44 myViewManager = myVisu.GetViewManager()
45 myView = myViewManager.Create3DView()
47 myView.DisplayOnly(myCutSegment)
51 <br>Please, see \ref VISU.CutSegment "CutSegment interface reference documentation"