There's no argument here. The issue I had with
tang's reply was that it implies that you need his
library to solve the problem, when in fact, his code
library uses ActiveX to solve the problem, which
you can do yourself.
If he made the source for his library available, so
others can see how the problem can be solved with
ActiveX, then I wouldn't have an issue.
Yes, Autodesk is aware of the problem.
Yes, the ActiveX workaround does not support all
options supported by acedSSGet().
Also, the code you show from DOTNETARX is not
the optimal solution. The optimal solution would
be to just call the ActiveX SelectXxxxx() method
to acquire the selection from the user, and then
use the SelectPrevious() method of the Editor
class to obtain the same selection as a managed
SelectionSet (rather than having to iterate through
the ActiveX selection set and add each object's id
to a collection, etc. which is unnecessary).
Regarding filtering in general, you should not worry
too much about this, because the filtering mechanism
used in ObjectARX, LISP, and ActiveX is considered
obsolute, and limited in terms of filtering criteria
(for example, you can't filter against xdata/xrecords
or something like that).
The preferred way to acquire a filtered selecton set
from the user, is by using the SelectionAdded event
of the managed Editor class.
That mechanism allows you to filter not only your
own calls to acedSSGet(), but any call to same, by
any application including AutoCAD.
With that event, you can examine each object that
will be added to the selection set under construction,
and if you want, prevent it from being added, based
on any criteria (you can for example, open the entity
and access its xdata or something in its extension
dictionary, and use that or any other data as filtering
criteria - something that cannot be done using the
old style SSGET filter list).
So, I do not see this as a major issue, and that's
mainly because I have for some time been using the
Selection.Added event for filtering (along with its
native AcEdSSGetFilter ObjectARX counterpart), and
find that it is much more powerful and flexible than
the 'old way' of doing things (acedSSGet filter lists).
--
http://www.caddzone.com
AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006
http://www.acadxtabs.com
wrote in message news:4920114@discussion.autodesk.com...
My intention was not to start an argument; it was just to alert Autodesk to the fact that there is a problem, and to point to the location where it came from. Also, I was hoping to get some feedback from some of you folks to ascertain whether or not their is a workaround that does NOT require referencing the AutoCAD 2006 Type libraries, and the AutoCAD 2006 Common Type Libraries.
Tony,
Yes, I see that the current workaround is to use COM. Do you have any info if Autodesk even knows about this issue, and if so, when do they plan to fix it?
tangferry,
I do realize that I can use DOTNETARX for this, but again I don't want the AutoCAD Type libraries dependency. And the code from DOTNETARX 2.1:
[code]
public static ObjectIdCollection GetSelection(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.SelectOnScreen(numArray1, objArray1);
ObjectIdCollection collection1 = new ObjectIdCollection();
for (int num3 = 0; num3 < set1.get_Count(); num3++)
{
collection1.Add(DBObject.FromAcadObject(set1.Item(num3)));
}
set1.Delete();
return collection1;
}[/code]
clearly uses AutoCAD 2006 type libraries for AcadDocument and AcadSelectionSet objects.
To Everyone,
Also, please note that the COM calls don't support the options that the ARX calls do, like allowDuplicates, or everythingInAperture, etc...
Again, I write this to see if anyone has a "Managed ARX" workaround or knows if and when Autodesk plans to fix this.
Or do we wait until AutoCAD 2007? 😞