Load File Name for Simscape Multibody File Solid from Workspace

조회 수: 14 (최근 30일)
mkoh
mkoh 2020년 5월 20일
답변: Steve Miller 2021년 6월 5일
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.
  댓글 수: 2
Charlotte Hollywood
Charlotte Hollywood 2021년 1월 26일
편집: Charlotte Hollywood 2021년 1월 26일
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
Good luck! Hope this helps.
mkoh
mkoh 2021년 1월 26일
That was indeed the clue I needed. It now works the way I had imagined. How could I not have thought of that myself? Anyway, thank you very much, Charlotte!

댓글을 달려면 로그인하십시오.

채택된 답변

Steve Miller
Steve Miller 2021년 6월 5일
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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Simscape Multibody에 대해 자세히 알아보기

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by