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

Add all dirty documents to browserpanes

Hello together,

 

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

 

Thank you Georg

xiaodong_liang
in reply to: GeorgK

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) ?
GeorgK
in reply to: xiaodong_liang

Hello Xiaodong,

 

Yes that's it what I want to do.

 

Georg

xiaodong_liang
in reply to: GeorgK

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

 

 

 

 

GeorgK
in reply to: xiaodong_liang

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

xiaodong_liang
in reply to: GeorgK

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