Activate Alpha Sort Sheets from Inventor VBA

Activate Alpha Sort Sheets from Inventor VBA

ChristiPedersen
Advocate Advocate
319 Views
3 Replies
Message 1 of 4

Activate Alpha Sort Sheets from Inventor VBA

ChristiPedersen
Advocate
Advocate

Is there a way to activate the Drawing Tools - Alpha Sort Sheets from the API?  I can see Drawing Tools under ThisApplication.ApplicationAddIns but cannot see sub items under Drawing Tools.

0 Likes
Accepted solutions (1)
320 Views
3 Replies
Replies (3)
Message 2 of 4

WCrihfield
Mentor
Mentor
Accepted solution

I know this likely isn't what you were hoping for, but below is the 'InternalName' which can be executed like a command, which would be like simulating clicking on that tool.

"DrawingTools.AlphaSortSheets"

I'm guessing that in order to access anything specific under or within that add-in, you would most likely have to include some sort of 'AddReference' and/or 'Imports' type lines in the header of the iLogic rule editor, to enable recognition of the resources within.  I have not dug into it that far yet though.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 3 of 4

ChristiPedersen
Advocate
Advocate

Actually that pointed me in the right direction.  I used the command manager to activate it instead.  Thank you.

0 Likes
Message 4 of 4

JelteDeJong
Mentor
Mentor

I see that you already found a solution but if you want you can also do this in an iLogic rule like this:

Dim doc As DrawingDocument = ThisDoc.Document
Dim browserPane As BrowserPane = doc.BrowserPanes.Item("Model")

Dim sheets = doc.Sheets.Cast(Of Sheet).OrderBy(Function(s) s.Name).ToList()

For Each sheet As Sheet In sheets
    Dim sheetNode As BrowserNode = browserPane.GetBrowserNodeFromObject(Sheet)
    Dim bottomNode As BrowserNode = browserPane.TopNode.BrowserNodes.Item(browserPane.TopNode.BrowserNodes.Count)
    If (sheetNode Is bottomNode) Then Continue For
    browserPane.Reorder(bottomNode, False, sheetNode)
Next

Jelte de Jong
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.

EESignature


Blog: hjalte.nl - github.com

0 Likes