Here's an example of how you could do it in .NET. This sample has no error checking and does not work on Siteless Alignments, but it illustrates the basic procedure.
With this option, there is no need to manually write a sort algorithm - it is included in the List<> class. We merely need to specify what operation to use for comparing two items.
[code]
using System;
using System.Collections.Generic;
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.EditorInput;
using Autodesk.AECC.Interop.Land;
namespace Sample
{
public class Sample
{
public List
GetAlignmentOrderedList(AeccSite site)
{
Editor ed = Application.DocumentManager.MdiActiveDocument.Editor;
List alignmentList = new List();
foreach (AeccAlignment align in site.Alignments)
alignmentList.Add(align);
alignmentList.Sort(new AlignmentComparer());
return alignmentList;
}
private class AlignmentComparer : IComparer
{
public int Compare(AeccAlignment a1, AeccAlignment a2)
{
return a1.Name.CompareTo(a2.Name);
}
}
}
}
[/code]
-- Sinc
http://ejsurveying.com
http://www.quux.biz (Sincpac-C3D)
Sinc