Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

Add all dirty documents to browserpanes

GeorgK
Advisor

Add all dirty documents to browserpanes

GeorgK
Advisor
Advisor

Hello together,

 

how could I add all dirty documents to a browser pane?

 

Thank you Georg

0 Likes
Reply
482 Views
5 Replies
Replies (5)

xiaodong_liang
Autodesk Support
Autodesk Support
Hi Georg,

can I understand you want to add the part/sub-assembly nodes (the corresponding document is dirty) to your own browerpane (custom pane) ?
0 Likes

GeorgK
Advisor
Advisor

Hello Xiaodong,

 

Yes that's it what I want to do.

 

Georg

0 Likes

xiaodong_liang
Autodesk Support
Autodesk Support

Hi Georg,

 

you just need to iterate the occurrences of assembly document and get which one is dirty, and add them to your browser pane.

 

The below is a blog on how to create custom browser pane. It shows adding an Inventor document node to the custom pane. 

http://adndevblog.typepad.com/manufacturing/2013/07/add-a-new-custom-pane-and-add-node-from-a-defaul...

 

As to iterate occurrences, the code could be:

Sub test()

    Dim oDoc  As AssemblyDocument
    Set oDoc = ThisApplication.ActiveDocument
     
    Dim oAssDef As AssemblyComponentDefinition
    Set oAssDef = oDoc.ComponentDefinition
    
    Dim oOcc As ComponentOccurrence
    Dim oEachDoc As Document
    For Each oOcc In oAssDef.Occurrences
        Set oEachDoc = oOcc.Definition.Document
        If oEachDoc.Dirty = True Then
            'Add it to your browser pane
        End If
        
    Next
    

End Sub

 

 

 

 

0 Likes

GeorgK
Advisor
Advisor

Hello Xiaodong,

 

the problem is not to loop through the assembly and find the dirty files. But how could I add them to the browserpane or change the icon from files which are dirty?

 

Thank you Georg

0 Likes

xiaodong_liang
Autodesk Support
Autodesk Support

Hi Georg,

 

may I know whether you have taken a look at that blog link I posted in the last message? it exactly shows how to add a document to the custom browser pane.

 

As to change the icon of the browser node, please refer to the two blogs below. Although it is talking about client feature, it is similar to change the icon. i.e. the core codes are:

 

 

  ‘create the resource of icon. assume a bitmap 1.bmp exists  ‘ in c:\temp 
        Dim oCnr As ClientNodeResource 
        
        Dim oIcon As IPictureDisp 
        Set oIcon = stdole.LoadPicture("C:\temp\1.bmp") 
        
        ' Create a client node resource. 
        Set oCnr = oDoc.BrowserPanes.ClientNodeResources.Add("SamplePocketFeature", -1, oIcon)

        ' Override the icon for the client feature. 
        oNode.BrowserNodeDefinition.OverrideIcon = oCnr

  

 

 

http://adndevblog.typepad.com/manufacturing/2015/01/change-icon-of-clientfeature-node-in-built-in-br...

http://adndevblog.typepad.com/manufacturing/2012/08/change-the-browser-node-icon.html

 

0 Likes