User Tools

Site Tools


visual3d:documentation:pipeline:event_commands:example_-_export_events_to_ascii_file

Example - Export Events to ASCII File

This example will export Events to an ASCII file. Events are signals in Visual3D that exist in the data tree, which means they can be exported like any other signal using the Export Data To ASCII File.

For example, using this command the event RHS will be exported to a file named “test.txt”:

Export_Data_To_Ascii_File
/FILE_NAME=C:/demo files/Example1/test.txt
/SIGNAL_TYPES=EVENT                               
/SIGNAL_NAMES=RHS  
! /SIGNAL_FOLDER=ORIGINAL                     
! /START_LABEL=                             
! /END_LABEL=                                  
! /USE_POINT_RATE= FALSE                        
/NORMALIZE_DATA= FALSE                          
! /NORMALIZE_POINTS= 101                       
/EXPORT_MEAN_AND_STD_DEV= FALSE        
! /USE_P2D_FORMAT=  FALSE                      
;

Events are stored as a time, not FRAMES, so the exported file will contain the time for each occurrence of the EVENT.

However, if the user wants to export FRAMES, a new signal RHS_FRAMES can be created using Evaluate_Expression. Note that frame 1 of a motion file equates to time 0.0 seconds, so there must be a +1 to compensate for this offset.

Evaluate_Expression
/EXPRESSION=EVENT_LABEL::ORIGINAL::RHS*PARAMETERS::POINT::RATE+1
/RESULT_NAME=RHS_FRAMES
/RESULT_TYPE=DERIVED
/RESULT_FOLDER=EVENT_FRAMES
;

This new signal can be exported as follows:

Export_Data_To_Ascii_File
/FILE_NAME=C:/demo files/Example1/test.txt
/SIGNAL_TYPES=DERIVED                               
/SIGNAL_NAMES=RHS_FRAMES  
/SIGNAL_FOLDER=EVENT_FRAMES
! /START_LABEL=                             
! /END_LABEL=                                  
! /USE_POINT_RATE= FALSE                        
/NORMALIZE_DATA= FALSE                          
! /NORMALIZE_POINTS= 101                       
/EXPORT_MEAN_AND_STD_DEV= FALSE        
! /USE_P2D_FORMAT=  FALSE                      
;
visual3d/documentation/pipeline/event_commands/example_-_export_events_to_ascii_file.txt · Last modified: 2024/07/17 11:45 by sgranger