Hi all
I'm trying to move files via dispatch, but I'm hitting a wall.
Today, our files are saved in three folders that contain all the files of the same type: PLAN, PART and ASSEMBLY (historical architecture for us, and not always practical)
We want to group all the files related to a reference (part, SW and PDF plan , etc.) in a folder named after this reference. For example, a file CP012539.sldprt is stored under a part, along with all the other sldprts. We want to save it in a CP012539 folder, with the CP012539.slmdrw plan, the PDF CP012539.pdf, etc.
Via the dispatch, I can't make this transfer automatic:
Between the classic beginning and end of the block, I inserted the following line:
Source File Path: %PathToSelectedFile%
new path: C:\_COFFRE\PRODUCTION\Left(%NameOfSelectedFile%, 8)\%NameOfSelectedFile%
In theory, Left(%NameOfSelectedFile%, 8) gives me the file ref, extracted from the name of the source file, without its extension, and I figured that by framing it with \, it would turn into a folder.
Then, classically, %NameOfSelectedFile% refers to the name of the source file, which is preserved.
Except that when I launch this task, it moves my source file (so far so good), but without creating a folder, and worse, removing its extension!
If I only try to create a folder with similar code, it works just fine.
Pb, I can't transfer files in it automatically (I would have to rewrite the code for each reference....)
Anyone have a tip?