Forums Anyscript.org  

Go Back   Forums Anyscript.org > General Forum > AnyBody Modeling System

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 02-16-2011, 01:46 PM
koningbhw koningbhw is offline
Member
 
Join Date: Feb 2010
Posts: 32
Default 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
Reply With Quote
  #2  
Old 02-28-2011, 03:57 PM
toerholm's Avatar
toerholm toerholm is offline
AnyBody Support
 
Join Date: Feb 2009
Posts: 924
Default

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

Code:
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";
};
__________________
TIP: How to save and load results.
http://wiki.anyscript.org/index.php/All_about_AnyBody_Modeling_System#Save_Load_and_Re play_Results

Subscribe to the forums, click the 'Forum Tools' link above the list of threads then select 'Subscribe to Forum'. You will then have the option to choose the subscription mode for this forum and get an email automatically.
Reply With Quote
  #3  
Old 03-07-2011, 02:38 PM
koningbhw koningbhw is offline
Member
 
Join Date: Feb 2010
Posts: 32
Default

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):
Code:
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:
Code:
AnyOperationMacro CurrentSequence  = { 
    MacroStr=strformat({
      "operation Main.Studies.KinematicStudyForParameterIdentification.Kinematics",
      "run"
    });
.. 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
Reply With Quote
  #4  
Old 03-09-2011, 04:09 PM
toerholm's Avatar
toerholm toerholm is offline
AnyBody Support
 
Join Date: Feb 2009
Posts: 924
Default

Hi Bart,

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

Best regards
Søren
__________________
TIP: How to save and load results.
http://wiki.anyscript.org/index.php/All_about_AnyBody_Modeling_System#Save_Load_and_Re play_Results

Subscribe to the forums, click the 'Forum Tools' link above the list of threads then select 'Subscribe to Forum'. You will then have the option to choose the subscription mode for this forum and get an email automatically.
Reply With Quote
Reply

Tags
folder structure, project

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 12:01 AM.