RVTDocs.com
Namespace: Autodesk.Revit.DB Class: PartUtils

PartUtils.GetSplittingElements

Method
Description:
Identifies the elements ( reference planes, levels, grids ) that were used to create the part.
Syntax
public static ISet<ElementId> GetSplittingElements(
	Document document,
	ElementId partId
)
Examples
public void GetElementDividers(Part part)
{
   StringBuilder message = new StringBuilder();

   // Get Element dividers.
   ISet<ElementId> divisionElements = PartUtils.GetSplittingElements(part.Document, part.Id);

   if (divisionElements.Count == 0)
      message.AppendLine("Part is not divided.");
   else
   {
      message.AppendLine("The dividers are : ");
      foreach (var reference in divisionElements)
      {
         Element element = part.Document.GetElement(reference);
         message.AppendLine(element.GetType().Name + " " + element.Id.ToString() + " ");
      }
   }

   TaskDialog.Show("Revit", message.ToString());
}
Parameters
Parameter Type Description
document Document The source document of the part.
partId ElementId The part id.
Return Value
Type Description
ISet The elements that created the part. Empty if partId is not a Part or Part is not divided.
Exceptions
Exception Condition
ArgumentNullException A non-optional argument was null