IList<DisplayUnitFormat> GetPredefinedProjectUnitFormats( UnitFormatType unitFormat )
Function GetPredefinedProjectUnitFormats( _ ByVal unitFormat As UnitFormatType _ ) As IList(Of DisplayUnitFormat)
Parameters
- unitFormat
IList<DisplayUnitFormat> GetPredefinedProjectUnitFormats( UnitFormatType unitFormat )
Function GetPredefinedProjectUnitFormats( _ ByVal unitFormat As UnitFormatType _ ) As IList(Of DisplayUnitFormat)
//Must be on the QueuedTask.Run() var unit_formats = Enum.GetValues(typeof(UnitFormatType)) .OfType<UnitFormatType>().ToList(); System.Diagnostics.Debug.WriteLine("All available units\r\n"); foreach (var unit_format in unit_formats) { var units = DisplayUnitFormats.Instance.GetPredefinedProjectUnitFormats(unit_format); System.Diagnostics.Debug.WriteLine(unit_format.ToString()); foreach (var display_unit_format in units) { var line = $"{display_unit_format.DisplayName}, {display_unit_format.UnitCode}"; System.Diagnostics.Debug.WriteLine(line); } System.Diagnostics.Debug.WriteLine(""); }
//Must be on the QueuedTask.Run() //UnitFormatType.Angular, UnitFormatType.Area, UnitFormatType.Distance, //UnitFormatType.Direction, UnitFormatType.Location //Get the full list of all available location units var all_units = DisplayUnitFormats.Instance.GetPredefinedProjectUnitFormats( UnitFormatType.Location); //keep units with an even factory code var list_units = all_units.Where(du => du.UnitCode % 2 == 0).ToList(); //set them as the new location unit collection. A new default is not being specified... DisplayUnitFormats.Instance.SetProjectUnitFormats(list_units); //set them as the new location unit collection along with a new default DisplayUnitFormats.Instance.SetProjectUnitFormats( list_units, list_units.First()); //Note: UnitFormatType.Page, UnitFormatType.Symbol2D, UnitFormatType.Symbol3D //cannot be set.
Target Platforms: Windows 11, Windows 10