Setting path for CAD parts in Simscape Multibody

15 次查看(过去 30 天)
I am creating a Simscape project to simulate a 3D model I created with Autodesk Inventor 2021 (Build 250183000, 183). I succesfully exported the .xml and .STEP files using the Simscape Multibody Link plugin (Version 7.4). I am also able to create the Simulink model using the command:
smimport('filename.xml')
To keep my folders more clean I would like to have the model files in a separate folder and have the File Solid blocks in the Simulink file point to it. After creating a model_data folder in which I put all the .STEP files and the .xml file, I run:
smimport('model_data\filename.xml')
The Simulink model is created again succesfully. However, this time it does not work as expected. In fact, all the File Solid blocks have their Geometry\File Name field pointing directly to the .STEP file instead of containing the relative path to it (i.e., the File Name field is still 'file.STEP' instead of 'model_data\file.STEP'). Therefore, the .STEP files are not found correctly and the simulation cannot start. How can I fix this?

回答(1 个)

Dhruv
Dhruv 2023-8-31
It seems like you are facing an issue with the relative paths not being set correctly for the File Solid blocks in your Simulink model after you've moved the model files to a separate folder.
This can happen because the paths might not be updated automatically when you import the model using "smimport()".
To fix this issue, you can manually update the File Solid block paths to use relative paths pointing to the "model_data" folder.
Please see the following link for more information on the steps involved:
I hope this helps solving your issue!

类别

Help CenterFile Exchange 中查找有关 Simscape Multibody 的更多信息

产品


版本

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by