[iLogic / VBA ] Sort SkecthBlockDefinitions nodes on browser

[iLogic / VBA ] Sort SkecthBlockDefinitions nodes on browser

Luisfmts
Enthusiast Enthusiast
341 Views
0 Replies
Message 1 of 1

[iLogic / VBA ] Sort SkecthBlockDefinitions nodes on browser

Luisfmts
Enthusiast
Enthusiast

 

 

Hi everybody,

I was trying to make a rule for sorting sketchblocksdefinitions on browser, yet it looks a little bit confusing for me dealing with...even tho it looked easy on the first moment... 😅

Here's the code i was thinking to implement:

 

Sub Main()
Dim oDoc As PartDocument = ThisApplication.ActiveDocument Dim oBp As BrowserPane oBp = oDoc.BrowserPanes("PmDefault") Dim oBn As BrowserNode oBn = oBp.TopNode.BrowserNodes("Blocks") Dim oBn1 As BrowserNode = oBn.BrowserNodes(1) Dim oBn2 As BrowserNode = oBn.BrowserNodes(2) oBp.Reorder(oBn1, True, oBn2)

End sub

 


For me it seems like Inventor doesnt allow to move them.
I'm guessing this because mannually it is not possible and if I change the order of oBn1 and oBn2 OR if i change the bool value to false wich would make the code run through itself with no changes in the browser.

 

Does anyone have done something like this before?

Thanks.

 

Unsorted.jpg



342 Views
0 Replies
Replies (0)