Those properties of the columns are stored as extended properties of the table itself. In the example code I’ve included below, I’m calling the AFTable public method GetExtendedProperty() with the name of one of the columns in my table, along with the name of each property: “TimeZone” and “UOM”. These are both returned as strings, so if you need the actual AFTimeZone or UOM objects, you will need to retrieve them after you get the extended property values, as the code does. I hope this helps:
static void Main(string args)
PISystem ps = new PISystems()["MyPISystemName"];
AFDatabase db = ps.Databases["Database1"];
AFTable tbl = db.Tables["Table1"];
// Get the timezone name, if any.
var timeZoneStr = tbl.GetExtendedProperty("ColumnName1", "TimeZone");
// Attempt to convert to an AFTimeZone object.
if (timeZoneStr is string)
timeZoneObj = AFTimeZone.FromName(timeZoneStr as string);
// Get the UOM name, if any.
var uomStr = tbl.GetExtendedProperty("ColumnName1", "UOM");
// Attempt to find the uom with that name;
if (uomStr is string)
uomObj = ps.UOMDatabase.UOMs[uomStr as string];
So using "UOM" as the property name did work for the GetExtendedProperty method. Though, it looks like you're calling it form a table object? I can only access it on an AFTable object. Might be a typo?
My bigger question is, how are we to know the property in the UI is "Unit Of Meausure" is referenced as "UOM" somewhere else? I tried to get the "Value Type" as labeled in the UI by using the GetExtendedProperty method with "ValueType" as the property, and didn't have much luck with that as well, i had to get the Value type by getting the DataType property on the columns class. So, i'm not seeing consistency, and when trying to get these extended properties.