Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

iLogic rule to switch Revision Table sizes defined in Styles

6 REPLIES 6
SOLVED
Reply
Message 1 of 7
Greatwhitenorth
1488 Views, 6 Replies

iLogic rule to switch Revision Table sizes defined in Styles

Hi. 

I'm hoping someone can help with this.  I have a rule in the .idw drawing template, that displays a dialog box asking for the size (A, B, C, D...).  Once the size is selected, it displays the appropriate border and title block.  There is a small & large title block, so an A or B size gets the small, and a C or larger gets the large.  This works great.

 

My question is, how can I have the appropriately sized Revision Table (small or large), automatically ready for use, based on the drawing size?  The (2) Revision Tables are defined in the Styles library.

 

Thanks in advance.

 

Bob

____________________________________________________
Product Design & Manufacturing Collection 2021 | Vault Professional 2021
Dell Precision 7670 | Intel i7-12850HX - 2100 Mhz - 64GB
nVIDIA RTX A3000 12GB | Windows 10/64 Pro
6 REPLIES 6
Message 2 of 7

Can anybody help with this?

 

TIA

____________________________________________________
Product Design & Manufacturing Collection 2021 | Vault Professional 2021
Dell Precision 7670 | Intel i7-12850HX - 2100 Mhz - 64GB
nVIDIA RTX A3000 12GB | Windows 10/64 Pro
Message 3 of 7

of thread - but I have a similar issue.

 

I have 2 different revision tables and need to be able to swap them out via illogic.

Has anyone done something similar?

 

TIA

Message 4 of 7

Yes, there is a way

 

RevisionTable.Style Property
Parent Object: RevisionTable
Description 
Property that gets and sets the style associated with this object.
Syntax 
RevisionTable.Style() As RevisionTableStyle

--------------------------------------
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 7


@lynlaysaymo wrote:

of thread - but I have a similar issue.

 

I have 2 different revision tables and need to be able to swap them out via illogic.

Has anyone done something similar?

 

TIA


Hi lynlaysaymo,

 

Here is an example that toggles between two named rev table styles.

 

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
'set rev block style	
Dim oRevTable As RevisionTable	
Dim oRevStyle1 As RevisionTableStyle
oRevStyle1 = oDrawDoc.StylesManager.RevisionTableStyles.Item("RevBlock Style1")
Dim oRevStyle2 As RevisionTableStyle
oRevStyle2 = oDrawDoc.StylesManager.RevisionTableStyles.Item("RevBlock Style2")	

Dim oCurrentNumber  As Sheet
oCurrentNumber = oDrawDoc.ActiveSheet

For Each oSheet In oDrawDoc.Sheets
oSheet.Activate

	Try ' Get the revision table 
		oRevTable = oDrawDoc.ActiveSheet.RevisionTables.Item(1)
		
		'toggle rev style
		If oRevTable.Style.Name = "RevBlock Style1" Then
			oRevTable.Style = oRevStyle2
		Else 
			oRevTable.Style = oRevStyle1
		End If
				
		oSheet.Update
		
	Catch 'catch error
		Return 'exit when no rev table is found
	End Try	

Next 'sheet
Message 6 of 7

thanks guys works well, cant accept as solution as I hijacked an old thread 😞

Message 7 of 7

Here's a quick update to the last rule I posted.

 

That one exited the rule if no rev block was found on a sheet, rather than skipping the sheet and moving on to the next one.

 

This one behaves as expected:

 

Dim oDrawDoc As Inventor.DrawingDocument = ThisApplication.ActiveEditDocument
'set rev block style	
Dim oRevTable As RevisionTable	
Dim oRevStyle1 As RevisionTableStyle
oRevStyle1 = oDrawDoc.StylesManager.RevisionTableStyles.Item("RevBlock Style1")
Dim oRevStyle2 As RevisionTableStyle
oRevStyle2 = oDrawDoc.StylesManager.RevisionTableStyles.Item("RevBlock Style2")	

Dim oCurrentNumber  As Sheet
oCurrentNumber = oDrawDoc.ActiveSheet

For Each oSheet In oDrawDoc.Sheets
oSheet.Activate

	Try ' Get the revision table 
		oRevTable = oDrawDoc.ActiveSheet.RevisionTables.Item(1)
		
		'toggle rev style
		If oRevTable.Style.Name = "RevBlock Style1" Then
			oRevTable.Style = oRevStyle2
		Else 
			oRevTable.Style = oRevStyle1
		End If
				
		oSheet.Update
		
	Catch 'catch error
		Continue For move on  when no rev table is found
	End Try	

Next 'sheet

oCurrentNumber.Activate

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

Post to forums  

Autodesk Design & Make Report