Version: 6.3.1

Import/Export MED

Import data from a MED file:

import os

import salome

import visu_gui

# The directory containing MED files
datadir = os.getenv("DATA_DIR")

# Get VISU engine
myVisu = visu_gui.myVisu

# The path to the file
medFile = os.path.join(datadir,"MedFiles","fra.med")

# Import the file
myResult = myVisu.ImportFile(medFile)

# Update the object browser
salome.sg.updateObjBrowser(1)


Export data to a MED file:

import os

import salome

import visu_gui

# The directory containing MED files
datadir = os.getenv("DATA_DIR")

# Get VISU engine
myVisu = visu_gui.myVisu

# The path to the file
medFile = os.path.join(datadir,"MedFiles","fra.med")

# Import the file
myResult = myVisu.ImportFile(medFile)

# Export the file
newFileName = os.path.join(datadir,"MedFiles","fra_copy.med")
myResult.ExportMED(newFileName)

# Update the object browser
salome.sg.updateObjBrowser(1)
Copyright © 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS