streng Posted November 23, 2010 Share Posted November 23, 2010 Hi Hope someone can help. I have created a code to fill a standard autocad table with attributed data. I now want to write a code to edit the table by re-selecting the blocks. To edit the table I have created a selection set of tables but I have one (what I thought would be simple) problem I need to delete all the acDataRows and re-insert new rows. Have included relevant part of code. Option Explicit Dim oTable As AcadTable Dim TTN As Long Private Sub PopTable() GetRefTable For Each oTable In ThisDrawing.SelectionSets.item("TableSS") With oTable MsgBox .StyleName & " - " & .Layer 'Try to delete all data rows and repopulate with 'x' rows End With Next End Sub Public Function GetRefTable() As AcadSelectionSet '============================================================================== 'Return a SelectionSet of Tables (From a Selection Window) '============================================================================== Dim RefSS As AcadSelectionSet Dim GroupCode(0 To 1) As Integer Dim DataValue(0 To 1) As Variant Dim FilterType As Variant Dim FilterData As Variant '------------------------------------------------------ On Error Resume Next ThisDrawing.SelectionSets("TableSS").Delete Set RefSS = ThisDrawing.SelectionSets.Add("TableSS") GroupCode(0) = 0: DataValue(0) = "ACAD_table" GroupCode(1) = 8: DataValue(1) = "TITLEBLOCK" FilterType = GroupCode: FilterData = DataValue ThisDrawing.Utility.Prompt ("Select Reference Table:") RefSS.SelectOnScreen FilterType, FilterData Set GetRefTable = RefSS TTN = GetRefTable.count End Function Quote Link to comment Share on other sites More sharing options...
streng Posted November 24, 2010 Author Share Posted November 24, 2010 I decided the best way to edit the table is to reference the insertion point x,y,z . Delete the table and repopulate. I think this probably is the best method. 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.