MATLAB Answers

Simmechanics load solidworks assembly error

43 views (last 30 days)
Toon Mertens
Toon Mertens on 29 Mar 2016
Commented: sakthinathan s on 1 Oct 2019
Hi,
I'm trying to open a assembly from solidworks into simmechanics. Everything goes well until I try to open my xml file with the command
mech_import('smTotal.xml').
I always get next error.
Error using PMImport.ModelReader
"XML Read error" while attempting to read file "smTotal.xml".
Error in PMImport.ModelUpdater
Error in PMImport.pmiu_import
Error in mech_import (line 97)
PMImport.pmiu_import(varargin{:});
Does anybody know how I could solve this? or what the problem is?

  2 Comments

Muhammad Khird Added
Muhammad Khird Added on 24 Jul 2019
i am having same problem, can soemeone help us out with this
sakthinathan s
sakthinathan s on 1 Oct 2019
hello sir,
Try using the command smimport(' .xml') for importing the .xml files

Sign in to comment.

Answers (4)

Steve Miller
Steve Miller on 30 Mar 2016
I believe you are using the wrong command for importing the XML file.
Try using the command smimport('smTotal.xml') instead of mech_import().
mech_import() is for First Generation technology. It is likely you exported to Second Generation Technology, and should be using the command smimport().
See doc page for Simscape Multibody here: http://www.mathworks.com/help/physmod/sm/ref/smimport.html
(Note that SimMechanics was renamed to Simscape Multibody in R2016a). --Steve

  4 Comments

Show 1 older comment
mahathi dhanavanthan
mahathi dhanavanthan on 23 Mar 2017
kindly try using smimport('file name.xml').... for simmechanics this is the code
razieh darini
razieh darini on 11 Aug 2018
thanks for ur hint.I used mech_import yesterday and saw errors that confused me. thanks and thanks!!

Sign in to comment.


Omar Crypps
Omar Crypps on 2 Oct 2016
Hi, I designed a model of 1 degree of freedom on Solidworks and i followed all the steps to export it to the Simulink of Matlab. However, there is always an error that appears after exporting it on Simlink.
Unfortuntely, I can't add a screen shot here but the error tells me " Constraint is not supported , the constraint has been exported as unknown constraint .

  0 Comments

Sign in to comment.


Diego Leonardo Velásquez Gómez
Hello, I have the same problem as Omar Cryps, I've been using the smimport() function but it doesn't work, so please, somebody help me

  0 Comments

Sign in to comment.


samet türkay
samet türkay on 15 Apr 2019
eyvallah steve gardaş

  0 Comments

Sign in to comment.

Sign in to answer this question.