Community
Inventor Forum
Welcome to Autodesk’s Inventor Forums. Share your knowledge, ask questions, and explore popular Inventor topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

iLogic rule to remove all revision tags

19 REPLIES 19
SOLVED
Reply
Message 1 of 20
Stryder33345
3494 Views, 19 Replies

iLogic rule to remove all revision tags

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

19 REPLIES 19
Message 2 of 20
admaiora
in reply to: Stryder33345

Hi Ben,

 

Unfortunately Revision Tags aren't in the API Objects model.

You can delete revision tables, but not tags.

 

c.jpg

 

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.

_____________________________________________________________________________
Facebook | Twitter | Youtube

Message 3 of 20
-niels-
in reply to: Stryder33345

Is there a specific reason it needs to be iLogic?

You could just set a custom filter and window select all the revision tags.

Revision_tag_select.png

Will admit it's kinda strange that there's a filter for it in this menu, but not in the API. Smiley Frustrated


Niels van der Veer
Inventor professional user & 3DS Max enthusiast
Vault professional user/manager
The Netherlands

Message 4 of 20
MechMachineMan
in reply to: -niels-

MIght be able to make a work-around by window selecting the whole screen and automatically applying the revision tag custom filter, if any/all of that is accessible through the api.

--------------------------------------
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 5 of 20
Stryder33345
in reply to: admaiora

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.

Message 6 of 20
Stryder33345
in reply to: -niels-

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.

Message 7 of 20

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"
Message 8 of 20

Is there a way to automatically delete the REV tags and the REV letter in the title block if I delete the rev table?

Message 9 of 20

Revision tag is removed when you remove coresponding row from rev table. Code above works fine.

Message 10 of 20

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.  

Message 11 of 20

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.

Message 12 of 20

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. 

Message 13 of 20

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
Message 14 of 20

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

Message 15 of 20

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
		

 

Message 16 of 20

Thank you for the help! I got it to where it does what I wanted it too.

Message 17 of 20

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

Message 18 of 20

yes, save it as external tyle na set it up on drawing close or save. 

Message 19 of 20

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
Message 20 of 20

you should go trough event trigger and set external rule.

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

Post to forums  

Technology Administrators


Autodesk Design & Make Report