/// <summary>
 /// Get current length display unit type
 /// </summary>
 /// <param name="document">Revit's document</param>
 /// <returns>Current length display unit type</returns>
 private static DisplayUnitType GetLengthUnitType(Document document)
 {
     UnitType unittype = UnitType.UT_Length;
     Units units = document.GetUnits();
     try
     {
         Autodesk.Revit.DB.FormatOptions formatOption = units.GetFormatOptions(unittype);
         return formatOption.DisplayUnits;
     }
     catch (System.Exception /*e*/)
     {
         return DisplayUnitType.DUT_DECIMAL_FEET;
     }
 }