We have set up a counter allowing the coding of 3D SolidWorks files and we would also like to increment our other files independently (SolidWorks plan, DWG, Office, PDF, ...).
Is it possible to create a PDM counter to do this by embedding this code directly in the file name at registration ?
I created a PDM serial number and integrated into the data card of these non-3D files but you have to enter this code manually in the file name.
If you are on PDM pro, you have via the PDM add-in in SOLIDWORKS the possibility to configure the naming of your files with an automatic implementation of a counter.
To do this, you must first create serial numbers via the Administration. In these service numbers you have the possibility to put a hard name, different meters and a lot of other parameters.
The configuration can be done via three options: Part - Assembly - Drawing.
For the other extensions, you will have to go through a dispatch. I don't have a script to give you though.
Hello and thank you for this feedback, it's nice to see someone from Visiativ on this platform, especially to answer technical questions ;-)
My question concerns files outside of 3D SolidWorks so this setting is not suitable.
When you talk about "dispatch", what does it mean?
At the moment, the only thing I've managed to do is create a counter variable in the data map of these file formats in a given folder, but you have to add this counter number manually as a suffix in the file name. which we would like to avoid by finding a solution so that it does it automatically, as for the 3D SolidWorks.
In the Administration Guide, starting on page 99, you will find an explanation of Dispatch and the procedure for installing and scripting.
I can't help more, I don't master the creation of dispatch scripts and it doesn't fall within the scope of support. On the other hand, there are quite a few existing posts on the subject on the forum.
We have created a template for excel files (but I think it can be done for other extensions), for which we generate the file name according to the counter. This is done exactly like a Part or Asm template, but with an excel file. On the other hand, it can be cumbersome if you want to do it for all possible extensions...
Another solution: the file is created with the default name, and a SmarCounter (available in PDMTools) is incremented in a variable of the data map, then a rename is done either via a transition or via a dispatch (but I find dispatch a bit cumbersome and unstable).
I've already created the variable present in the counter-incremented data card that we actually want for all non-SolidWorks extensions.
But you have to manually integrate this number into the name, that's what I would like to make the recording automatic and without going through a transition.
Dispatch must know how to do it apparently but I don't see how...
I'm not very familiar with Dispatch but by selecting the "During adding" action and selecting all the folders (or only the desired ones), then in the commands by adding the action "Move/Rename file" that you then have to set by calling the right variable it must be doable! Be careful for Dispatch you must have created a variable specific to Dispatch which will itself take the value of the variable of the data card, and only this "Dispatch variable" can be used for renaming.
Thank you romain.jouanny for your help, it allows me to move forward on the subject!
I followed Activation "During addition" / add action "Move/Rename file" but it's the setting that I don't have to do well. I tried several "New path or name of" but nothing helped.
I did create the Dispatch variable using the data card variable but I get this error message and the file is saved as if there was no action:
I think you just need to change your first line "path to the file to move" by the variable %PathToSelectedFile% instead of %name...% to point to the selected file
The second line should be ok. I just have a doubt if launching the dispatch at the time of adding will work, because I don't know if at that time the counter variable will already be incremented. You can already test by triggering the dispatch by the menu command (right button) rather than by adding.
On the first action settings window, in the 'Activation' section, the first checkbox is 'Menu Command'. Check it and right-click the name of the menu you want to appear.
if it still doesn't work, try replacing the 'New filename' with a generic text ("Test.pdf" for example). If it works, it's because your problem comes from the counter that shouldn't be initialized, or because there is no extension.
If I understand correctly, you want to rename a file (outside 3D) using the value of a variable present on your data card, itself from a PDM counter and this by going through the context menu of the file?
This is possible via the development of a PDM add-in but provided that you either know a little about programming (in advanced mode anyway) or by going through your reseller who should be able to do this for you, here is already for the example the code of an add-in allowing you to display a message following an action by right-clicking, see HERE or HERE. Such an add-in, if it is well written, can also be used in right-click mode or during a transition through an EPDM task.
So this means in my opinion that the variable you use for the renaming did not take the value of your counter at the time of the renaming. Can you show how you set up the variable of the data card that increments, and the dispatch value that copies this value before using it for renaming?