Public AcadApp As AutoCAD.AcadApplication
Public CurrentDocument As AutoCAD.AcadDocument
Private Sub Test()
Try
AcadApp = GetObject(, "AutoCAD.Application")
Catch
AcadApp = CreateObject("AutoCAD.Application")
Finally
AcadApp.Visible = True
End Try
CurrentDocument = AcadApp.ActiveDocument
Dim sset As AutoCAD.AcadSelectionSet
Try
sset = CurrentDocument.SelectionSets.Item("NewSet")
sset.Clear()
Catch
sset = CurrentDocument.SelectionSets.Add("NewSet")
End Try
Dim FilterType(0) As Integer
Dim FilterData(0) As Object
FilterType(0) = 0
FilterData(0) = "Line"
sset.SelectOnScreen(FilterType, FilterData)
End Sub