Forums Anyscript.org  

Go Back   Forums Anyscript.org > General Forum > Wish list for AMS and AMMR

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 08-15-2013, 11:26 AM
klabauterjunge klabauterjunge is offline
Junior Member
 
Join Date: Apr 2010
Posts: 17
Default Timestamp for data export

Hi AnyBody-Team!

While doing parameter analyses, all the data can be exported in the structure of *.h5 files, which is very nice However, to my knowledge, the name of the files must be set every time manually in order to avoid overwriting already existing ones. This is a bit inconvenient.. Therefore it would be nice to have the option to export files with a timestamp, e.g., "2013-08-15-Simulation.h5". I already tried to create a work-around by using the AnyFunExMonoC, but it did not really work. The files are in attachment. What do you think?

Best regards,
Klabauterjunge
Attached Files
File Type: any AnyFunEx.any (197 Bytes, 13 views)
File Type: zip Timestamp.zip (359 Bytes, 9 views)
Reply With Quote
  #2  
Old 08-16-2013, 02:17 PM
danielnolte danielnolte is offline
Senior Member
 
Join Date: Jun 2011
Posts: 198
Default

Hi Malte,

I think you are missing some little details in your C++ function. It is probably a good idea to start from the example in the reference manual when you try to create a function like this. What is missing in your function is
1) the header that defines the interfaces to AnyBody (IAnyBodyDefs.h);
2) to set the right return value: The AnyFunExMonoC is not reading the result from the return value but from a class IAData, typically called pIADataReturn as a pointer to an IAnyBody::IAData, which should be the first argument in the function header. A value that should be returned has to be set in this IAData and is read from there into AnyBody.

With these modifications the function works fine. I attached the fixed .cpp file.

In general, I would think that a python function is more intuitive to handle for these kind of "simple" functions since python is able to handle more than one return value and does not need the definition of a structure of return values.

Please also have a look at the thread http://forum.anyscript.org/showthrea...light=filename which also handles this kind of problem.

Best regards
Daniel
Attached Files
File Type: zip timestamp.zip (513 Bytes, 11 views)
Reply With Quote
Reply

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 08:51 PM.