Jump to content

Recommended Posts

Posted

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

Posted

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.

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...