The advantage of using the header comments in a System Target File to define multiple targets is to have only one tlc file for the most options. This makes maintenance easier. On the other hand you usually have one line defining the BuildDirSuffix for all cases.
If you want to use different directories based on your selection of the System Target File you could use the getActiveConfigSet function to get the description of the System Target File which was selected. Then you can create different BuildDirSuffix for different descriptions, as shown in the following example:
cs = getActiveConfigSet(gcs);
tmp = cs.Components(7).Description;
switch tmp
case 'my_grt1'
rtwgensettings.BuildDirSuffix = '_mygrt1_rtw';
otherwise
rtwgensettings.BuildDirSuffix = '_mygrt2_rtw';
end
Attached you can find the example System Target File and the VDP demo model.
Best Answer