Good day
Let me start by apologizing if I am doing this incorrectly or posting it wrong. This is literally my first post ever.
I am trying to place a Revision Table on a drawing sheet.
The issue is that, although the revision table is inserted, it is not anchored to the correct point. The The top_right anchor point selection is active, regardless of which i indicate.
I would appreciate it if anyone could help.
below i have the code i used
'----------------
Dim boolstatus As Boolean
Sub main()
Dim instance As ISheet
Dim instance2 As swBOMConfigurationAnchorType_e
Dim currentSheet As Object
Dim myRevisionTable As Object
instance2 = swBOMConfigurationAnchor_BottomRight
Set myRevisionTable = Application.SldWorks.ActiveDoc.GetCurrentSheet.InsertRevisionTable(True, 0, 0, instance2, "C:\squirrel.sldrevtbt")
myRevisionTable.GetAnnotation.Layer = "Tables"
Application.SldWorks.ActiveDoc.Rebuild(swRebuildOptions_e.swForceRebuildAll)
End Sub
;----------------
Revision Table Anchor point
Re: Revision Table Anchor point
It appears to be a longstanding API bug. It doesn't work in SW2017SP5 or SW2021 SP4 which is the latest I have installed. There is and inactive SPR (1098031) listing this behavior. The fix is to simply set the anchor *after* the table is created:
Code: Select all
myRevisionTable.AnchorType = swBOMConfigurationAnchor_BottomRight
Re: Revision Table Anchor point
I can confirm this bug. I asked one of the SolidWorks developers why the SPR is inactive if the bug hasn't been fixed. I was told that people stopped reporting the bug, so they made the SPR inactive.