has anyone tried to match schedule properties, like matching column widths, position, and maybe the template? I tried Revit Lookup tool, but still have no idea where these properties can be found and if they can be applied to a selected schedule.
AttributeError: attribute 'SetUnitTypeId' of 'FormatOptions' object is read-only
The code seems fine, I can’t “untick” the “Use project settings” for the column. For now I need to untick it manually, and the field format options are applied correctly.
Memo for the future: you are not allowed to override the units for the column, but it is allowed to apply different units, as long as they are compatible. So instead of assigning a new unit type to formatOptions, CREATE the formatingOption for the appropriate unit type, format it properly and assign to a column, like in:
fo = DB.FormatOptions(DB.UnitTypeId.SquareMeters) # substitute for for FO_Units in the future perfect
fo.UseDefault = False
fo.RoundingMethod = DB.RoundingMethod.Nearest
fo.Accuracy = column_definition.FO_Accuracy
fo.UsePlusPrefix = column_definition.FO_usePlus
fo.SetSymbolTypeId(DB.ForgeTypeId(column_definition.FO_sym))
...
if fo.IsValidObject:
with rpw.db.Transaction("Setting column '{}' parameters".format(field.GetName())):
field.SetFormatOptions(fo)
...