Delete Revision Table

Delete Revision Table

Anonymous
Not applicable
1,243 Views
2 Replies
Message 1 of 3

Delete Revision Table

Anonymous
Not applicable

hi everyone

 

I'm looking for a piece of code that will look for a revision table and if it finds one it will delete it.

 

Also

 

looking for the reverse... If no revision table exists , then add one.

 

thanks as always

0 Likes
1,244 Views
2 Replies
Replies (2)
Message 2 of 3

MechMachineMan
Advisor
Advisor

These should get you started:

 

Sub Main() 
    oDoc = ThisDoc.Document
    Call PurgeRevTables(oDoc)
'Call AddRevTables(oDoc) End Sub Sub PurgeRevTables(oDoc As Document) For Each oSheet in oDog If oSheet.RevisionTables.Count > 0 Then For Each oRevTable in oSheet.RevisionTables oRevTable.Delete Next End if Next End Sub

Sub AddRevTables(oDoc As Document)

Dim oTG As TransientGeometry = oDoc.Parent.TransientGeometry
oPT = oTG.CreatePoint2D(20,20)
For Each oSheet in oDog If oSheet.RevisionTables.Count > 0 Then oSheet.RevisionTables.Add2(oPT) End if
Next
End Sub     

 


--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.

Justin K
Inventor 2018.2.3, Build 227 | Excel 2013+ VBA
ERP/CAD Communication | Custom Scripting
Machine Design | Process Optimization


iLogic/Inventor API: Autodesk Online Help | API Shortcut In Google Chrome | iLogic API Documentation
Vb.Net/VBA Programming: MSDN | Stackoverflow | Excel Object Model
Inventor API/VBA/Vb.Net Learning Resources: Forum Thread

Sample Solutions:Debugging in iLogic ( and Batch PDF Export Sample ) | API HasSaveCopyAs Issues |
BOM Export & Column Reorder | Reorient Skewed Part | Add Internal Profile Dogbones |
Run iLogic From VBA | Batch File Renaming| Continuous Pick/Rename Objects

Local Help: %PUBLIC%\Documents\Autodesk\Inventor 2018\Local Help

Ideas: Dockable/Customizable Property Browser | Section Line API/Thread Feature in Assembly/PartsList API Static Cells | Fourth BOM Type
Message 3 of 3

Jusdoo
Contributor
Contributor

I have developed an app to operate revision tables. For trial version, it just limits the time and number of sheets to use. hope it will help.

 

https://apps.autodesk.com/INVNTOR/en/Detail/Index?id=7788639131627009214&appLang=en&os=Win64

0 Likes