编辑表格
你好希望有人能帮忙。
我创建了一个代码,用属性数据填充标准autocad表。
我现在想编写一个代码,通过重新选择块来编辑表。
为了编辑表格,我创建了一组选择表格,但我有一个问题(我认为很简单)
我需要删除所有acDataRows并重新插入新行。
已包含代码的相关部分。
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
我决定编辑表格的最佳方法是引用插入点x,y,z。删除表并重新填充。我认为这可能是最好的方法。
页:
[1]