Revision Table Anchor point

Programming and macros
Muppet
Posts: 1
Joined: Tue Sep 07, 2021 9:50 am
Answers: 0

Revision Table Anchor point

Unread post 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

;----------------
Attachments
image.png
User avatar
JSculley
Posts: 632
Joined: Tue May 04, 2021 7:28 am
Answers: 55
x 9
x 864

Re: Revision Table Anchor point

Unread post 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
User avatar
loeb
Posts: 62
Joined: Sun Jan 16, 2022 5:55 pm
Answers: 1
x 37
x 10

Re: Revision Table Anchor point

Unread post 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. :(
Post Reply