You can export instance specifications of a schema class and/or elements of a class mapping from MagicDraw to an Excel or CSV format file. You can open the Export Data to Excel dialog from any of the following:
(i) The MagicDraw main menu File > Export To > Excel/CSV File.
(ii) The context menu of a schema class in the Containment tree and on the diagram pane.
(iii) The context menu of a class mapping in the Containment tree.
If you open the Export Data to Excel dialog through the context menu of a schema class or a class mapping, you do not have to select the schema class or the class mapping as it will be selected by default.
When you export elements from a schema class or a class mapping to an existing Excel or CSV file, the file needs to have columns that match the number and name of a schema class to be exported. The target file can be a new or an existing file. Excel Import does not support the export of Excel composite schema to CSV file.
To export instance specifications and/or elements from MagicDraw to an Excel or CSV file
Do any of the following:
(i) Click File > Export To > Excel/CSV File on the main menu, see the first figure below. The Export Data to Excel dialog will open, see fourth figure below.
(ii) Right-click a schema class or a class mapping in the Containment tree > Tools > Export Data to Excel, see second figure below. The Select a file option page will open, see the sixth figure below, to continue with step 2.
(iii) Right-click a schema class on the diagram pane > Tools > Export Data to Excel, see third figure below. The Select a file option page will open, see the fifth figure below, to continue with step 2.Opening the Export Data to Excel wizard through a schema class or a mapping class' context menu will select the schema class or the mapping class by default; therefore, the wizard will skip the Select a mapping option page.
- You can export either (i) elements of a class mapping by selecting a class mapping from the treeview, see first figure below or (ii) instance specifications of a schema class by selecting a schema class from the treeview, see second figure below.
- Click . The Select a file option page will open, see figure below.
- Click to find a file, or create a new one to store the exported elements by type a file name, select a file extension, and click Save.
Click either (i) to export all elements associated to the selected schema class or class mapping or (ii) . If you click , the Export data to file option page will open, see figure below.
If you click at this point, the wizard will:
• Export all the element associated to the selected schema class or class mapping.
• If you select a new Excel file to export, the Sheet1 is created to store the exported element by default.
• If you select a new CSV file to export, the comma is used as delimiter by default.- To export to an Excel file, either (i) select a sheet to export the elements of the selected schema class or a mapping class from the Select a sheet drop-down list or (ii) type a new sheet name.
- Select an element scope that you want to export from the treeview. If you do not select any element scope, Excel Import will export all elements belong to the selected schema class or mapping class by default.
- Click . The elements and/or instance specifications will be exported to the selected sheet or file.
If you select an Excel or CSV file that has existing data, its columns must match the properties of the schema class. Otherwise, an error will occur during export and an error message will open in the Notification Window in MagicDraw.
- If you select a new Excel file to export your data, the default target is the first sheet (Sheet1).
- If you select a new CSV file to export your data, the default delimiter is comma.
- The default element scope is to export all elements owned by a selected schema class.