Inventor Customization

Reply
Contributor
stian-j
Posts: 19
Registered: ‎10-27-2010
Message 1 of 7 (217 Views)
Accepted Solution

Hide revision rows

217 Views, 6 Replies
06-07-2011 04:01 AM

Is there any way to hide revision rows when reaching a specific number of rows? I only want to show the 5 latest rows in a drawing, so it would be great if the first rows could be disabled when adding a new row. I know it's possible to split a table when reaching a number of rows, but I would like to hide them instead.

Here's an iLogic rule to do it.  This will work on all revision tables in the drawing.

The rule won't run automatically when you add a row to the table.  However, you can at least make it run when the drawing is saved.  Use the Event Triggers command (on the Manage -> iLogic tab in the ribbon).  Attach the rule to the Before Save Document event.

 

Dim visibleRowsWanted As Integer = 5
For Each sheet As Sheet In ThisDrawing.Document.Sheets
For Each revTable As RevisionTable In sheet.RevisionTables
Trace.WriteLine(" --- " & revTable.Title)
Dim rows as RevisionTableRows = revTable.RevisionTableRows
Dim numberToHide As Integer = rows.Count - visibleRowsWanted
If (numberToHide <= 0) Then Continue For
For i = 1 To numberToHide
rows(i).Visible = False
Next
Next
Next

 

Brilliant, thanks a lot for your help!
Contributor
Mooref3
Posts: 14
Registered: ‎12-16-2010
Message 2 of 7 (210 Views)

Re: Hide revision rows

06-07-2011 07:52 AM in reply to: stian-j

Does right clicking and selecting Visibility do what you are looking for?

Contributor
stian-j
Posts: 19
Registered: ‎10-27-2010
Message 3 of 7 (207 Views)

Re: Hide revision rows

06-07-2011 09:42 AM in reply to: stian-j

I was hoping to achieve this by maybe by an ilogic rule or a macro, so it happens automatically when adding the sixth revision row. But i don't know if it's possible.

Employee
MjDeck
Posts: 959
Registered: ‎02-24-2009
Message 4 of 7 (202 Views)

Re: Hide revision rows

06-07-2011 11:25 AM in reply to: stian-j

Are you running Inventor 2012?  You can do it in 2012, but not in previous revisions.

 



Mike Deck
Software Developer
DLS - Mechanical Design
Autodesk, Inc.

Contributor
stian-j
Posts: 19
Registered: ‎10-27-2010
Message 5 of 7 (199 Views)

Re: Hide revision rows

06-07-2011 11:58 AM in reply to: stian-j
Yes, I'm running Inventor 2012 :smileyhappy:
Employee
MjDeck
Posts: 959
Registered: ‎02-24-2009
Message 6 of 7 (193 Views)

Re: Hide revision rows

06-07-2011 12:27 PM in reply to: stian-j

Here's an iLogic rule to do it.  This will work on all revision tables in the drawing.

The rule won't run automatically when you add a row to the table.  However, you can at least make it run when the drawing is saved.  Use the Event Triggers command (on the Manage -> iLogic tab in the ribbon).  Attach the rule to the Before Save Document event.

 

Dim visibleRowsWanted As Integer = 5

For Each sheet As Sheet In ThisDrawing.Document.Sheets
  For Each revTable As RevisionTable In sheet.RevisionTables
    Trace.WriteLine(" --- " & revTable.Title)
	Dim rows as RevisionTableRows = revTable.RevisionTableRows
	Dim numberToHide As Integer = rows.Count - visibleRowsWanted
	If (numberToHide <= 0) Then Continue For
	For i = 1 To numberToHide
	  rows(i).Visible = False
	Next
  Next
Next

 



Mike Deck
Software Developer
DLS - Mechanical Design
Autodesk, Inc.

Contributor
stian-j
Posts: 19
Registered: ‎10-27-2010
Message 7 of 7 (191 Views)

Re: Hide revision rows

06-07-2011 12:29 PM in reply to: stian-j
Brilliant, thanks a lot for your help!
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.