Main Content

Export a SolidWorks Robot Assembly Model

In this example, you export a SolidWorks™ CAD assembly that represents a robot arm. The export procedure generates one XML file and a set of geometry files that you can import into Simscape™ Multibody™ to generate a new model.

The example begins with a procedure to export the CAD assembly. Information on the robot CAD files and CAD Export follows the export procedure. To import the robot assembly into a Simscape Multibody model, see Import a CAD Assembly Model.

The following figure shows the robot CAD assembly you export in this example.

Example Requirements

To successfully complete this example, you must meet the following requirements:

  • Have the latest version of Simscape Multibody Link installed on your machine.

  • Have completed the linking procedure for your SolidWorks installation. The linking procedure adds a Simscape Multibody Link add-in to the SolidWorks installation.

  • Have access to the robot example files. See the supporting files of the Robot Arm example.

Open the Assembly Model

Before you can export the robot assembly, you must load the assembly into SolidWorks.

  1. Open SolidWorks on your machine.

  2. Select File > Open.

  3. Navigate to the file directory that contains the robot CAD files.

    Note

    The CAD files are in the RobotArmSWSupport folder of the Robot Arm. To use the file, at the MATLAB command prompt enter:

    openExample("smlink/RobotArmSWExample")

  4. Select file robot.SLDASM.

  5. Click Open.

The CAD platform opens the robot assembly.

Export the Model

Once you successfully open the robot CAD assembly in your SolidWorks installation, you can export the assembly in a format compatible with the latest Simscape Multibody technology:

  1. On the SolidWorks tool bar, select Simscape Multibody Link > Export > Simscape Multibody. In certain SolidWorks versions, this option may appear under the Tools menu.

  2. In the File name field of the Save As dialog box, enter sm_robot and select a directory to export the files.

  3. Click Save.

    Note

    Large CAD assemblies require more time to complete the export process. Allow up to a few minutes for the export process to complete.

Check the Exported Files

Confirm the following files exist in the specified export directory:

  • XML file — provides structure of model and parameters of parts.

  • Geometry files — provides surface geometry of parts.

About CAD Export

The CAD export procedure generates one XML multibody description file and a set of geometry files. The XML file contains the structure of the assembly and the parameters that define each part. The geometry files define the 3-D geometry of each part. Once the export procedure is complete, you can import the XML multibody description file into Simscape Multibody software. Simscape Multibody uses the file to automatically generate a new Simscape Multibody model.