This method helps you import table headings from a text or a spreadsheet file as schema classes.

To import data from an Excel or CSV file to a MagicDraw project as a schema class by using the wizard


  1. Click File on the MagicDraw main menu and click Import From > Excel/CSV File. The Import Data from Excel and Create Mapping dialog will open and the Import Table Heading from Excel menu will be selected by default, see figure below. 

    The ImportData from Excel and Create Mapping Dialog

  2. Click OK. The Import Table Heading from Excel wizard will open, see figure below. 

    The Select a File Option Page

  3. Click to find an Excel or CSV file that you want to import. The Select a file dialog will open, see figure below. 

    Selecting an Excel or CSV File

  4. Select the file and click Open. The path filename of the selected file will appear in the Select a file box, see the figure immediately below. If you select a CSV file, the  drop-down list will be enabled for you to choose a delimiter used in your file, see the second figure below. 

    The Selected Path Filename

    Selecting a Delimiter forCSV File

  5. Once you have selected the file to import as a schema class, see figure below, you can: 

(i) Select the check box if you want Excel Import to start import headings at a specific row.
(ii) Select the check box if you want to import data from the file as instance specifications of the schema class. For more information about importing instance specifications, see section Importing Data to a Schema Class or Importing Data Through a Class Mapping and Mapping a Schema Class to an Element
(iii) Select the check box if you want to map the to-be-imported schema class to an element in your project. For more information about diagram mapping, see section Mapping a Schema Class to an Element.

Additional Options for Import


   6. You may click either (i)  and skip steps 7 to 14 or (ii) and the Select sheets option page will open, see figure below.

If you click  at this point, the wizard will:

  • Import table headings in all sheets that contain data as schema classes.
  • Save the schema classes under the Data module.
  • Create a class diagram to represent the schema classes and save it under the Data module. 

The wizard will skip the Select sheets option page if:

  • A selected Excel file has only one sheet.
  • A selected Excel file has several sheets but only one sheet contains data.
  • A CSV file is selected. 


Selecting Sheets in an Excel File 

   7. You can select more than one sheet (if the file has multiple sheets contain data). All of the sheets in the file to be imported are selected by default.
   8. You may click either (i)  and skip steps 9 to 14, or (ii) and the Select a package option page will open, see figure below.

If you click  at this point, the wizard will:

  • Import table headings in the selected sheets as schema classes.
  • Save the schema classes under the Data module.
  • Create a class diagram to represent the schema classes and save it under the Data module. 

 

Selecting a Package as the Owner of the Schema Class 

    9. Select a package as the owner of the to-be-imported schema class and/or its instance specifications, see figure above. You can:

(i) Select an existing package by selecting it from the treeview,
(ii) Create a new one by clicking the button, or
(iii) Clone an existing one by clicking the button.

The Select a Package Option Page 

  10. Click either (ii)  and skip steps 11-12, or (ii) to create a mapping diagram. The Create a diagram option page will open, see figure below.

If you click  at this point, the wizard will:

  • Save the schema classes under the selected package.
  • Create a class diagram to represent the schema class under the Data module. 

The Create a Diagram Option Page

  11. In this step, you need to do several things:

11.1 Either (i) select the check box to create a new diagram (the check box is selected by default) or (ii) deselect the check box if you do not want to create a new diagram.
11.2 You can name your diagram in the Type diagram name box.
11.3 (i) Select the diagram's owner from the treeview, (ii) create a new one, or (iii)
clone it.

  12. Click . The Excel Import plugin will import data from the selected file as a schema class and/or its instance specifications and display them under the selected or created package in the Containment tree in MagicDraw. If you create a new diagram, it will open and display the schema class on the diagram pane, see figure below.