revision table not updae by vba

revision table not updae by vba

skyngu
Collaborator Collaborator
1,217 Views
4 Replies
Message 1 of 5

revision table not updae by vba

skyngu
Collaborator
Collaborator

hi,

 

I tried to add a revision table by vba routie. useing fllowing code

 

Dim oRevStyle As RevisionTableStyle        

Set oRevStyle = oDoc.StylesManager.RevisionTableStyles.Item("Revision Table_NEW")

 

Dim oRevTable As RevisionTable        

Set oRevTable = oDoc.ActiveSheet.RevisionTables.Add2(oPoint, , , , , oRevStyle)

 

It adds revision table is not shown correct in the drawing. I have to manually select certain style in the drawing.

I try doc.update or view.update. it doesnt work. any idea?

Autodesk Inventor Professional 2019
0 Likes
1,218 Views
4 Replies
Replies (4)
Message 2 of 5

adam.nagy
Autodesk Support
Autodesk Support

Hi,

 

How did you create the style?

Can you reproduce the problem with a simple copy of a built-in style? - and then e.g. modify label size.

What is not correct with the created table?

 

Could you add a very minimal non-confidental document that enables others to reproduce the problem? 

 

Cheers, 



Adam Nagy
Autodesk Platform Services
0 Likes
Message 3 of 5

skyngu
Collaborator
Collaborator

sorry, i didnt state the issue clearly. The revision table style is not exist in "local styles" but in "all styles".

so after i run the code, it adds revision table on the drawing and adds revision table style in style selector. then, i have to manually select correct revision table style from style selector.

 

thanks for your reply.

 

Sub test()

 

Dim oDoc As DrawingDocument

Set oDoc = ThisApplication.ActiveDocument

 

Dim oRevStyle As RevisionTableStyle

Set oRevStyle = oDoc.StylesManager.RevisionTableStyles.Item("Revision Table_NEW")

 

Dim oPoint As Point2d

Set oPoint = ThisApplication.TransientGeometry.CreatePoint2d(16, 10)

 

Dim oRevTable As RevisionTable

Set oRevTable = oDoc.ActiveSheet.RevisionTables.Add2(oPoint, , , , , oRevStyle)

 

End Sub

Autodesk Inventor Professional 2019
0 Likes
Message 4 of 5

xiaodong_liang
Autodesk Support
Autodesk Support

Hi, 

 

have your tried with ConvertToLocal if it helps?

 

Dim oRevStyle As RevisionTableStyle
If oRevStyle.StyleLocation = kLibraryStyleLocation Then
      oRevStyle.ConvertToLocal
End If

0 Likes
Message 5 of 5

skyngu
Collaborator
Collaborator

thanks. i will give it a try.

just wondering if i should insert this code before or after add revision table.

 

thanks.

Autodesk Inventor Professional 2019
0 Likes