How to solve the mech_import error for SimMechanics?

51 ビュー (過去 30 日間)
Huub Timmermans
Huub Timmermans 2012 年 11 月 6 日
Dear Matlab/Simulink users,
I've a question regarding the SimMechanics links module. I installed the link module of Simmechanics for Matlab 2012b succesfully. Then I registered and linked the SimMechanics Link software as SolidWorks add-in. Now i have a model (the robot example model) in Solidworks which i want to export to SimMechanics. So I go to the add-in tool and press Export -> Simmechanics Second Generation. When I tried to open the model in Matlab with the command: mech_inport('sm_robot.xml') it constantly gives the following errors:
"XML Read error" while attempting to read file "sm_robot.xml".
Error in C:\Program Files\MATLAB\R2012b\toolbox\physmod\mech\importer\+PMImport\@ModelReader\ModelReader.p>ModelReader.ModelReader (line 33)
Error in C:\Program Files\MATLAB\R2012b\toolbox\physmod\mech\importer\+PMImport\@ModelUpdater\ModelUpdater.p>ModelUpdater.ModelUpdater (line 16)
Error in C:\Program Files\MATLAB\R2012b\toolbox\physmod\mech\importer\+PMImport\pmiu_import.p>pmiu_import (line 73)
Error in mech_import (line 97)
PMImport.pmiu_import(varargin{:});
When I check the folder where i saved the export model, there is only a XML document and no STL files. Maybe that is the problem? How can i solve it?
Thank you a lot in advance!
Kind regards,
H. Timmermans
  1 件のコメント
Walter Roberson
Walter Roberson 2012 年 11 月 7 日
Please use better tags for this question; the tags you have used are all products, which should go in the Product field. See http://www.mathworks.co.uk/matlabcentral/answers/43073-a-guide-to-tags

サインインしてコメントする。

採用された回答

Noor Zeid
Noor Zeid 2016 年 6 月 24 日
I think you should use smimport('model_name.xml') command for second generation

その他の回答 (3 件)

Arash Mohammadzadeh Gonabadi
Arash Mohammadzadeh Gonabadi 2017 年 11 月 10 日
Try using the command smimport('smTotal.xml') instead of mech_import().

Adrian Hernandez
Adrian Hernandez 2016 年 5 月 18 日
Dear Huub Timmermans Can you solve your problem?
I have the same problem but I've the STL documents and XML. I can't solve this.
  1 件のコメント
Tamara Miteva
Tamara Miteva 2016 年 6 月 11 日
Dear Adrian Hernandez did you solve the problem? I have the same problem..

サインインしてコメントする。


Luu Quan
Luu Quan 2017 年 2 月 21 日
I think when you export SimMechanics from Solidworks file, you must chose Simscape Multibody First Generation (1G) instead of Simscape Multibody...
  1 件のコメント
Châu Trung Tín
Châu Trung Tín 2019 年 3 月 9 日
Dear Luu Quan, My solidworks have Simscape Multibody First/Second generation. It only have Simscape Multibody... So how can I see Simscape Multibody First/Second generation. Thanks so much. I am looking forward your answer.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeSimscape Multibody についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by