Hey all,
I have never attempted any i-logic before and this may be running before I can walk, but I was wondering if this premise even sounded do-able. I would like to create a rule to set the last row of my revision table to all static values, and then add a row. I wouldn't even know where to start... si asking if it's even possible sounded like the right first question.
If so, then I'll pick some brains on how to get going. I'm not going to ask anyone to write this for me, but I wouldn't mind some tutoring.
TIA
Chris Benner
Inventor Tube & Pipe, Vault Professional
Cad Tips Tricks & Workarounds | Twitter | LinkedIn
Autodesk University Classes:
Going With The Flow with Inventor Tube and Pipe | Increasing The Volume with Inventor Tube and Pipe | Power of the Autodesk Community | Getting to Know You | Inventor Styles & Standards |Managing Properties with Vault Professional | Vault Configuration | Vault - What is it & Why Do I Need It? | A Little Less Talk - Tube & Pipe Demo | Change Orders & Revisions - Vault, Inventor & AutoCAD | Authoring & Publishing Custom Content
Solved! Go to Solution.
Solved by jdkriek. Go to Solution.
Solved by jdkriek. Go to Solution.
Wrote this real quick
Dim oDrawDoc As DrawingDocument = ThisApplication.ActiveDocument ' Get the revision table Dim oRevTable As RevisionTable = oDrawDoc.ActiveSheet.RevisionTables.Item(1) ' Get last row Dim oRow As RevisionTableRow oRow = oRevTable.RevisionTableRows.Item(oRevTable.RevisionTableRows.Count) ' Make sure we have the active row If oRow.IsActiveRow Then ' Go through all columns in that row For i = 1 To oRevTable.RevisionTableColumns.Count Dim oCell As RevisionTableCell = oRow.Item(i) ' Set all cells to static oCell.Text = oCell.Text ' or static and blank 'oCell.Text = "" Next End If ' Add another row at the end Dim oRows As RevisionTableRows = oRevTable.RevisionTableRows oRows.Add()
Jonathon,
Wow,... thanks! I wasn't expecting this much. I am getting this error on row 8 though... can you advise?
Error on Line 8 : Comma, ')', or a valid expression continuation expected.
Is it missing a parenthese or something? I remember playing with Autolisp a few (ok maybe 20) years ago, and that was always a killer.
Chris Benner
Inventor Tube & Pipe, Vault Professional
Cad Tips Tricks & Workarounds | Twitter | LinkedIn
Autodesk University Classes:
Going With The Flow with Inventor Tube and Pipe | Increasing The Volume with Inventor Tube and Pipe | Power of the Autodesk Community | Getting to Know You | Inventor Styles & Standards |Managing Properties with Vault Professional | Vault Configuration | Vault - What is it & Why Do I Need It? | A Little Less Talk - Tube & Pipe Demo | Change Orders & Revisions - Vault, Inventor & AutoCAD | Authoring & Publishing Custom Content
Chris, you're welcome 🙂
I don't get any errors running the code under 2011, 2012, or 2013 - what version are you running?
Note sometimes you have to paste the code into notepad before pasting it into the iLogic rule to keep formatting.
Try downloading this text file and pasting from there:
That did it! Thanks a million, you just automated what was going to be a rather tedious procedure. I owe ya one... maybe if we both go to AU, I can buy you a free beer at the AUGI party.
Chris Benner
Inventor Tube & Pipe, Vault Professional
Cad Tips Tricks & Workarounds | Twitter | LinkedIn
Autodesk University Classes:
Going With The Flow with Inventor Tube and Pipe | Increasing The Volume with Inventor Tube and Pipe | Power of the Autodesk Community | Getting to Know You | Inventor Styles & Standards |Managing Properties with Vault Professional | Vault Configuration | Vault - What is it & Why Do I Need It? | A Little Less Talk - Tube & Pipe Demo | Change Orders & Revisions - Vault, Inventor & AutoCAD | Authoring & Publishing Custom Content
Sorry I realize this thread is a little old, but is there any way to add a prompt in the code to ask for input to the revision table? I have an ECO column as well as a description column which I would like to fill out and make static using the above code.
Thank you
Dim oDrawDoc As DrawingDocument = ThisApplication.ActiveDocument ' Get the revision table Dim oRevTable As RevisionTable = oDrawDoc.ActiveSheet.RevisionTables.Item(1) ' Get last row Dim oRow As RevisionTableRow oRow = oRevTable.RevisionTableRows.Item(oRevTable.RevisionTableRows.Count)
Dim oCell As RevisionTableCell
' Make sure we have the active row If oRow.IsActiveRow Then ' Go through all columns in that row For i = 1 To oRevTable.RevisionTableColumns.Count oCell = oRow.Item(i)
If i = 2 'indicates the 2nd column in revision table
oCell.Text = InputBox("What should the cell read?", "Rev Table Help", "DEFAULT TEXT") End if
oCell.Text = oCell.Text 'This sets all cells to static
Next End If ' Add another row at the end Dim oRows As RevisionTableRows = oRevTable.RevisionTableRows oRows.Add()
So this seems to be working, but it enters the "default text" in the current revision and creates a new blank revision row when I run the rule.
Yes I did, here I modified the code to fit my process, and attached a screen of the outcome. It must be the order of the code just not sure how to modify it.
SyntaxEditor Code Snippet
Dim oDrawDoc As DrawingDocument = ThisApplication.ActiveDocument ' Get the revision table Dim oRevTable As RevisionTable = oDrawDoc.ActiveSheet.RevisionTables.Item(1) ' Get last row Dim oRow As RevisionTableRow oRow = oRevTable.RevisionTableRows.Item(oRevTable.RevisionTableRows.Count) Dim oCell As RevisionTableCell ' Make sure we have the active row If oRow.IsActiveRow Then ' Go through all columns in that row For i = 1 To oRevTable.RevisionTableColumns.Count oCell = oRow.Item(i) If i = 2 'indicates the 2nd column in revision table oCell.Text = InputBox("Please Enter The ECO Number", "Revision Table", "INITDES-000XXX") ElseIf i = 3 'indicates the 3nd column in revision table oCell.Text = InputBox("Please Enter The Revision Description", "Revision Table", "INITIAL DESIGN") End If oCell.Text = oCell.Text 'This sets all cells to static Next End If ' Add another row at the end Dim oRows As RevisionTableRows = oRevTable.RevisionTableRows oRows.Add()
I just rearraged the code so it adds a new row before modifying the old one.
Should have been easy enough to decifer... I mean the code is pretty easy to read if you just pick out key words. Like verbs and nouns....
@MechMachineMan wrote:Dim oDrawDoc As DrawingDocument = ThisApplication.ActiveDocument ' Get the revision table Dim oRevTable As RevisionTable = oDrawDoc.ActiveSheet.RevisionTables.Item(1)
' Add another row at the end
Dim oRows As RevisionTableRows = oRevTable.RevisionTableRows
oRows.Add()
' Get last row Dim oRow As RevisionTableRow oRow = oRevTable.RevisionTableRows.Item(oRevTable.RevisionTableRows.Count)
Dim oCell As RevisionTableCell
' Make sure we have the active row If oRow.IsActiveRow Then ' Go through all columns in that row For i = 1 To oRevTable.RevisionTableColumns.Count oCell = oRow.Item(i)
If i = 2 'indicates the 2nd column in revision table
oCell.Text = InputBox("What should the cell read?", "Rev Table Help", "DEFAULT TEXT") End if
oCell.Text = oCell.Text 'This sets all cells to static Next End If
Hello,
I want to change the revision on my sheet from A0,A1,A2... to B. I want to create an ilogic rule for that.
I'm trying to create an ilogic rule where you would delete all the revision rows except the first one, and rename the first column to "B"
I also want to automatically save the file after changing the rev table.
I tried creating an ilogic rule to change the Revision number property under iProperties>Project. But that doesn't update the revision in the title block correctly. Apparently the revision number iProperty and the one displayed on the title block is different.
Any help would be appreciated.