Thanks for the feed back.
I'm using this for adding parts list:
'Need to add a sorting function
iLogicVb.UpdateWhenDone = True
' Set a reference to the drawing document.
' This assumes a drawing document is active.
Dim oDrawDoc As DrawingDocument
oDrawDoc = ThisApplication.ActiveDocument
'Set a reference to the active sheet.
Dim oSheet As Sheet
oSheet = oDrawDoc.ActiveSheet
' Set a reference to the first drawing view on
' the sheet. This assumes the first drawing
' view on the sheet is not a draft view.
Dim oDrawingView As DrawingView
Try
oDrawingView = oSheet.DrawingViews(1)
Catch
MessageBox.Show("No View found. Can not continue", "iLogic")
Return 'return exits the rule
End Try
' Set a reference to th sheet's border
Dim oBorder As Border
oBorder = oSheet.Border
Dim oPlacementPoint As Point2d
If Not oBorder Is Nothing Then
' A border exists. The placement point
' is the top-right corner of the border.
oPlacementPoint = oBorder.RangeBox.MaxPoint
Else
' There is no border
oPlacementPoint = ThisApplication.TransientGeometry.CreatePoint2d(20, 20)
End If
Dim oPartslist As PartsList
Try
'look for the first parts list found on the sheet
'if succesful finding it,
'tell the user,then Do Nothing
oPartslist = oSheet.PartsLists(1)
MessageBox.Show("There is an existing Parts List", "iLogic")
Catch
'if one is not found, Create it
oPartsList = oSheet.PartsLists.Add(oDrawingView, oPlacementPoint)
End Try
Im useing this for sorting the parts list.
Dim oDrawDoc As DrawingDocument
oDrawDoc = ThisApplication.ActiveDocument
Dim oPartsList1 As PartsList
oPartsList1 = oDrawDoc.ActiveSheet.PartsLists.Item(1)
oPartsList1.Sort("ASME BPE", 0, "SIZE", 0, "QUANTITY", 0)
and this for the REV block placement:
Sub Main RemoveAllTags()
Dim oDrawDoc As DrawingDocument = ThisApplication.ActiveDocument
For Each oSheet In oDrawDoc.Sheets
oSheet.activate
ProcessSheet(oSheet)
Next
oDrawDoc.Update
End Sub
Sub ProcessSheet(oSheet As Sheet)
If oSheet.RevisionTables.Count = 0 Then
On Error Resume Next
End If
Dim oRTB As RevisionTable = oSheet.RevisionTables.Item(1)
Dim oRows As RevisionTableRows = oRTB.RevisionTableRows
oRows.Add()
Dim oRow As RevisionTableRow = oRTB.RevisionTableRows.Item(oRTB.RevisionTableRows.Count)
For Each oRow In oRows
If oRow.IsActiveRow Then
Else
oRow.Delete
End If
Next
oRTB.Delete
oDrawDoc = ThisApplication.ActiveDocument
Dim oRTBs As RevisionTables
oRTBs = oDrawDoc.ActiveSheet.RevisionTables
Dim oLocation As Point2d
oLocation = ThisApplication.TransientGeometry.CreatePoint2d(68.08999997, 9.780835)
oRTB = oRTBs.Add(oLocation)
End Sub
hope this helps