Problem with textbased macro when using backslahes

Hi,

I am creating my own project, and one important aspect (for me at least) is to create a project which is able to load and store data from a project folder structure (see http://forum.anyscript.org/showthread.php?t=2761). This works for everything except the macro that stores optimized parameter values, which in the default model ( AMMRV1.3 GaitLowerExtremityProject) is:

“classoperation Main.Studies.ParameterIdentification” + strformat("\x22")+ “Load design” + strformat("\x22")+ " --file="+ strformat("\x22")+ Main.TrialSpecificData.NameOfFile +"-"+“OptimizedParameters.txt” + strformat("\x22")

However, I cannot find a way to store this in my project output folder. When ‘Main.TrialSpecificData.NameOfFile’ is a string containing backslashes to point out the correct destination folder, the macro ignores the backslashes. Is there a way to solve this (by adding the folder location to store the parameters inside the macro)?

Kind regards,

Bart Koning

Hi Bart,

Sorry for the slow respond to this one.

Please have a look at the sample code below and let me know if this will solve the problem.

Best regards
Søren


AnyOperationMacro SaveWidgetValues = { 
    MacroStr={
      "classoperation Main" + " " + strquote("Save Values") + " --file=" + strquote(FilePathCompleteOf(Main.ModelSetup.FileNames.WidgetValues )) 
    };
  };

 AnyFolder FileNames={
    //Definition of file names
      AnyFileVar WidgetValues = Main.TrialSpecificData.NameOfFile + ".anyset";
};


1\ The problem with saving of the widget values is already solved by entering the correct pathname (as this is not saved using a macro):


Main.Project={
  Files = {
      SetValueFile = Main.TrialSpecificData.OutputFolder +  Main.TrialSpecificData.ExportName+"-MarkerPositionWidgetValues.txt";
    };
...

2\ For saving the optimized parameters I first tried your approach, which works :-).

However, I noticed just noticed the stringformat in the default macro:


AnyOperationMacro CurrentSequence  = { 
    MacroStr=[u][b]strformat([/b][/u]{
      "operation Main.Studies.KinematicStudyForParameterIdentification.Kinematics",
      "run"
    }[u][b])[/b][/u];

… just removing the strformat() worked as well. Is there a specific reason for using this format type? Or is it alright just to remove it?

Kind regards,

Bart

Hi Bart,

I think the strformat is a left over… the same script was used elsewhere where this was needed.

Best regards
Søren