Hi,
I was hoping someone could help me with an iLogic rule that selects all revision tags in idw and then delete's them. Any help would be much appreciated.
Regards
Ben
Solved! Go to Solution.
Solved by Curtis_Waguespack. Go to Solution.
Solved by admaiora. Go to Solution.
Hi Ben,
Unfortunately Revision Tags aren't in the API Objects model.
You can delete revision tables, but not tags.
You could create a new drawing layer "Revision Tag", make it as an Object Default, then when you want to remove al tags in your drawing you will have only to turn off the revision Tag layer visibility.
Admaiora
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
Is there a specific reason it needs to be iLogic?
You could just set a custom filter and window select all the revision tags.
Will admit it's kinda strange that there's a filter for it in this menu, but not in the API.
Niels van der Veer
Inventor professional user & 3DS Max enthusiast
Vault professional user/manager
The Netherlands
Thanks for the help, this may be the way as I am running a rule to up-rev drawings to as built and do not require the revision tags any longer. I can change the layer visibility with the API hopefully.
Thanks for the help, but this is the way I am already doing it and it is very time consuming. The rule would be run with task scheduler to re-stamp and up-rev drawings to as built. Maybe I will have to put it on the wish list to be able to select the tags with the API.
Hi everyone,
I was stuggling with this as well and then @Cris_Davis pointed out that while you can not delete the revision tags directly, you can delete the revision row or rows (assuming the row being deleted is not the active row) and the rev tags corresponding to rev row will be removed along with the row.
So with all of that in mind here is an example iLogic rule that will add a row to the rev table (making the new row the active row) and then delete all other rows along with any tags related to those rows, then it resets the revision number/letter.
I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com
Dim oDrawDoc As Inventor.DrawingDocument = ThisApplication.ActiveEditDocument Dim oRevTable As RevisionTable 'get the current rev letter oRev = iProperties.Value("Project", "Revision Number") Try 'try to get the first rev table on the active sheet oRevTable = oDrawDoc.ActiveSheet.RevisionTables.Item(1) Catch 'catch error when no rev table is found MessageBox.Show("Error: Most likely no revison table was found", "iLogic") End Try 'define the rev table rows collection Dim oRows As RevisionTableRows oRows = oRevTable.RevisionTableRows 'add new rev row, so that the old rows can be deleted oRows.Add() 'look at all of the rows in the rev table For Each oRow In oRows If oRow.IsActiveRow Then 'do nothing for the active row Else oRow.Delete 'deletes rev tags also End If Next 'set rev number/letter back to what it was iProperties.Value("Project", "Revision Number") = oRev ''Or set rev number/letter back to default 'iProperties.Value("Project", "Revision Number") = "A"
Is there a way to automatically delete the REV tags and the REV letter in the title block if I delete the rev table?
Revision tag is removed when you remove coresponding row from rev table. Code above works fine.
I want it to clear everything if I delete the entire table not just a row. I also want it to clear the Rev block in the title block. my issue is when I do a copy design and all that comes over I can't just delete the table and take the whole sheet back to no rev. we do not start at rev A and the guys in my dept. forget to go into iProperties and delete the rev letter so I want it that then they delete the table it takes the tags and title block letter with it.
Ok,
So before you delete table go troug rows and delete each of it. Then tags will be removed as well. Than go to iproperties and clear revision no. - i assume that in title block you have linked iproperty, if not correct title block as well.
the biggest problem is them remembering to clear it in the iProperties. so I don't care as much about the tags I mostly need it to clear the Rev block.
Dim oDrawDoc As Inventor.DrawingDocument = ThisApplication.ActiveEditDocument Dim oRevTable As RevisionTable 'get the current rev letter oRev = iProperties.Value("Project", "Revision Number") Try 'try to get the first rev table on the active sheet oRevTable = oDrawDoc.ActiveSheet.RevisionTables.Item(1) 'define the rev table rows collection Dim oRows As RevisionTableRows oRows = oRevTable.RevisionTableRows Dim orow As RevisionTableRow oRows.Add 'look at all of the rows in the rev table For Each oRow In oRows If orow.IsActiveRow Then 'do nothing for the active row Else orow.Delete 'deletes rev tags also End If Next oRevTable.Delete 'set rev number/letter back to what it was 'iProperties.Value("Project", "Revision Number") = oRev Dim odoc As Document odoc = oDrawDoc.ReferencedDocuments.Item(1) odoc.PropertySets.Item(1).Item("Revision Number").Value="" oDrawDoc.PropertySets.Item(1).Item("Revision Number").Value="" Catch 'catch error when no rev table is found MessageBox.Show("Error: Most likely no revison table was found", "iLogic")
Dim odoc As Document odoc = oDrawDoc.ReferencedDocuments.Item(1)
odoc.PropertySets.Item(1).Item("Revision Number").Value=""
oDrawDoc.PropertySets.Item(1).Item("Revision Number").Value="" End Try
Thank you this is what I wanted. Is there a way to create a custom button in the menu. I don't trust some of my guys to have the ilogic panel open. or a way that it runs the rule when the table is deleted. I know i'm asking a lot I just don't know much about ilogic and my boss is very particular about how things are done he wants it so people don't have to think lol
Try this, set it upt to be fires on drawing save event.
If ThisApplication.ActiveEditDocument.subtype="{BBF9FDF1-52DC-11D0-8C04-0800090BE8EC}" Then Dim oDrawDoc As Inventor.DrawingDocument = ThisApplication.ActiveEditDocument Dim oRevTable As RevisionTable 'get the current rev letter oRev = iProperties.Value("Project", "Revision Number") Try 'try to get the first rev table on the active sheet responce = MessageBox.Show("Do you want to delete revision data?", "revision", MessageBoxButtons.YesNo) If responce.ToString="Yes" Then oRevTable = oDrawDoc.ActiveSheet.RevisionTables.Item(1) 'define the rev table rows collection Dim oRows As RevisionTableRows oRows = oRevTable.RevisionTableRows Dim orow As RevisionTableRow oRows.Add 'look at all of the rows in the rev table For Each oRow In oRows If orow.IsActiveRow Then 'do nothing for the active row Else orow.Delete 'deletes rev tags also End If Next oRevTable.Delete 'set rev number/letter back to what it was 'iProperties.Value("Project", "Revision Number") = oRev Dim odoc As Document odoc = oDrawDoc.ReferencedDocuments.Item(1) odoc.PropertySets.Item(1).Item("Revision Number").Value="" oDrawDoc.PropertySets.Item(1).Item("Revision Number").Value = "" End If Catch 'catch error when no rev table is found MessageBox.Show("Error: Most likely no revison table was found", "iLogic") Dim odoc As Document odoc = oDrawDoc.ReferencedDocuments.Item(1) odoc.PropertySets.Item(1).Item("Revision Number").Value="" oDrawDoc.PropertySets.Item(1).Item("Revision Number").Value="" End Try End If
If ThisApplication.ActiveEditDocument.subtype="{BBF9FDF1-52DC-11D0-8C04-0800090BE8EC}" Then Dim oDrawDoc As Inventor.DrawingDocument = ThisApplication.ActiveEditDocument Dim oRevTable As RevisionTable 'get the current rev letter oRev = iProperties.Value("Project", "Revision Number") Try 'try to get the first rev table on the active sheet responce = MessageBox.Show("Do you want to delete revision data?", "revision", MessageBoxButtons.YesNo) If responce.ToString="Yes" Then oRevTable = oDrawDoc.ActiveSheet.RevisionTables.Item(1) 'define the rev table rows collection Dim oRows As RevisionTableRows oRows = oRevTable.RevisionTableRows Dim orow As RevisionTableRow oRows.Add 'look at all of the rows in the rev table For Each oRow In oRows If orow.IsActiveRow Then 'do nothing for the active row Else orow.Delete 'deletes rev tags also End If Next oRevTable.Delete 'set rev number/letter back to what it was 'iProperties.Value("Project", "Revision Number") = oRev Dim odoc As Document odoc = oDrawDoc.ReferencedDocuments.Item(1) odoc.PropertySets.Item(1).Item("Revision Number").Value="" oDrawDoc.PropertySets.Item(1).Item("Revision Number").Value = "" End If Catch 'catch error when no rev table is found MessageBox.Show("Error: Most likely no revison table was found", "iLogic") Dim odoc As Document odoc = oDrawDoc.ReferencedDocuments.Item(1) odoc.PropertySets.Item(1).Item("Revision Number").Value="" oDrawDoc.PropertySets.Item(1).Item("Revision Number").Value="" End Try End If
Is there a way I can have the iTrigger to run this as an external rule so this rule can be run in old drawings
I set it up as an external rule but the iTrigger button won't trigger the rule to run.
Dim oDrawDoc As Inventor.DrawingDocument = ThisApplication.ActiveEditDocument Dim oRevTable As RevisionTable trigger = iTrigger0 iLogicVb.UpdateWhenDone = True 'get the current rev letter oRev = iProperties.Value("Project", "Revision Number") Try 'try to get the first rev table on the active sheet oRevTable = oDrawDoc.ActiveSheet.RevisionTables.Item(1) 'define the rev table rows collection Dim oRows As RevisionTableRows oRows = oRevTable.RevisionTableRows Dim orow As RevisionTableRow oRows.Add 'look at all of the rows in the rev table For Each oRow In oRows If orow.IsActiveRow Then 'do nothing for the active row Else orow.Delete 'deletes rev tags also End If Next oRevTable.Delete 'set rev number/letter back to what it was 'iProperties.Value("Project", "Revision Number") = oRev Dim odoc As Document odoc = oDrawDoc.ReferencedDocuments.Item(1) odoc.PropertySets.Item(1).Item("Revision Number").Value="" oDrawDoc.PropertySets.Item(1).Item("Revision Number").Value="" Catch 'catch error when no rev table is found MessageBox.Show("Error: Most likely no revison table was found", "iLogic") End Try
Can't find what you're looking for? Ask the community or share your knowledge.