Question
Is there a way to specify the File Name parameter, that is, the file path of the geometry in the Simscape Multibody File Solid block with a MATLAB workspace variable? It seems to me that only direct paths can be specified. Callbacks and masks are also only accessible to a limited extent. Does anyone have an idea how to implement this or is it just not possible? Such a function would be very handy if you want to run simulations with different File Solids on one model. I am grateful for any suggestion.
Expert Answer
John Williams
PhD Expert
Answered Aug 26, 2026
As Charlotte mentioned, this solved the problem:
I did it by executing these commands in the MATLAB command menu. First get the handle for your current block (or whatever block. e.g. 'myModel/File Solid')
a = gcbh
Look at the list of parameters by doing this
get(a)
Choose the parameter you want to change, e.g. ExtGeomFileName for the File Solid block and set it to what you want
set_param(a, 'ExtGeomFileName', filename)
where filename is the variable in your workspace
100% Run Guarantee
3-Hour Fast-Track Delivery
Need a Custom Version or Complete Simulation for This Problem?
Our 500+ PhD engineers build, debug, and optimize working MATLAB scripts and Simulink (.slx) models tailored to your exact assignment rubrics with zero plagiarism.
Tested on MATLAB R2024b / R2026a
Turnitin 0% Plagiarism Report
Free 7-Day Revisions Guarantee
Have a different question? Ask here
Related simscape Questions & Solutions
Browse All →
Explore similar technical troubleshooting questions and verified MATLAB solutions:
Ready-to-Run MATLAB & Simulink Projects
Browse All Projects →