question

William Proctor avatar image
0 Likes"
William Proctor asked Arun Kr answered

Can I Query the Model File Name?

I would like to take the file name of the model being run and copy it into a table. This will enable me to identify the results of an experiment against the specific model used when running the experiment. Is there a way to identify the model file name and place it into a global table? Otherwise, I would just have the user manually type in the model name.

global tableexport
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

·
Arun Kr avatar image
4 Likes"
Arun Kr answered

Hi William Proctor,

Here's a quick code.

 string modeldirectorypath = modeldir;
int StrLengthmodeldirectorypath = modeldirectorypath.length;
string ModelPath = views().find("environment/modelpath").value;
int StrLengthModelPath = ModelPath.length;
string ModelName = ModelPath.slice(StrLengthmodeldirectorypath + 1,StrLengthModelPath -3 );
Table("GlobalTable1")[1][1] = ModelName;

Regards,

Arun KR

5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.