Message 1 of 2
Not applicable
10-29-2011
01:41 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I have a need to delete all the tables in my drawing.
I started with the SS14 code from Jerry Winters VB.NET progamming and modified it to select tables. Unfortunately, when trying to select a table, the code does not work. I tried it with Polylines, block references, Mtext and it worked OK with all of them. See the code below:
<CommandMethod("SS14")> _
Public Sub SS14()
Dim myDB As DatabaseServices.Database
Dim myDWG As ApplicationServices.Document
Dim myEd As EditorInput.Editor
Dim myPSR As EditorInput.PromptSelectionResult
Dim mySS As EditorInput.SelectionSet
Dim myFilter(0) As DatabaseServices.TypedValue
myFilter(0) = New DatabaseServices.TypedValue(DatabaseServices.DxfCode.Start, "INSERT")
myFilter(0) = New DatabaseServices.TypedValue(DatabaseServices.DxfCode.Start, "TABLE")
' myFilter(0) = New DatabaseServices.TypedValue(DatabaseServices.DxfCode.Start, "POLYLINE")
' myFilter(0) = New DatabaseServices.TypedValue(DatabaseServices.DxfCode.Start, "MTEXT")
'''' Chenge items commented out above for testing.
Dim mySF As New EditorInput.SelectionFilter(myFilter)
myDWG = ApplicationServices.Application.DocumentManager.MdiActiveDocument
myDB = myDWG.Database
myEd = myDWG.Editor
myPSR = myEd.SelectAll(mySF)
Try
mySS = myPSR.Value
If Not IsNothing(mySS) Then
MsgBox(mySS.Count)
End If
Catch ex As SystemException
MsgBox(Err.Description)
End Try
End SubWhat am I doing wrong? Or is there a bug when selecting "Tables" as distinct from other entities?
Solved! Go to Solution.