Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

view schedule appearance - grid lines, outline, show headers and show title

2 REPLIES 2
Reply
Message 1 of 3
sobon.konrad
1009 Views, 2 Replies

view schedule appearance - grid lines, outline, show headers and show title

I have been looking through ViewSchedule API and can't seem to be able to find any methods to control:

  • Grid Lines
  • Outline
  • Show Title
  • Show Headers

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:

 

Capture.JPG

Thank you for all suggestions in advance. 

-Konrad

2 REPLIES 2
Message 2 of 3

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,



Jaime Rosales D.
Sr. Developer Consultant
Twitter | AEC ADN DevBlog
Message 3 of 3
spesci
in reply to: sobon.konrad

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;
}
}
}
}
}

 

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Rail Community