informative thread Gentlemen, Thanks.
"Tony Tanzillo" wrote in message
news:4871326@discussion.autodesk.com...
BTW, you might want to know that it isn't necessary to
deal with the result of calling the ActiveX Select() method,
as your (disassembled) code below does.
Any call to acedSSGet() which produces a valid selection set,
causes that selection set becoming the Previous selection set.
Hence, all you have to do is call the AcadSelectionSet.Select()
method and if it succeeds, you can get the resulting selection
set via Editor.SelectPrevious(), and you then have a managed
SelectionSet to work with. So, don't bother with returning an
ObjectIdCollection. Instead, declare your function's retun type
as PromptSelectionResult, and call Editor.SelectPrevious(), and
just return its result.
public static ObjectIdCollection SelectAll(TypedValue[] filter)
{
int num1 = filter.Length;
short[] numArray1 = new short[num1];
object[] objArray1 = new object[num1];
for (int num2 = 0; num2 < num1; num2++)
{
numArray1[num2] = filter[num2].TypeCode;
objArray1[num2] = filter[num2].Value;
}
AcadDocument document1 = (AcadDocument)
Application.DocumentManager.MdiActiveDocument.AcadDocument;
AcadSelectionSet set1 = document1.get_SelectionSets().Add("temp");
set1.Select(5, Type.Missing, Type.Missing, numArray1, objArray1);
int num4 = set1.get_Count();
Tools.Editor.WriteMessage(num4.ToString() + " objects have been
selected.");
ObjectIdCollection collection1 = new ObjectIdCollection();
for (int num3 = 0; num3 < set1.get_Count(); num3++)
{
collection1.Add(DBObject.FromAcadObject(set1.Item(num3)));
}
set1.Delete();
return collection1;
}
--
http://www.caddzone.com
AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006
http://www.acadxtabs.com
wrote in message news:4871213@discussion.autodesk.com...
But you can not use conditinal selectionset.For example,I cannot select both
circles or lines with Getselection.
3. I'd like to think that the .NET API does a better job at usability than
the C++ API. Compare acedSSGet to the various GetSelection methods. Or the
ease of creating a palette using the .NET API vs. using AcUi/AdUi.
Albert