Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

revision table not updae by vba

4 REPLIES 4
Reply
Message 1 of 5
skyngu
886 Views, 4 Replies

revision table not updae by vba

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
4 REPLIES 4
Message 2 of 5
adam.nagy
in reply to: skyngu

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
Message 3 of 5
skyngu
in reply to: adam.nagy

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
Message 4 of 5
xiaodong_liang
in reply to: skyngu

Hi, 

 

have your tried with ConvertToLocal if it helps?

 

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

Message 5 of 5
skyngu
in reply to: xiaodong_liang

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

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report