Message 1 of 14
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Can someone please share with me how the Design Options are sorted in Revit 2021. I'm trying to create an IComparer implementation that will match it. My attempts have centered around string.Compare() with various flags and options using the docs for CompareStringEx as a guide. But so far, no luck. Here is an example:
public class DesignOptionComparer : IComparer<DesignOption>
{
public int Compare(DesignOption x, DesignOption y)
{
var result = string.Compare(x.Name, y.Name, CultureInfo.CurrentCulture, CompareOptions.IgnoreSymbols);
return result;
}
}
Given two Design Options in the same Option Set, the Revit UI sorts them this way:
- OPT. COVERED PORCH W/ EXT. RETREAT A/B
- OPT. COVERED PORCH - A/B
Whereas all my Comparers to date return this order
- OPT. COVERED PORCH - A/B
- OPT. COVERED PORCH W/ EXT. RETREAT A/B
Thanks!
--
Bobby C. Jones
Bobby C. Jones
Solved! Go to Solution.