Processing all part files in a directory
Occasionally you will need to perform a certain action on each part file in a given directory. This journal will prompt the user to specify a directory, then it will open each file found in the directory and do something with the file. In the case of this example it simply reports how many solid and sheet bodies the part file contains, but in a real usage scenario it may export all the drawing sheets to a pdf, export the solids to a .STP file, perform file cleanup, or well, whatever else you can code. Below is the code.