In addition to the typical CATIA part properties such as ‘Part Number’, ‘Revision’, ‘Description’, etc., many companies utilize the “Define other properties” button and add a handful of their own added properties.  These show up as “user parameters” but are not very obvious how they can be used in a CATIA script and many people struggle to figure out how to set a string equal to a specific added property.

For this specific example, let’s say we have an added property called “New_ID” and we would like to compare it to the part number.  Maybe this fictional company uses SmarTeam for PDM and they let the assigned document number be their part number if it’s a made part. Currently, their problem is that they have to manually copy and paste to make sure that the number is the same in both the SmarTeam Profile Card and the CATIA Document Properties – the SmarTeam ID is mapped to “New_ID” field in the CATIA document added properties. We need to automate the task of matching the New ID to the part number by figuring out how to set a string variable to equal the value of that field.

I wrote a CATIA macro to determine if the “New_ID” string matches the Part Number. This CATScript example works on a single product that only contains CATParts and assumes every part has the NEW_ID property. The code cycles through each part and checks the NEW_ID with the partnumber and displays a message box saying if they match or not.

The entire code for this example is below, but most importantly, I get the Smart Team ID from the Added Properties into a string variable with this line of code:

This same code can be used to access thickness, material, mass, and more.