REV TABLE PLACE WITH ILOGIC
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
i have created code to place the revision table to the right of the title block and that work fine. when i run the code it changes the revsion number to static value. I have tried other code i have found here and i have the same issue
here is my code
Try
' Align the revision table to the right side of the title block and align its Y max with the title block's Y min
' Access the active drawing document
Dim oDoc As DrawingDocument
oDoc = ThisApplication.ActiveDocument
' Get the active sheet
Dim oSheet As Sheet
oSheet = oDoc.ActiveSheet
' Get the title block on the sheet
Dim oTitleBlock As TitleBlock
oTitleBlock = oSheet.TitleBlock
' Validate the title block range
Dim TitleBlockMaxPoint As Point2d
Dim TitleBlockMinPoint As Point2d
TitleBlockMaxPoint = oTitleBlock.RangeBox.MaxPoint
TitleBlockMinPoint = oTitleBlock.RangeBox.MinPoint
Dim XMaxTitle As Double = TitleBlockMaxPoint.X
Dim YMinTitle As Double = TitleBlockMinPoint.Y
' Check if a revision table exists
If oSheet.RevisionTables.Count = 0 Then
' Create a new revision table if none exists
Dim oPosition As Point2d
oPosition = ThisApplication.TransientGeometry.CreatePoint2d(XMaxTitle, YMinTitle) ' Example offset
' Add a new revision table at the specified position
Dim oRevTable As RevisionTable
oRevTable = oSheet.RevisionTables.Add(oPosition)
End If
' Calculate the dimensions of the newly added revision table
If oSheet.RevisionTables.Count > 0 Then
Dim oRevTable As RevisionTable = oSheet.RevisionTables(oSheet.RevisionTables.Count) ' Access the most recently created revision table
Dim RevTableWidth As Double
RevTableWidth = oRevTable.RangeBox.MaxPoint.X - oRevTable.RangeBox.MinPoint.X
Dim RevTableHeight As Double
RevTableHeight = oRevTable.RangeBox.MaxPoint.Y - oRevTable.RangeBox.MinPoint.Y
' Adjust the position to align the revision table's right side with the title block's X max
' and its Y max with the title block's Y min
Dim oPositionFinal As Point2d
oPositionFinal = ThisApplication.TransientGeometry.CreatePoint2d(XMaxTitle - RevTableWidth - 36.5496, YMinTitle + RevTableHeight)
' Set the position of the revision table
oRevTable.Position = oPositionFinal
End If
Catch ex As Exception
' Handle any errors gracefully
MessageBox.Show("An error occurred: " & ex.Message, "iLogic Script")
End Try