habakay Posted April 8, 2016 Share Posted April 8, 2016 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. Quote Link to comment Share on other sites More sharing options...
Tyke Posted April 8, 2016 Share Posted April 8, 2016 The value in your line of code: FilterType(3) = 4 should be "-4" Quote Link to comment Share on other sites More sharing options...
habakay Posted April 8, 2016 Author Share Posted April 8, 2016 Thanks Tyke. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.