Page 1 of 1

add external force to model

Posted: Mon Mar 04, 2019 5:31 pm
by saeedaram
hello

i want to add an external force to my model through matlab script but i faced this error

(Java exception occurred:
java.io.IOException: Object: Cannot open file
[].OSIM. It may not exist or you do not have
permission to read it.
Thrown at object.cpp:105 in Object().

at
org.opensim.modeling.opensimSimulationJNI.new_Model__SWIG_1(Native
Method)

at org.opensim.modeling.Model.<init>(Model.java:783) )



while my OSIM file exist...

Re: add external force to model

Posted: Tue Mar 05, 2019 1:42 am
by mitkof6
The path to the .osim file is incorrect.

Re: add external force to model

Posted: Wed Mar 06, 2019 5:39 am
by saeedaram
thanks for your response now i faced to this error when i run my model after add external force

Re: add external force to model

Posted: Wed Mar 06, 2019 5:45 am
by jimmy
Did you follow what the exception suggested-- invoke finalizeFromPrroperties() before writing the model to file?

You have to connect the force to something and this error suggests that the connections were not properly satisfied when you were constructing the model.

It may be useful to read through the API guide

Re: add external force to model

Posted: Wed Mar 06, 2019 6:19 am
by saeedaram
jimmy wrote:
Wed Mar 06, 2019 5:45 am
Did you follow what the exception suggested-- invoke finalizeFromPrroperties() before writing the model to file?

You have to connect the force to something and this error suggests that the connections were not properly satisfied when you were constructing the model.

It may be useful to read through the API guide
hello...no i didnt invoke finalizefromproperties...i will invoke that...but what the exception suggested relate to finalizeconnection()...i want to know both finalizefromproperties() and finalizeconnection() must invoke before model.print() ?