//C# // $reference: System.Windows.Forms.dll // $reference: System.dll using System; using System.Collections.Generic; using System.Windows.Forms; class Script { static Manifold.Context Manifold; static void Main() { Manifold.Application app = Manifold.Application; // Default output directory string outputDir = @"h:\data\tmp"; FolderBrowserDialog folderBrowserDialog = new System.Windows.Forms.FolderBrowserDialog(); folderBrowserDialog.SelectedPath = outputDir; DialogResult result = folderBrowserDialog.ShowDialog(); if (result == DialogResult.OK) { outputDir = folderBrowserDialog.SelectedPath; using (Manifold.Database db = app.GetDatabaseRoot()) { using (Manifold.Table table = db.Search("mfd_root")) { string[] fields = new string[] { "Name", "Type" }; using (Manifold.Sequence sequence = table.SearchAll(fields)) { while (sequence.Fetch()) { string compName = sequence.GetValues()[0].Data.ToString(); string compType = sequence.GetValues()[1].Data.ToString(); if(compName.StartsWith("mfd_")) { // app.MessageBox("Found root table " + compName + ".", "Message"); } else if(compType == "table") { // app.MessageBox(compName + " is a table.",""); db.ExportFile(compName, outputDir + "\\" + compName + ".csv"); } } } } } app.MessageBox("Export complete!", "Message"); } // end if DialogResult == OK } }