Inventor Customization

Reply
Valued Mentor
jcneal
Posts: 324
Registered: ‎04-10-2010
Message 1 of 5 (282 Views)

revision table not updae by vba

282 Views, 4 Replies
12-03-2012 04:34 AM

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 2014
Autodesk Product Design Suite Standard 2013
Microsoft Office 2007 & 2013
Windows 7 64bit
Synergis Adept 2013
Visual Studio Express 2010
ADN Support Specialist
adam.nagy
Posts: 521
Registered: ‎03-26-2007
Message 2 of 5 (255 Views)

Re: revision table not updae by vba

12-11-2012 04:58 AM in reply to: jcneal

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
Developer Technical Services
Autodesk Developer Network
Valued Mentor
jcneal
Posts: 324
Registered: ‎04-10-2010
Message 3 of 5 (250 Views)

Re: revision table not updae by vba

12-11-2012 11:16 AM 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 2014
Autodesk Product Design Suite Standard 2013
Microsoft Office 2007 & 2013
Windows 7 64bit
Synergis Adept 2013
Visual Studio Express 2010
ADN Support Specialist
xiaodong.liang
Posts: 1,251
Registered: ‎06-12-2011
Message 4 of 5 (218 Views)

Re: revision table not updae by vba

01-08-2013 06:58 PM in reply to: jcneal

Hi, 

 

have your tried with ConvertToLocal if it helps?

 

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



Xiaodong Liang
Developer Technical Services
Autodesk Developer Network

Valued Mentor
jcneal
Posts: 324
Registered: ‎04-10-2010
Message 5 of 5 (211 Views)

Re: revision table not updae by vba

01-09-2013 03:27 PM 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 2014
Autodesk Product Design Suite Standard 2013
Microsoft Office 2007 & 2013
Windows 7 64bit
Synergis Adept 2013
Visual Studio Express 2010

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community


Inventor Exchange Apps

Created by the community for the community, Autodesk Exchange Apps for Autodesk Inventor helps you achieve greater speed, accuracy, and automation from concept to manufacturing.

Connect with Inventor

Twitter

Facebook

Blogs

Pinterest

Youtube