| Contents | Index |

| On this page… |
|---|
Mechanical Import Dialog Box Overview Specify subsystem to import into Create new subsystem if it does not exist Ensure block names do not overlap |
The Import Physical Modeling XML dialog box provides the same control over generating SimMechanics models from Physical Modeling XML files as does the mech_import function with inputs. The dialog box has two tabs, Import and Advanced Options.
To generate a SimMechanics model from a Physical Modeling XML file:
In the dialog box, enter your settings.
Click Apply.
To complete the function and start the file import, click OK.
If you need to stop the file import, click Cancel.
Note MATLAB uses the last set of import options that you set in this dialog box and not the default options. Click the Reset to default settings button to restore the import dialog box settings to their defaults. |
The Import tab has several active areas: the XML File field, the Import mode selection area, and two specifications for import into existing models and subsystems.
The Advanced Options tab has several active areas: Model simplification, Layout, Update, and Backup.
Model Simplification. If you choose to create a new model or to add to or replace contents in an existing model, this area is active.
Layout. The area is always active.
Update. If you choose to update an existing model, this area is active.
Backup. If you choose to update, add to, or replace contents in an existing model, this area is active.
The backup version of the updated model is the most recent version before the current update.
Name of Physical Modeling XML file
Default: blank
Enter the name of a Physical Modeling XML file, including its absolute path on your system. There is no default name.
You can search for files with a file browser by clicking the ... button. Clicking this button opens a file browser in the current working folder.
If you click Open in the file browser, the selected file name is copied to the File field. The name includes the file's absolute path on your operating system.
If you do not specify an absolute path, the importer searches for the file on the MATLAB path and in the current MATLAB folder.
For more information, see the mech_import function reference page.
With a specified XML file, you can:
Create a new model.
Update an existing model.
Add to an existing model.
Replace content in an existing model.
These choices are mutually exclusive.
Default: selected
Select this option to create a new model from the specified XML file.
Default: cleared
Select this option to use the specified XML file to update an existing model.
By default, the importer updates the model with the same name in the XML file.
Default: cleared
Select this option to use the specified XML file to add to an existing model.
By default, the importer adds to the model with the same name in the XML file.
Default: cleared
Select this option to use the specified XML file to replace contents of an existing model or subsystem.
By default, the importer replaces contents in the model with the same name in the XML file.
If you want to specify a different model, different subsystem, or both, use the Specify model to import into and Specify subsystem to import into options.
When you set the Import mode to Import into new model, you enable the Model simplification and Layout areas on the Advanced Options tab.
When you set the Import mode to Update existing model, you enable the Layout, Update, and Backup areas on the Advanced Options tab.
When you set the Import mode to Add to existing model, you:
Enable the Create new subsystem if it does not exist check box.
Enable the Model simplification, Layout, and Backup areas on the Advanced Options tab.
When you set the Import mode to Import into existing model, you enable the Model simplification, Layout, and Backup areas on the Advanced Options tab.
For more information, see the mech_import function reference page.
Enable specification of name of model into which you want to import. Use this option if you want to specify:
The name of a newly created model, instead of the default. The default is the model name specified in the XML file.
The name of existing model whose contents are to be updated, added to, or replaced.
Default: Off
You want to specify the name of the model into which you want to import the XML file. If you select the check box, you must also specify a model name.
You do not want to specify the name of a model into which you want to import the XML file.
If you select the check box, the Model name field is active.
For more information, see the mech_import function reference page.
Name of model to import into. There is no default name.
Default: blank
Specify the model name.
You can search for files with a file browser by clicking the ... button. Clicking this button opens a file browser in the current working folder.
If you select the Specify model to import into check box, this field is active.
If you select the Specify model to import into check box and set the Import mode to one of these:
Update existing model
Add to existing model
Import into existing model
the file browser ... button is active.
For more information, see the mech_import function reference page.
Enable specification of name of subsystem into which you want to import. Use this option if you want to specify:
The name of a newly created subsystem, instead of the default. The default is the top level of the model that you are importing into.
The name of existing subsystem whose contents are to be updated, added to, or replaced.
Default: Off
You want to specify the name of the subsystem into which you want to import the XML file. If you select the check box, you must also specify a subsystem name.
You do not want to specify the name of a subsystem into which you want to import the XML file.
If you select the check box, you enable the Subsystem name field.
If you select the check box and also set the Import mode to Add to existing model, you enable the Create new subsystem if it does not exist check box.
If you set the Import mode to Update existing model, you change the check box label to Specify subsystem containing blocks to update.
For more information, see the mech_import function reference page.
Name of subsystem to import into. There is no default name.
Default: blank
Specify the subsystem name.
If you select the Specify subsystem to import into check box, the field is active.
For more information, see the mech_import function reference page.
If specified subsystem does not exist in target model, create new subsystem.
Default: Off
If the specified subsystem does not exist in the target model, create a new subsystem.
Do not create a new subsystem in the target model.
The check box is present when you set the Import mode to Add to existing model.
For more information, see the mech_import function reference page.
You can:
Follow the imported model hierarchy and make no simplifications to the hierarchy.
Move all joints in the generated model to the top level of the model hierarchy and group welded bodies into newly created rigid subsystems.
Group welded bodies at each level into newly created rigid subsystems.
These choices are mutually exclusive.
Default: selected
Select this option to follow the imported subsystem hierarchy with no changes.
Default: cleared
Select this option to place all non-weld joints at the top level and all welded bodies into rigid subsystems.
Default: cleared
Select this option to place welded bodies into rigid subsystems.
The rigid subsystems at each level of model hierarchy collect and contain all the welded bodies at that level.
Placing welded bodies into rigid subsystems means creating new subsystems with no internal degrees of freedom (DoFs). The welded Body blocks are connected by Weld joints, which have no DoFs, and cannot move with respect to one another.
This option cannot change the model hierarchy of parts specified by the XML file, which controls the placement of bodies and subsystems in the generated model.
The area is active when you set the Import mode to any option except Update existing model.
For more information, see the mech_import function reference page.
Require that Joint blocks in generated model have short names.
Default: On
Ensure that Joint blocks in the generated model have short default names.
Apply the Joint block names from the imported XML file.
Short default names of a set of revolute joints could be, for example, Revolute1, Revolute2, etc.
Joint block names from the imported XML file might be long and take up more space in your model.
For more information, see the mech_import function reference page.
| Application | Setting |
|---|---|
| Debugging | Off |
| Traceability | Off |
| Efficiency | No impact |
| Safety precaution | Off |
If imported block names are long, enlarge spacing between imported blocks in generated model.
Default: Off
If the imported block names are long, enlarge the spacing between imported blocks in the generated model.
Space the blocks only according to the block sizes, not the block names.
The check box is active when you set the Import mode to any option except Update existing model.
For more information, see the mech_import function reference page.
| Application | Setting |
|---|---|
| Debugging | On |
| Traceability | On |
| Efficiency | No impact |
| Safety precaution | On |
Block diagram growth direction in the generated model
Default: Horizontal
Select one of two block diagram growth directions in the generated model, Horizontal or Vertical.
The menu is active when you set the Import mode to any option except Update existing model.
For more information, see the mech_import function reference page.
Arrange layout of all imported blocks in model block diagram being updated.
Default: Off
Arrange the layout of all imported blocks in the model block diagram being updated.
Do not arrange the layout of the existing imported blocks when updating a model. Place newly imported blocks around the existing block diagram.
The check box is enabled when you set the Import mode to Update existing model.
For more information, see the mech_import function reference page.
| Application | Setting |
|---|---|
| Debugging | On |
| Traceability | On |
| Efficiency | No impact |
| Safety precaution | On |
Comply with block settings that allow each block to be updated or prevent each block from being updated.
Default: On
On individual blocks in the model being updated, respect the settings that allow each block to be updated or prevent each block from being updated.
Update whichever blocks in the model need to be updated, regardless of the individual block settings.
The check box is enabled when you set the Import mode to Update existing model.
For more information, see the mech_import function reference page.
Specify at which levels of imported model hierarchy to import new joints.
Default: Off
Add new joints in the updated model at the highest level of the model hierarchy, specified by either the Model name or the Subsystem name parameter.
Add new joints at the levels in the hierarchy specified by the connectivity of the existing blocks.
The check box is enabled when you set the Import mode to Update existing model.
This option only updates or imports blocks individually and cannot change the existing model hierarchy.
For more information, see the mech_import function reference page.
| Application | Setting |
|---|---|
| Debugging | On |
| Traceability | On |
| Efficiency | No impact |
| Safety precaution | No impact |
Control backup of previous version of generated model.
Default: Create backup in same folder
In the drop-down list, choose one of these backup options:
Don't create backup – The importer does not save the previous version.
Create backup in same folder – The importer saves the previous version in the same folder as the updated version. The backup model name is existingmodelname_backup.mdl.
Specify location to create backup – The importer saves the previous version in a folder that you specify.
The drop-down list is enabled when you set the Import mode to one of these:
Update existing model
Add to existing model
Import into existing model
If you choose the Specify location to create backup option, the Backup model location field and the ... file browser button become active.
For more information, see the mech_import function reference page.
Control where you save backup of previous version of generated model.
Default: blank
Enter a location on your file system to place the saved previous version of your model.
You can enter the model location in the field manually, or click the ... button to search for a location with a file browser.
When you select Specify location to create backup in Backup mode menu and you set the Import mode to one of these:
Update existing model
Add to existing model
Import into existing model
this field is enabled.
For more information, see the mech_import function reference page.
![]() | Mechanical Import | Technical Conventions | ![]() |

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |