PDM data card variable to custom property (attribute) mapping; when will it automatically add the custom property?

Installation, PDM, standards, training, support, part numbering, rev schemes, etc.
User avatar
bnemec
Posts: 1850
Joined: Tue Mar 09, 2021 9:22 am
Answers: 10
Location: Wisconsin USA
x 2435
x 1330

PDM data card variable to custom property (attribute) mapping; when will it automatically add the custom property?

Unread post by bnemec »

This is probably a stupid question that I should be able to figure out through the help pages but I'm asking for help anyway. I've tried the help pages on this topic, but it leads me on a multi day process of searching the jargon with many browser pages open. At the end I still don't understand this. It's been an on-and-off problem since we started ~18 mo ago, I would like to get a fundamental understanding of how this works.

What is the mechanism that adds custom properties to the Solidworks file for mapped data card variables?

A few things I think I know, if wrong please point out to me as those are probably my stumbling blocks that need to be unlearned:
- in PDM it's called "attribute" mapping but in Solidworks they're called custom properties; same thing different name in different place?
image.png
- it's ok to not load up the Solidworks file templates with these attributes, just let PDM automatically add them.
- pdm only adds these attributes to the custom properties block one time (at initial check in or file add?)
- if for whatever reason the file no longer has these attributes PDM won't add them a second time.
- the attribute data in the file is updated from PDM variable data in database only at "Get" operation.
- the PDM variable data in database is updated from the file data only at check in.

Thank you.
User avatar
jcapriotti
Posts: 1792
Joined: Wed Mar 10, 2021 6:39 pm
Answers: 29
Location: The south
x 1131
x 1940

Re: PDM data card variable to custom property (attribute) mapping; when will it automatically add the custom property?

Unread post by jcapriotti »

bnemec wrote: Wed Apr 07, 2021 10:04 am What is the mechanism that adds custom properties to the Solidworks file for mapped data card variables?

- in PDM it's called "attribute" mapping but in Solidworks they're called custom properties; same thing different name in different place?
You are correct. I think the "Attribute / Block" name must be some left over from the "Conisio" days and a reference to AutoCAD.
bnemec wrote: Wed Apr 07, 2021 10:04 am - it's ok to not load up the Solidworks file templates with these attributes, just let PDM automatically add them.
Yes, although we revision/workflow control our templates so some are populated with the template values but get overwritten when making a drawing/model. You could put some default values and leave them in place to save time. We use a separate Property Editor tool we created to add/edit custom properties since we have complicated part families with multiple configurations
bnemec wrote: Wed Apr 07, 2021 10:04 am - pdm only adds these attributes to the custom properties block one time (at initial check in or file add?)
This is a bi-directional link. If you "add" a SolidWorks file to the vault that have these properties already in place then it will populate the mapped variable on the data card. Changing the values on the data card changes the file's properties.
bnemec wrote: Wed Apr 07, 2021 10:04 am - if for whatever reason the file no longer has these attributes PDM won't add them a second time.
PDM will add them if values are passed from the data card and saved manually. If you leave the variable empty, nothing gets passed to the model except default values on creation. If you delete the custom properties, PDM won't add it back unless you type something in the data card and save, and even then it's only the variable edited.
bnemec wrote: Wed Apr 07, 2021 10:04 am - the attribute data in the file is updated from PDM variable data in database only at "Get" operation.
"Get" will cache a copy of the file locally. The data card values reflect custom property values from the version cached. If no version is cached, you see values from the database.
bnemec wrote: Wed Apr 07, 2021 10:04 am - the PDM variable data in database is updated from the file data only at check in.
True. There is a local save option while checked out. I'm uncertain if it stores it locally only or passes something to the DB, but I know other users can't see the changed values.
Jason
User avatar
Diaval
Posts: 87
Joined: Wed Mar 17, 2021 12:01 pm
Answers: 7
Location: Stockholm
x 50
x 110

Re: PDM data card variable to custom property (attribute) mapping; when will it automatically add the custom property?

Unread post by Diaval »

There are a few additional things that you should know about variable mapping with PDM data cards.

On the initial check in, PDM will pull the values from the file for any variable that has been "mapped" to an attribute of the file metadata and store these values in the database. But on the file data card, each control has the option to set a Default value and if that value should overwrite any existing values it finds in the file.
Default values.png
This is the section for setting default values for an edit box on the file data card. I also included the flags to explain how Update all configurations differs from the Excluded configurations option for default values.

If a default value has been set for a variable, and the Default overwrites option has not been enabled, the file will not be given the default value if it finds an existing value in ANY configuration of the file.

If I want my files to always get the default value, regardless of what value the file may have, I need to enable the Default overwrites option. This will push the value into all configurations of the file, except configurations specified in the Excluded configurations section. Note that this section is only used when setting the default value at the time the file is first added to the PDM vault. Once a file has been added to the vault, Default values options no longer apply.

Default values will get set for all configs no matter if Updates all configuration is enabled or not.

The Updates all configurations option deals with what configurations will be updated when the variable is changed from the PDM data card. Note that PDM does not control updating all configs if the variable is changed via other methods such as the File Properties dialog of SolidWorks. Because reading and writing variable values is bi-directional, PDM will properly update config specific values in the database for variables set to Update all configurations on the data card if the value is changed via other methods.
-- To espouse elucidation we must eschew obfuscation
User avatar
bnemec
Posts: 1850
Joined: Tue Mar 09, 2021 9:22 am
Answers: 10
Location: Wisconsin USA
x 2435
x 1330

Re: PDM data card variable to custom property (attribute) mapping; when will it automatically add the custom property?

Unread post by bnemec »

@jcapriotti and @Diaval ,
Thank you for these detailed responses, they make more sense to me.

The line by line correction or confirmation of what I listed is very helpful especially confirming that the file attribute will be added back to the file, but only if the data card variable is not blank. Based on your response applied to what I'm seeing, I think what might be happening to us is the file is checked out and overwritten with a new file that was started over from template. Sometimes the user determines for whatever that a drawing for example would be better off starting from scratch. It sounds like our users have mostly learned (finally) that if a file is deleted and a new one saved with the same name it's a new file as far as PDM is concerned. After many reminders to not delete and replace but rather check out and do a save as if they >must< restart the drawing or model that is what they may be doing. So the new file doesn't have the custom properties/attributes then when it's checked in PDM clears the data card variables that are mapped to the attributes that are no longer there. Then the next time the file is "get" the attributes aren't automatically added because the data card value is blank so the user must manually add those values back in, part number and description for example. At least I think that's what's happening.

@Diaval Thanks for expounding on the "Default overwrites" check box. After hearing that it makes much more sense. Be nice if your red text in the screen shot could be loaded into tooltips for those controls.

From the help page:
image.png
image.png (5.28 KiB) Viewed 4439 times
Ok, I get that I guess, but this is a new file what could be in there to over write? Well, as you pointed out it's all order of operations, first would be whatever is in the templates if the variable is mapped to an attribute. Next would be what the user entered if set up to show the data card when file is first saved, then comes these defaults on check in?
User avatar
jcapriotti
Posts: 1792
Joined: Wed Mar 10, 2021 6:39 pm
Answers: 29
Location: The south
x 1131
x 1940

Re: PDM data card variable to custom property (attribute) mapping; when will it automatically add the custom property?

Unread post by jcapriotti »

@bnemec Overwriting a checked out file with replace variables on the data card with values in the
SolidWorks file that are mapped. We have a procedure for this that the users must follow.
  1. Use drag and drop, not "save as" to overwrite a checked out file in the vault with another file.
  2. After dragging and replacing the checked out file, select the file then "Modify\Update\File Attributes from Database"
That last steps overwrites the locally changed data card values with the values stored in the DB for the current version.
image.png
Jason
User avatar
bnemec
Posts: 1850
Joined: Tue Mar 09, 2021 9:22 am
Answers: 10
Location: Wisconsin USA
x 2435
x 1330

Re: PDM data card variable to custom property (attribute) mapping; when will it automatically add the custom property?

Unread post by bnemec »

jcapriotti wrote: Thu Apr 08, 2021 6:20 pm @bnemec Overwriting a checked out file with replace variables on the data card with values in the
SolidWorks file that are mapped. We have a procedure for this that the users must follow.
  1. Use drag and drop, not "save as" to overwrite a checked out file in the vault with another file.
  2. After dragging and replacing the checked out file, select the file then "Modify\Update\File Attributes from Database"
That last steps overwrites the locally changed data card values with the values stored in the DB for the current version.

image.png
1) May I ask why? I've been cautioned about drag and drop in PDM. Also, I try to get people to use Search tool or the SW PDM Add-in so drag and drop may not be ideal. Are there big differences? Please don't say that Solidworks does the same thing as Solid Edge when saving a new file. Solid Edge will create the file, delete the file, save the file then modify it all in rapid succession. It's the delete that scares me, if PDM catches that then it can get messy. Will step two not work reliably if the file was overwritten with save as?

2) I need the mind blown emoji here. That's so cool. Although I'm embarrassed I had not discovered/remembered that.
User avatar
jcapriotti
Posts: 1792
Joined: Wed Mar 10, 2021 6:39 pm
Answers: 29
Location: The south
x 1131
x 1940

Re: PDM data card variable to custom property (attribute) mapping; when will it automatically add the custom property?

Unread post by jcapriotti »

@bnemec

Preference so you can run step 2 immediately after. If the file is open when you try step 2, it won't update the custom properties when you run the command.
image.png
image.png (9.9 KiB) Viewed 4416 times
Jason
User avatar
bnemec
Posts: 1850
Joined: Tue Mar 09, 2021 9:22 am
Answers: 10
Location: Wisconsin USA
x 2435
x 1330

Re: PDM data card variable to custom property (attribute) mapping; when will it automatically add the custom property?

Unread post by bnemec »

jcapriotti wrote: Fri Apr 09, 2021 12:56 pm @bnemec

Preference so you can run step 2 immediately after. If the file is open when you try step 2, it won't update the custom properties when you run the command.

image.png
Oh yeah. I wasn't thinking that through.

This is going to get tough, I've been pushing users to not use vault view in explorer for several reasons. Now I'll have back peddle and say, "except for overwriting a file, then you need to use explorer." Would be nice to have those functions in the PDM-Add-in, but I'm not finding the option there; although my record for simple observation is less than stellar lately.
image.png
User avatar
jcapriotti
Posts: 1792
Joined: Wed Mar 10, 2021 6:39 pm
Answers: 29
Location: The south
x 1131
x 1940

Re: PDM data card variable to custom property (attribute) mapping; when will it automatically add the custom property?

Unread post by jcapriotti »

Would be a nice option. You can open and edit the data card from within SolidWorks but not update file values from the DB.

We have our own in house developed custom property tool so we don't use the data card for SolidWorks much. It handles our part families (configurations) better than the data card.
Jason
Post Reply