I have been looking through ViewSchedule API and can't seem to be able to find any methods to control:
I was able to locate methods for Title Text, header Text and Body Text types, but nothing is exposed for those other properties. Is it just me missing it, or are those methods really not available yet?
I know I can hide an entire "header" section by accessing TableSectionData but I am not looking for that. I am looking for API methods to do the same thing that UI does:
Thank you for all suggestions in advance.
-Konrad
This request has come out before, I am sorry to say that there is currently no API access to either of these functionalities.
We already have a wish list item filed as CF-1730 [API wish: toggle Grid Lines and Outline settings in schedule sheet list appearance -- 09939793] Please make a note of this number for future reference.
You can check a previous forum post asking for similar functionality and our Engineers are aware on it.
http://forums.autodesk.com/t5/revit-api/schedule-appearance-properties/m-p/5235497
Thank you for your collaboration I hope this helps.
Best,
This is what i used... Hope it helps.
DoorViewSchdl = ViewSchedule.CreateSchedule(document, new ElementId(BuiltInCategory.OST_Doors));
DoorViewSchdl.Name = "SCHEDULE - HARDWARE TYPES - " + LevName.ToUpper();
// hidden fields
CreateDoorTypeSchd(DoorViewSchdl, "Level", true, false, ScheduleHorizontalAlignment.Center, "Level", true, 1.0);
//visible fields
CreateDoorTypeSchd(DoorViewSchdl, "Hardware Set #", false, false, ScheduleHorizontalAlignment.Left, "Set #", false, 0.4880);
private void CreateDoorTypeSchd(ViewSchedule DrViewSchdl, string FieldName, bool Hidden, bool HdrVertical, ScheduleHorizontalAlignment Algment, string ColHeading, bool AddFilter, double ColWidth)
{
Autodesk.Revit.DB.Document document = m_commandData.Application.ActiveUIDocument.Document;
ColumnCount = 0;
ScheduleDefinition definition = DrViewSchdl.Definition;
foreach (SchedulableField schedulableField in DrViewSchdl.Definition.GetSchedulableFields())
{
//Judge if the FieldType is ScheduleFieldType.Instance.
if (schedulableField.FieldType == ScheduleFieldType.Instance)
{
ElementId parameterId = schedulableField.ParameterId;
string fieldName = schedulableField.GetName(document);
if (fieldName == FieldName)
{
if (ColumnCount < 1)
{
ScheduleField field = DrViewSchdl.Definition.AddField(schedulableField);
//Horizontal Alignment
field.HorizontalAlignment = Algment;
//Hidden
if (Hidden == true)
field.IsHidden = true;
//Heading Orientation
if (HdrVertical == true)
field.HeadingOrientation = ScheduleHeadingOrientation.Vertical;
//Heading Text
field.ColumnHeading = ColHeading;
if (AddFilter == true)
{
ScheduleFilter filter = new ScheduleFilter(field.FieldId, ScheduleFilterType.Equal, ShtLevlId);
definition.AddFilter(filter);
}
field.GridColumnWidth = ColWidth / 12.0;
if (Enum.IsDefined(typeof(BuiltInParameter), parameterId.IntegerValue))
{
BuiltInParameter bip = (BuiltInParameter)parameterId.IntegerValue;
//Get the StorageType of BuiltInParameter.
StorageType st = document.get_TypeOfStorage(bip);
//if StorageType is String or ElementId, set GridColumnWidth of schedule field to three times of current GridColumnWidth.
//And set HorizontalAlignment property to left.
if (st == StorageType.String || st == StorageType.ElementId)
{
field.HorizontalAlignment = ScheduleHorizontalAlignment.Left;
}
else
{
field.HorizontalAlignment = ScheduleHorizontalAlignment.Center;
}
}
ColumnCount = ColumnCount + 1;
}
}
}
}
}