Using the scripts - icub-tech-iit/cad-libraries GitHub Wiki

Script to generate .pdf and .step documentation

This procedure will show how to automatically obtain .pdf and .step production files starting from a list of desired files.

Enabling PowerShell scripts

First of all, it's necessary to enable the execution of PowerShell scripts on the current PC.

  1. Start Windows PowerShell ISE (x86) with the "Run as Administrator" option.
  2. Enable running unsigned scripts by entering:

Set-ExecutionPolicy RemoteSigned

and then confirm with the option "yes to all". This will allow running unsigned scripts that you write on your local computer and signed scripts from the Internet.

Important: this operation has to be done only once, and then Windows will remember the setting.

Writing the required code list

The scripts are in a subfolder inside cad-libraries called scripts. Typically, the workflow starts from a list of required components whose production files (both .pdf and .step) are requested. Inside the folder there is a .txt file called input_codes.txt.

image

This file must be compiled, writing the names of the required files, excluding the extension.

image info

This file will be a piece of input information for the script.

Important: in the example above, we are considering a three-item list whose corresponding CAD files can be found in the search paths specified inside the script export_docs.ps1, at line 93:

$folders = '\projects\icub\icub1_icub2','\projects\icub\icub3' | foreach { $root_dir + $_ }

If the files are not included in the specified search paths, this line must be CAREFULLY modified (ASK before).

Running the script

  1. Start Windows PowerShell ISE (x86) (is not necessary Administrator mode)
  2. From the toolbar: file/open and locate the export_docs.ps1.

image info

  1. Click on the "play" button.

image info

The script will run and generate an auto_trail.txt file inside a subfolder in the output_dir folder. This subfolder will have a "talking" name showing its creation date, so it will be easy to identify it.

image info

In this case, the subfolder has been created the 6th of August 2020, at 16:22 and 38 seconds.

Creating the .pdf and .step files

  1. Open Creo and click on "Play Trail File" button
  2. Locate auto_trail.txt inside the aforementioned subfolder

Foto1

  1. The trail file will run and inside the aforementioned subfolder will generate required .step and .pdf files.

image info

Cleaning the output_dir temp

After having produced the required documentation, it is strictly forbidden to commit the files generated in the output_dir folder, that must be cleaned at the end of the process.