PDM counter on non-3D SolidWorks file possible by including it in its name?

I integrated Dispatch into the administration and created an action but I don't see how I can get my PDM counter and include it in the file names...

Can anyone help me?

Hello 

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).

1 Like

Hello and thank you for this feedback.

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.

1 Like

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:


dispatch_-_deplacerrenommer_le_fichier.png

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.

1 Like

Thank you for your feedback. I modified the Dispatch as advised but still the same message at registration and no increment in the name.

I don't see where you can trigger the dispatch by the menu command (right button).


dispatch_-_deplacerrenommer_le_fichier_2.png

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. 

2 Likes

I don't know if we'll get there but I thank you for your help and patience romain.jouanny ;-)

I checked the 'Menu command' box but when I validate the command on the file, I get the same error message and it doesn't rename it.

Also, when I check in a new file it renames it directly at insertion "0" by removing the file extension when I save to the folder.


dispatch_-_modifier_laction.png

I have the impression that the renaming action starts by trying to rename your file with an empty value (0).

Try this:

  1. - uncheck the box "while adding"
  2. - create a file and archive it
  3. - Right-click the dispatch action.
1 Like

Hello romain.jouanny,

It does the same, renaming "0" without extension...

Hello

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.

Kind regards

1 Like

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?

1 Like

Here is in order:

  1. Meter configuration (serial number)
  2. The PDM data card variable
  3. Dispatch with the resumption of this variable

However, everything seems to match...


compteur__variable__dispatch.png

Hello

Have you tried with a Dispatch variable name without spaces, parenthesis, letters with accents and less long too?

Counter files out of 3D (PDM serial number) could be called NV_NOM for example

1 Like

I renamed everything Dispatch (variable, action) to Compteur_hors_3D but it does the same.

When you archive the file for the first time when it was created, does the data map variable "JAN_CODE..." " takes the value of the incremented counter ?

If so , I don't see why the dispatch action would rename to "0" since your dispatch variable "Counters files out of 3D... " should copy "JAN_CODE" and then use it to rename... To check in the list of dispatch actions you can add a "Message OK" action in the first line that you configure to display the value of "Non-3D file counters". What does it display?

For the extension it's more complex. You lose it because the rename action replaces ALL the name (including the extension) with the content of the variable. You will have to use string functions to retrieve the current extension from the filename (copy the characters to the right of the "." ) and concatenate them to the new filename. Not intuitive but it can be done ;)

1 Like

Yes, I find the value of the meter in the data card where "JAN-CODE" is set.

I'm looking at the stocks on Monday.

Have a nice weekend.

I've already tried to add the "OK message" but it does exactly the same.

I must have set it up incorrectly:

 


message_ok_-_definir_les_variables.png

Well I give up, we'll add it by hand in the cases concerned because no matter how much I tried a lot of things, nothing helps.

Thank you all for your help, especially romain.jouanny !