Page 1 of 1

Revision Table Anchor point

Posted: Tue Sep 07, 2021 11:59 pm
by Muppet
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

;----------------

Re: Revision Table Anchor point

Posted: Tue Sep 21, 2021 12:51 pm
by JSculley
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

Posted: Sat Feb 12, 2022 4:45 pm
by loeb
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. :(