.NET

Reply
Active Contributor
dnlo
Posts: 45
Registered: ‎04-11-2003
Message 1 of 5 (275 Views)

SelectionSet C# via COM

275 Views, 4 Replies
03-23-2006 01:03 AM
Hello,
I'm using ActiveX methods from. NET:
SelectOnScreen [FilterType][, FilterData] and
Select Mode[, Point1][, Point2][, FilterType][, FilterData].

In ActiveX/VBA FilterType is int, FilterData is variant (array).
But what are the right/exact argument types when calling these methods from C#? In AutoCAD.dll assembly it is shown as object, but
it is a runtime error when using Object, Object[], int[], AcadObject etc.
I just want to select objects based on multipl. selection filters.
*Bobby C. Jones
Message 2 of 5 (275 Views)

Re: SelectionSet C# via COM

03-23-2006 05:36 AM in reply to: dnlo
The COM Integer is 16 bit, the C# int is 32 bit. Use the short type
instead. You *must* use object because there is no variant type in .NET.
This examples filers the selection set for lines and polylines on the
A-Walls layer.

short[] filterType = {0, 8};

object[] filterData = {"LINE,POLYLINE,LWPOLYLINE", "A-Walls"};



ss.SelectOnScreen(filterKeys, filterData);



--
Bobby C. Jones
http://www.acadx.com

wrote in message news:5119184@discussion.autodesk.com...
Hello,
I'm using ActiveX methods from. NET:
SelectOnScreen [FilterType][, FilterData] and
Select Mode[, Point1][, Point2][, FilterType][, FilterData].

In ActiveX/VBA FilterType is int, FilterData is variant (array).
But what are the right/exact argument types when calling these methods from
C#? In AutoCAD.dll assembly it is shown as object, but
it is a runtime error when using Object, Object[], int[], AcadObject etc.
I just want to select objects based on multipl. selection filters.
*Bobby C. Jones
Message 3 of 5 (275 Views)

Re: SelectionSet C# via COM

03-23-2006 05:41 AM in reply to: dnlo
Please forgive the typo...

ss.SelectOnScreen(filterType , filterData);
--
Bobby C. Jones
http://www.acadx.com
*Tony Tanzillo
Message 4 of 5 (275 Views)

Re: SelectionSet C# via COM

03-23-2006 06:45 AM in reply to: dnlo
The FilterType parameter is a 16 bit signed integer, which
means you use Int16[] or short[].

The FilterData is an object[]

Regarding data types, there's no such thing as
a "COM Integer".

The VB6 'Integer' type is a 16 bit signed integer,
and the VB6 'Long' type is 32 bit signed integer.

In COM, signed integer types include VT_I1, VT_I2,
and VT_I4. Multiply the numeric element by 8 for the
number of bits.

The corresponding CLR types are Byte, Int16 and
Int32, which also coorespond to the C# byte, short,
and int types.

Soooooo:

VB6 CLR C#
---------------------------------------
Long Int32 int
Integer Int16 short

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006
http://www.acadxtabs.com

wrote in message news:5119184@discussion.autodesk.com...
Hello,
I'm using ActiveX methods from. NET:
SelectOnScreen [FilterType][, FilterData] and
Select Mode[, Point1][, Point2][, FilterType][, FilterData].

In ActiveX/VBA FilterType is int, FilterData is variant (array).
But what are the right/exact argument types when calling these methods from C#? In AutoCAD.dll assembly it is shown as object, but
it is a runtime error when using Object, Object[], int[], AcadObject etc.
I just want to select objects based on multipl. selection filters.
Active Contributor
dnlo
Posts: 45
Registered: ‎04-11-2003
Message 5 of 5 (275 Views)

Re: SelectionSet C# via COM

03-23-2006 06:54 AM in reply to: dnlo
Thanks for replies!
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.