PDM Transition that will move files from one folder to another?

Hey everyone, just wondering if anyone would be willing to help me.

I would like to move files from one folder to another when that file is transitioned in PDM.

Anyone have any thoughts on how I can set this up?

I think it will need to be a dispatch addin that is run by a task. Would anyone be willing to share the addin text that they have running?

Thanks in advance for any help.

I think this is what you might be looking for, but IIRC there’s some concern about what exactly happens when any of the where used files are checked out, at any level of the where used tree. Or if the file happens to be open in Solidworks when the task is triggered, which is normal if the user is using the PDM add-in to do PDM actions.

https://www.javelin-tech.com/blog/2017/01/solidworks-pdm-dispatch-action-move-file/


The help page has a link to related KB articles that you might want to skim through before trying this. Moving/Renaming files in vault can work in the right scenario but requires care.

https://help.solidworks.com/2019/english/EnterprisePDM/Admin/IDD_DLG_MOVE_FILE.htm?id=a21b2ffc32ee4d58bf37775528f7e2e8#Pg0

https://kbsw.3ds.com/mashup-ui/page/sldwks_kb4cp?q=Move%2fRename+file+Dialog+Box&onesearchpocfeed.r=%2Bf%2Flanguage%2Fenglish&source=customerportal_enu

1 Like

We do this with a dispatch script that triggers after a transition on our workflow. Pretty simple.

The catch is if you have these files open in SolidWorks, then it will cause an error. For us this is done at the end of a workflow for files that we no longer use so it’s not likely the user would have them open.
image.png

2 Likes

hello, any help possible on this - we are wanting to get files that go from WIP to archive, or Eng released to obsolete to be moved to an archive folder within the project…

im struggling to get it to do anything other than drop then in the root folder archive folder..

cant find any help with the actual path links online atall…

thanks in advance!

andrew.gunstone Are you trying this with Dispatch or the API?

Here is a little update on my situation.

I originally needed this ability because we are looking at migrating a lot of CAD data to our PDM vault from a network folder location. I didn’t want to worry about moving the files into other folders within the PDM system during the migration (long story, don’t ask).

I found a free tool from EquivaQ Software that moves a file during transitions. I have set this up in a test vault and it seems to be working great. We have not migrated the data into the production vault, but I don’t think there will be any issues.

Here is a link to the website for the add-in: https://equivaq.com/product/move-file-tool

I will note that the documentation for the add-in is out of date. I contacted their support and got help through emails.

Hello sorry i didnt see your response.

im trying dispatch - we have project folders like this:

Project 1
01mechanical CAD
02electrical CAD

Project 2
01
02

etc..

we want dispatch to chuck all files that are obsolete or archived into the archive folder that is within 01mechanical CAD folder


What i was trying to do was use %CurrentFolderPath%\02 CAD FILES\01 MECHANICAL CAD\ARCHIVE%NameOfSelectedFile%

but it chucks the files at the vault root folder in an archive folder..

Here is a link to the website for the add-in: https://equivaq.com/product/move-file-tool

This add-in is exactly what I am looking for. I wanted to see if anyone has an update on this tool. Are you still using it 3 years later?

It says I can get an annual subscription for it to be renewed. I don’t want to be screwed out of a solution in a few years by having management wondering why something isn’t working anymore.

Maybe someone has another solution for the move files?

You can use Dispatch tied to a transition to handle this. Just make sure the user has the files closed or it will error. Best handled at the end of a workflow like during a “Release” transition.

This is ours, it moves a file that is replaced by another filetype. Like when we redraw an AutoCAD drawing in SolidWorks. The Autocad drawing doesn’t tranition to “Release”, instead it goes to a state “No Longer Used” and this script moves the file from its current location to another folder. Permissions on the state insure most users no longer see the file.

You can load in the acn file into your dispatch…not much to it.
Move File to no longer used.zip (456 Bytes)

1 Like

We still use this add-in today. It still works great. It has not been updated though.

1 Like

Thanks for sharing! I will give this a try.

My workflow has 3D files being stored in a folder location of a similar directory as my PDF’s and DWG’s

PDM/Job#/CAD - for all solidworks files

PDM/Job#/Released - all drawings will create a PDF and DWG that are stored here

I am looking at keeping the current revision in the Released folder while moving the old revision PDF’s and DWG’s to PDM/Job#/Released/Archive. The move files would take place when approved transition is triggered.

FYI, I am new to Dispatch, so this will be my first attempt at making this work. We’ll see how this goes!

@VicFrauenfeld Thanks for responding! I appreciate the update

As long as its PDF and non-referenced DWGs, I think it should be fine. I would avoid using this to move SolidWorks files around as the system will update the internal file references and it can take some time.

@jcapriotti

I notice that you do not have the file type at the end of the path for the Move/Rename file type. Is this not required?

I am confused because the pop-up is showing that the path example being %\project\%.bmp for .bmp files

If the solidworks file name that I am making the workflow transition with is the same as the PDF file, then I can use file variables → %Name of Selected Files%.pdf??

Also if the PDF and solidworks file are in different folders, what would make my method correctly point to the pdf file location?

I did try the file you uploaded but I was not successful.

Edit: I am confused about what to put in the during state transition path. Should I be using %.pdf or %.slddrw

I’m moving and not renaming. So the variable %NameOfSelectedFile% covers it the complete filename.

The transition condition dialogue is %, just means apply to any file going through that transition. If you put %SM.slddrw then only SolidWorks drawings that end in SM would get processed. you could also but folder paths with wildcards as well and limit it further.

Are both your SolidWorks files and PDF using the same workflow and states? If so, you can put %.pdf in the Path condition. If they have a different workflow and state, then the Target workflow.state droplist covers you. We have a separate workflow for PDFs. So the workflow (EngineerinFile Workflow) and state (No longer used) in my dispatch script only contains “Drawings/Models” files that can be SolidWorks, AutoCAD, Word, Excel, or TIFF format. This no longer used state only really occurs when we switch between file formats, like a TIFF getting redrawn in SolidWorks.

1 Like

My final workflow state “Released for Production” creates a revision, then creates .pdf & .dwg as an action. but the file name actually changes to add the revision number at the end of it for the .pdf and .dwg files.
If I use %Name of Selected FIle%, it contains the name of the file and its extension .slddrw. If I understand correctly, I need to have %Name of Selected File% include that revision at the end and include file extension .pdf or .dwg?

%Name of Selected FIle% includes the extension. In order to “insert” the revision you need to create some user variables in dispatch to get the part of the filename before the “.” and trim off the rest. Then you can build another user variable with that variable and then pull the revision letter from the datacard. Disecting the filename gets a bit complicated with user variables, I tried nesting a few of the commands and it didn’t seem to work so created them separate.

Wrote this as a test, just a message box to check what it will do. Look at user variable to see how I’m breaking out each part then reassembling. Might be a better way though.


Test rename.zip (604 Bytes)

For context on the future of Equivaq support. Tim Webb used to run Equivaq, but closed shop and sold the business to MLC CAD. We used to use Tim’s services as a consultant and used at least one of his macros. It sounds like MLC is committed to keeping these macros running, updated, and provide support. I would be surprised to hear they add any new ones, but who knows.

2 Likes