Jump to content

VBA SelectionSet not working on VB.NET


habakay

Recommended Posts

Hi,

I'm new at .NET for Autocad. I try to convert my VBA codes to .NET. But I have some troubles. I can use the codes below without any errors at VBA but it gives an error on .NET

VBA Codes:

Dim oSset As AcadSelectionSet
Dim FilterType(3) As Integer
Dim FilterData(3) As Variant
...

FilterType(0) = -4
FilterData(0) = "<OR"
FilterType(1) = 0
FilterData(1) = "LINE"
FilterType(2) = 0
FilterData(2) = "LWPOLYLINE"
FilterType(3) = -4
FilterData(3) = "OR>"
...

oSset.SelectOnScreen FilterType, FilterData

I try to convert them like this;

Dim oSset As Autodesk.AutoCAD.Interop.AcadSelectionSet
Dim FilterType(3) As Object
Dim FilterData(3) As Object
...
FilterType(0) = -4
FilterData(0) = "<OR"
FilterType(1) = 0
FilterData(1) = "LINE"
FilterType(2) = 0
FilterData(2) = "LWPOLYLINE"
FilterType(3) = 4
FilterData(3) = "OR>"
...
[color=red]oSset.SelectOnScreen([/color][color=red]FilterType, [/color][color=red]FilterData)[/color]

and it gives an error on "selectonscreen" line. The error is "Invalid argument FilterType in SelectOnScreen"

 

I also try "Short " and "Integer" variable types for "FilterType" but nothing change.

I would appreciate if you can help.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...