.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

SelectionSet C# via COM

4 REPLIES 4
Reply
Message 1 of 5
dnlo
480 Views, 4 Replies

SelectionSet C# via 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.
4 REPLIES 4
Message 2 of 5
Anonymous
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.
Message 3 of 5
Anonymous
in reply to: dnlo

Please forgive the typo...

ss.SelectOnScreen(filterType , filterData);
--
Bobby C. Jones
http://www.acadx.com
Message 4 of 5
Anonymous
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.
Message 5 of 5
dnlo
in reply to: dnlo

Thanks for replies!

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost