save / post to windows file path script

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hard to come up with a good title for this one.
My background in programming is limited. I know enough to read through programs and somewhat understand what they are doing. I program PLC's and Robots using script languages regularly, as well as other automation type stuff.
At work we run into an issue where we are not that organized. The companies server is a free for all, and with multiple people programming for the machine shop I wrote a SOP for our companies filing methods so the machinists can find the files and setup sheets they need to run jobs.
What I would like to do, is write a python script that would post the setup, generate the setup sheet, and follow my SOP for file organization.
Something like this.
When the part is programmed and finished, run the script on setup 1 and have it look at our server (Z:Customer Files)
Say the part number is AB1234.9876 Our customer number is AB1234 and the part number is 9876 in that case.
I would like the script to
look for Z:/Customer Files/AB1234/CNC Programs/AB1234.9876
If found true
look for Z:/Customer Files/AB1234/CNC Programs/AB1234.9876/Op1
If found true
Post NC file and Setup sheet in folder
Else
Create Op1 Folder and Post NC file and Setup sheet in folder
Else
Create AB1234.9876 folder
Create Op1 Folder and Post NC file and Setup sheet in folder
I would like my file names in fusion to drive creating the correct folders and sub folders on the server so that the employees are not left creating them on their own. The problem we run into is everyone has their own twist, or try to cut a corner to make their job easier, and at the end of the day, the machinist cannot find the file they are looking for, or end up with multiple versions saved in different locations. We have 3 separate programmers all saving programs like its the wild west and once every month or two I have to take a day or two to completely inventory and fix our server file structure.
Like I said, I have an understanding of how the code works, but I do not have enough experience to tie it all together. If anyone could even give me a small chunk of code to point me in the right direction so I could build off of it that would be greatly appreciated!
Ultimately, a custom button to run the script would be the ultimate goal.