- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
First, let me provide some context to my problem. I have a number of blocks which are placed along a polyline. What I want to achieve is a command whereby the user selects a number of blocks, and then they are ordered based on their distance from the start of the polyline.
Code:
TypedValue[] filterlist = new TypedValue[1];
filterlist[0] = new TypedValue(0, "INSERT");
SelectionFilter filter = new SelectionFilter(filterlist);
PromptSelectionResult psr1 = ed.GetSelection(filter);
if (psr1.Status != PromptStatus.OK)
return;
SelectionSet psrSet = psr1.Value;
ObjectIdCollection obs = new ObjectIdCollection();
foreach (ObjectId id1 in psrSet.GetObjectIds())
{
obs.Add(id1);
}This first section allows the user to select some blocks, puts them into a selection set and then creates an ObjectIDCollection to store them.
It is at this point that I am not sure how to order them based on distance from start point. I can create a string that tells me the distance to the start point of each block but can't get that final step to actually order them based on this criteria.
Any help is appreciated.
Cheers
Matt
Solved! Go to Solution.