diff --git a/Objects/Converters/ConverterRevit/ConverterRevitShared/PartialClasses/ConvertView.Schedule.cs b/Objects/Converters/ConverterRevit/ConverterRevitShared/PartialClasses/ConvertView.Schedule.cs index 2dc43fefce..bf6de53479 100644 --- a/Objects/Converters/ConverterRevit/ConverterRevitShared/PartialClasses/ConvertView.Schedule.cs +++ b/Objects/Converters/ConverterRevit/ConverterRevitShared/PartialClasses/ConvertView.Schedule.cs @@ -244,7 +244,7 @@ Element firstElement var columnMetadata = new Base(); columnMetadata["BuiltInParameterInteger"] = info.field.ParameterId.IntegerValue; - columnMetadata["FieldType"] = info.field.FieldType.ToString(); + string fieldType = info.field.FieldType.ToString(); Parameter param; if (info.field.FieldType == ScheduleFieldType.ElementType) @@ -257,10 +257,26 @@ Element firstElement } else if (info.field.FieldType == ScheduleFieldType.Instance) { + // All shared parameters also use this type, regardless of whether they are instance or type parameters. + // ref: https://www.revitapidocs.com/2024/9888db7d-00d0-4fd7-a1a9-cdd1fb5fce16.htm if (firstElement != null) { param = firstElement.get_Parameter(builtInParameter); - columnMetadata["IsReadOnly"] = param?.IsReadOnly; + + // if the parameter is shared, we need to check the type parameterer too + if (firstType != null) + { + Parameter typeParam = firstType.get_Parameter(builtInParameter); + + // If the parameter is readonly in the element but not in the type, is a type parameter + if (typeParam != null && !typeParam.IsReadOnly && param != null && param.IsReadOnly) + { + columnMetadata["IsReadOnly"] = false; + fieldType = ScheduleFieldType.ElementType.ToString(); + } + } + + columnMetadata["IsReadOnly"] ??= param?.IsReadOnly ?? true; } } else @@ -273,6 +289,8 @@ Element firstElement info.field.FieldType.ToString() ); } + + columnMetadata["FieldType"] = fieldType; speckleTable.DefineColumn(columnMetadata); }