I have a list of curves imported from a DWG. These curves used to be lines and arcs in Civil3D for building pads. I want to organize the points on these curves so that they can enclose. here is my code:
def SortList(c:var[])
{
SortedList = {};
i = 0;
cnt = List.Count©;
return = [Imperative]
{
while (i<cnt)
{
sp = c[0].StartPoint();
ep = c[0].EndPoint();
sp1 = c[i].StartPoint();
if(sp1==sp)
{
c=List.DropItems(c,1);
SortedList[i] = sp1;
i=i+1;
}
elseif(sp1==ep)
{
c=List.DropItems(c,1);
SortedList[i] = sp1;
i=i+1;
}
else
{
c=List.DropItems(c,1);
i=i+1;
}
}
return = SortedList;
}
};
SortList(curves);