how do i change the data file's directory for a simscape model?

I've created a simscape model from a solidworks model. As part of the process, it created me a DataFile.m with all the sizes for the model. If i try to move the file itself to a different directory, the model won't build. Anyone knows how can I change the directory the simscape model reads, from the simscape itself?

Answers (1)

In a default setting, this file is generated with a static path. Once you generate the model, you can modify it by right-clicking anywhere in the model and:
Find Referenced Variables -> select your model in the left hand pane -> select the Model Workspace in the middle pane -> modity the file name which has the path also included in it.
I removed the path only kept the file name, and it worked for me even if the whole folder is moved to another location.

1 Comment

I did pretty much this and it worked.
Find referenced variables > Simulink root > ModelName > Model Workspace
On the right, browse for a new directory, change the directory and then you can copy and paste the files into the new directory. It might give you a warning about shadowing so once you see it working just delete the old directory

Sign in to comment.

Categories

Find more on Simscape in Help Center and File Exchange

Asked:

on 14 Nov 2017

Commented:

on 21 Apr 2022

Community Treasure Hunt

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

Start Hunting!