The GICL Bot is an automatic system that semantically annotates pages and converts CAD files on a MediaWiki website. Specifically, it automatically:
- updates pages with zip files and changes their links to link to zip file "content pages"
- The GICL Bot puts a comment next to its changes on this page so they are clearly distinguished from others' changes
- creates content pages from the zip files in the form "<filename> Contents"
- converts the files using help from the computer "tetrahedron" and SolidWorks
- makes the conversions and original files available directly on the contents page
- creates metadata pages for each original file in a zip file that links to the correct format
- The Python script file contains a mapping of file extensions to format names that needs to be kept up-to-date
To run the script, first you must log in on tetrahedron and run the executable located at C:\cygwin\home\Scanner\solidworks\CAD Converter.exe. This program converts files that edge uploads. You can press Ctrl + C to kill the process.
Then, you must log onto edge.cs.drexel.edu with SSH, run as root (because the necessary Python libraries are only available when you are root), change to the directory "/export/gicl/giclbot" and execute "python main.py". The script will enumerate through every page on the GICL wiki and semantically annotate pages and convert files.
You can run the script multiple times safely. If a page does not need to be updated, the script will leave it alone.
Currently, it takes about 10 minutes to enumerate through and check approximately 2000 pages in the wiki to see if they need to be updated, without performing the file conversions. It takes much longer when performing the file conversions.
The process of converting files is tricky because SolidWorks only runs on Windows and the Python script runs on edge. The system is built to perform the conversions securely with SSH, SCP, and SFTP. Here are the steps:
- The Python script, running on edge, finds a CAD file which it thinks can be converted by tetrahedron
- The script copies the file to 188.8.131.52 with SCP using tetrahedron's private key
- We can't use the Windows host name tetrahedron and must use the IP address instead. Therefore, if the IP address of tetrahedron changes, be sure to change it in the Python script too.
- The Python script waits 5 minutes for tetrahedron to convert the files. If it does not convert in time, the script assumes there is something wrong with tetrahedron and fails.
- The program "CAD Converter.exe" on tetrahedron notices the new file and starts up SolidWorks with a macro. The macro converts the file to many other formats and deletes the original.
- The Python script notices that the original file has been deleted with SFTP, signifying that the conversion is complete.
- The script downloads the converted files to a conversion directory, deletes the files on tetrahedron, and links to the files on the wiki.
- The program "CAD Converter.exe" notices that the Python script deleted the files and terminates SolidWorks.
- The process repeats when there are other files that need to be converted.
Dd chuck assem.zip Contents
Currently, the script cannot correctly convert the stp file in Dd chuck assem.zip Contents and fails when it reaches this file. This is because opening the step file extracts assembly and part files in the same directory and opens the assembly file name instead of the step file name, and the SolidWorks macro currently does not handle this edge case.
CAD Files with Errors in Them
The SolidWorks macro fails when there is an error in the file it is trying to convert, showing an error dialog. I don't think SolidWorks provides a way to not show the error dialog. For instance, Film Canister.stp in Kodak Camera 2D Drawings in STP format.zip Contents does not load in SolidWorks and causes the conversions to stop.
Remnant Wiki Pages
If a zip file is renamed or one of the content files is renamed, there will be leftover wiki pages that refer to the old names. The script currently does not perform any page deletions.