User Tools

Site Tools


visual3d:documentation:pipeline:file_commands:update_workspaces_example

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
visual3d:documentation:pipeline:file_commands:update_workspaces_example [2024/06/19 12:50] sgrangervisual3d:documentation:pipeline:file_commands:update_workspaces_example [2024/07/17 15:45] (current) – created sgranger
Line 1: Line 1:
-====== introduction ======+====== Update Workspaces Example ======
  
-you can use a pipeline to loop over a series of cmz files to update them (i.e. calculate measures you decided to create after creating the cmz files).+===== Introduction =====
  
-this can also be done by creating a series of smaller scripts (exgrf_impulse.v3s, temporal_distance_metrics.v3s) and storing them in one folder. the benefit of creating a series of smaller scripts is that they're often easier to test and debug than one long script. note that if name the scripts with numerals in front, they will be run in alphabetical order, so you can force the order the sub scripts are run (ex. 01_grf_impulse.v3s, 02_temporal_distance_metrics.v3s).+You can use a pipeline to loop over a series of CMZ files to update them (i.ecalculate measures you decided to create after creating the CMZ files).
  
-you can copy/paste the example below into visual3d/text file or [[https://www.has-motion.com/download/katie/fastfacts/cmo_loop.v3s|download the script here]].+This can also be done by creating series of smaller scripts (exGRF_Impulse.v3s, Temporal_Distance_Metrics.v3s) and storing them in one folder. The benefit of creating a series of smaller scripts is that they're often easier to test and debug than one long script. Note that if name the scripts with numerals in front, they will be run in alphabetical order, so you can force the order the sub scripts are run (ex. 01_GRF_Impulse.v3s, 02_Temporal_Distance_Metrics.v3s).
  
-===== example =====+You can copy/paste the example below into Visual3D/a text file or [[https://www.has-motion.com/download/Katie/FastFacts/CMO_Loop.v3s|download the script here]]. 
 + 
 +==== Example ====
  
 <code> <code>
 ! ============================================================================================ ! ============================================================================================
-update a group of cmz files+Update a group of CMZ files
 ! ============================================================================================ ! ============================================================================================
  
 ! -------------------------------------------------------------------------------------------- ! --------------------------------------------------------------------------------------------
-pipeline parameters+Pipeline Parameters
 ! -------------------------------------------------------------------------------------------- ! --------------------------------------------------------------------------------------------
  
-folder path containing data to be updated +Folder path containing data to be updated 
-notethis would be the top level folder: +NoteThis would be the top level folder: 
-!   c:\data +!   C:\Data 
-the data would then be in subfolders: +The data would then be in subfolders: 
-!   c:\data\sub01 +!   C:\Data\Sub01 
-!   c:\data\sob02+!   C:\Data\Sob02
  
-set_pipeline_parameter +Set_Pipeline_Parameter 
-/parameter_name=folder_path +/PARAMETER_NAME=FOLDER_PATH 
-/parameter_value=c:\data +/PARAMETER_VALUE=C:\Data 
-! /parameter_value_search_for+! /PARAMETER_VALUE_SEARCH_FOR
-! /parameter_value_replace_with+! /PARAMETER_VALUE_REPLACE_WITH
-! /parameter_value_prefix+! /PARAMETER_VALUE_PREFIX
-! /parameter_value_append+! /PARAMETER_VALUE_APPEND
-! /multi_pass=false+! /MULTI_PASS=FALSE
 ; ;
  
-specify where the scripts you want to run on each cmz file are located+Specify where the scripts you want to run on each CMZ file are located
  
-set_pipeline_parameter +Set_Pipeline_Parameter 
-/parameter_name=script_folder_path +/PARAMETER_NAME=SCRIPT_FOLDER_PATH 
-/parameter_value=c:\data\update_scripts +/PARAMETER_VALUE=C:\Data\Update_Scripts 
-! /parameter_value_search_for+! /PARAMETER_VALUE_SEARCH_FOR
-! /parameter_value_replace_with+! /PARAMETER_VALUE_REPLACE_WITH
-! /parameter_value_prefix+! /PARAMETER_VALUE_PREFIX
-! /parameter_value_append+! /PARAMETER_VALUE_APPEND
-! /multi_pass=false+! /MULTI_PASS=FALSE
 ; ;
  
 ! -------------------------------------------------------------------------------------------- ! --------------------------------------------------------------------------------------------
-get list of cmz files to update+Get List of CMZ Files to Update
 ! -------------------------------------------------------------------------------------------- ! --------------------------------------------------------------------------------------------
  
-set_pipeline_parameter_to_list_of_files +Set_Pipeline_Parameter_To_List_Of_Files 
-/parameter_name=cmz_list +/PARAMETER_NAME=CMZ_LIST 
-/folder=::folder_path+/FOLDER=::FOLDER_PATH
-/search_subfolders=true +/SEARCH_SUBFOLDERS=TRUE 
-/file_mask=*.cmz+/FILE_MASK=*.cmz
 ; ;
  
 ! -------------------------------------------------------------------------------------------- ! --------------------------------------------------------------------------------------------
-get list of scripts to run+Get List of Scripts to run
 ! -------------------------------------------------------------------------------------------- ! --------------------------------------------------------------------------------------------
  
-set_pipeline_parameter_to_list_of_files +Set_Pipeline_Parameter_To_List_Of_Files 
-/parameter_name=script_list +/PARAMETER_NAME=SCRIPT_LIST 
-/folder=::script_folder_path+/FOLDER=::SCRIPT_FOLDER_PATH
-/search_subfolders=true +/SEARCH_SUBFOLDERS=TRUE 
-/file_mask=*.v3s+/FILE_MASK=*.v3s
 ; ;
  
 ! -------------------------------------------------------------------------------------------- ! --------------------------------------------------------------------------------------------
-process each cmz+Process Each CMZ
 ! -------------------------------------------------------------------------------------------- ! --------------------------------------------------------------------------------------------
  
-for_each +For_Each 
-/iteration_parameter_name=current_cmz +/ITERATION_PARAMETER_NAME=CURRENT_CMZ 
-! /iteration_parameter_count_name+! /ITERATION_PARAMETER_COUNT_NAME
-/items=::cmz_list+/ITEMS=::CMZ_LIST
 ; ;
  
-    ! clear the workspace+    ! Clear the Workspace
  
-    file_new+    File_New
  
     ;     ;
  
-    ! open one cmz file+    ! Open one CMZ file
  
-    file_open +    File_Open 
-    /file_name=::current_cmz +    /FILE_NAME=::CURRENT_CMZ 
-    ! /suffix+    ! /SUFFIX
-    ! /set_prompt=file_open +    ! /SET_PROMPT=File_Open 
-    ! /filter=+    ! /FILTER=
     ;     ;
  
     ! --------------------------------------------------------------------------------------------     ! --------------------------------------------------------------------------------------------
-    ! run scripts+    ! Run Scripts
     ! --------------------------------------------------------------------------------------------     ! --------------------------------------------------------------------------------------------
  
-    ! loop over each script in the update script folder+    ! Loop over each script in the Update Script folder
  
-    for_each +    For_Each 
-    /iteration_parameter_name=current_script +    /ITERATION_PARAMETER_NAME=CURRENT_SCRIPT 
-    ! /iteration_parameter_count_name+    ! /ITERATION_PARAMETER_COUNT_NAME
-    /items=::script_list+    /ITEMS=::SCRIPT_LIST
     ;     ;
  
-        ! run the current script+        ! Run the current script
  
-        call_script  +        Call_Script  
-        /script_file_name=::current_script +        /SCRIPT_FILE_NAME=::CURRENT_SCRIPT 
-        ! /script_path=+        ! /SCRIPT_PATH=
         ;         ;
  
-    end_for_each +    End_For_Each 
-    /iteration_parameter_name=current_script+    /ITERATION_PARAMETER_NAME=CURRENT_SCRIPT
     ;     ;
  
-    ! save cmz file+    ! Save CMZ File
  
-    file_save +    File_Save 
-    ! /set_prompt=save cmo file+    ! /SET_PROMPT=Save CMO file
     ;     ;
  
-    ! clear the workspace+    ! Clear the workspace
  
-    file_new+    File_New
  
     ;     ;
  
-end_for_each +End_For_Each 
-/iteration_parameter_name=current_cmz+/ITERATION_PARAMETER_NAME=CURRENT_CMZ
 ; ;
 </code> </code>
visual3d/documentation/pipeline/file_commands/update_workspaces_example.1718801440.txt.gz · Last modified: 2024/06/19 12:50 by sgranger