Version: 6.3.1

Import/Export table

Import tables from file:

import os

import salome

import visu_gui

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

# Get VISU engine
myVisu = visu_gui.myVisu

# Import tables from file
tableFile = os.path.join(datadir,"Tables","tables_test.xls")
myTablesSO = myVisu.ImportTables(tableFile, False)

# Print table names
print "\nNames of the imported tables:"
iter = salome.myStudy.NewChildIterator(myTablesSO)
while iter.More():
    aTableSO = iter.Value()
    if aTableSO:
        aTable = aTableSO.GetObject()
        print "\n", aTable.GetTitle()
    iter.Next()

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


Export table to the file:

import os

import salome

import visu_gui

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

# Get VISU engine
myVisu = visu_gui.myVisu

# Import tables from file
tableFile = os.path.join(datadir,"Tables","tables_test.xls")
myTablesSO = myVisu.ImportTables(tableFile, False)

# Export the first imported table to a new file
expTableFile = os.path.join(datadir,"Tables","sinus_table.txt")

sinusTableSO = salome.myStudy.FindObject("sinus")
myVisu.ExportTableToFile(sinusTableSO, expTableFile)

# 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