I would like to have an edit box's default value in a
datacard be the file name. If I choose "Special Value - File name"
for the default, I get the file name with the file's extension.
This is what I want; minus the extension.
Seems this would be a rather common request when the file name is the same as the part number. Anyone figured out how to do it?
Thanks in advance
Seems this would be a rather common request when the file name is the same as the part number. Anyone figured out how to do it?
Thanks in advance
This way, the PDMWE variable is populated with the filename (without extension) at Check-In.
It's basically what Lee stated above. Personally, I'm not crazy about filenames being our database identifiers, since it causes confusion when there are duplicate filenames in the vault, but it works for us since we have a separate folder for released (approved) files, and a relatively small installation of PDMWE.
Spencer
Spencer
However, if you use the section below called 'Input Formula', and select the FileName variable from the list that the arrow brings up, it brought in the filename without extension for me.
It will only work for files created beginning when you make the change, though, since it acts as an input mask.
Attachments
You must have a variable setup then for FileName. How do you have this variable configured (attributes, variable type, etc.) I am not able to reproduce this.
I have now created a variable, "FileName", and placed it in the input formula for another variable (in my case, "Number") as you have shown.
Any ideas?
Attachments
After some more testing, I was able to get this to work. I setup the variable to have a block name of $PRP with an attribute name of SW-File Name. I did not have to put anything in the default value or input formula fields for the card.
Also, I was interested in doing something similar with weight, density, and surface area. With these, I had to put in a default vaule in the card. For example, I used "SW-Mass@Part1.sldprt" for the mass of a part. If anyone has a better way of doing this, please let me know, because this seems to require at least two check-ins until the data is populated on the card.
See the screenshots below for more detail. Thanks to everyone for there input.
Attachments
Just checking...
why can't you create document templates for this? That should take care of the naming and variable writing...
Joy
Can a template be utilized during a drag and drop? If so, how is this setup, because then we could definitely use the templates.
No it cannot. You said in your earlier post that it was for new files, so, I assumed you were creating brand new files.
For non-CAD files (or better stated - files without references), you can use Dispatch to do the rename after adding the file to the vault. (see attached Dispatch example - you need to load the Dispatch.dll first - it can be found on the CD in the Support\Dispatch directory).
Since it uses Windows rename, this method should not be used on SW files as it does not fix references.
Joy
Attachments
Sorry to keep bugging you, but I'm not sure I totally understand this. From what I gather, this dispatch routine will take the "Document Number" value from the document's card and rename the file to that Document Number when adding the file to the vault. However, a file does not have a data card before it is added to the vault.
What I need is basically the opposite. I have a file with the correct file name already and want the "Document Number" value populated from that file name upon adding the file.
The problem I see is that it doesn't appear that dispatch can be used to populate a variable. Hopefully I'm wrong, because this seems like it should be possible.
Actually, it does it 'after' the file has been added. (see attached image)
Joy
Attachments
I'm not sure I understand what you are saying.
If I drag and drop a word document into the vault (actually to the users local cache), it gets 'added' to the to the vault. (The meta data is created by extracting custom properties values or via serial number generation - such as document number). So, the data card now exists at this point. The Dispatch routine then reads the value of the variable Document Number (which was created via automatic serial number generator) and uses this value to rename the file.
Joy
I've got it now. I didn't realize there was a serial number generating populating the Document Number variable. Sorry for the confusion and thanks for the help. I've got it working with a serial number now. However, I am still seeing the issue that the index.xml file on the server still refers to the file name before the rename.
And if you or anyone else knows, I'd like to know if it is possible to populate a data card variable with dispatch. This could solve a couple similar issues I have with renaming files and updating that Document Number variable.
Thanks again Joy for all the help. You've got me part of the way there.
I never noticed that it left the original name in the Index.XML file.
I'm looking into this. Why do you need the XML file to be correct?
Joy
Good question. I don't know why it needs to be correct. I've been unable to find out what this file is actually used for. I just wanted to make sure I'm not going to cause other issues down the road.
Actually, you shouldn't be poking around in the archive storage anyway :-)
But, I am also curious and want to know what the downstram impact is, if any, so I sent an inquiry to see what I can find out.
Joy