Show if there is an DWG associated or not

Show if there is an DWG associated or not

Anonymous
Not applicable
477 Views
3 Replies
Message 1 of 4

Show if there is an DWG associated or not

Anonymous
Not applicable

Hi, 

 

Is there any iLogic or VB that can tell me for an specific assembly what parts/assemblies do not have an associated DWG? 

 

see idea: 

http://forums.autodesk.com/t5/inventor-ideastation/show-if-there-is-an-dwg-associated-or-not/idi-p/6...

 

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

NSBowser
Advocate
Advocate

Unlike how a drawing is aware of which parts/assemblies it references, there is no real link from a Part or Assembly to any corresponding drawings. When you right click on the browser and select 'Open Drawing' it simply checks the workspace for a .idw file with the same name as the corresponding file. 

 

IF your situation allows it, you can use the same logic to determine which files have drawings.

Loop through all the parts/assemblies in your assembly and check for each filename if the corresponding .idw exists.

 

I created a lightweight program for our users that works like a custom Windows Explorer. When a folder is navigated to it lists all of the Filenames in the first column and then each file type in subsequent columns. Something like that might be a solution for you as well.

 

 


Best of Luck

---------------------------------------------------------------------------------------------------------------------------------
If you find this reply helpful or insightful, please use the 'Accept as Solution' or 'Kudos' button below.
0 Likes
Message 3 of 4

rossano_praderi
Collaborator
Collaborator
Accepted solution

Hi Goncalves,

@NSBowser mean something like the follow code

 

 

This Add the text "(IDW)" or "(DWG)"

On Error Resume Next
Dim oAss As AssemblyDocument = ThisApplication.ActiveEditDocument
Dim bp As BrowserPane = ThisApplication.ActiveDocument.BrowserPanes.ActivePane
Dim node As BrowserNode
Dim oName As String

For Each node In bp.TopNode.BrowserNodes
    oName = Left(node.NativeObject.Definition.Document.FullFileName, _
                Len(node.NativeObject.Definition.Document.FullFileName) - 3)
    If System.IO.File.Exists(oName & "idw") Then
        node.NativeObject.Name = node.NativeObject.Name.Replace("(IDW) ", "")
        node.NativeObject.Name = ("(IDW) " & node.BrowserNodeDefinition.Label)
    End If
    If System.IO.File.Exists(oName & "dwg") Then
        node.NativeObject.Name = node.NativeObject.Name.Replace("(DWG) ", "")
        node.NativeObject.Name = ("(DWG) " & node.BrowserNodeDefinition.Label)
    End If
Next

 

This clean the added text

On Error Resume Next
Dim oAss As AssemblyDocument = ThisApplication.ActiveEditDocument
Dim bp As BrowserPane = ThisApplication.ActiveDocument.BrowserPanes.ActivePane
Dim node As BrowserNode
Dim oName As String

For Each node In bp.TopNode.BrowserNodes
    If InStr(1, node.BrowserNodeDefinition.Label, "(DWG) ") > 0 Then
        node.NativeObject.Name = node.BrowserNodeDefinition.Label.Replace( "(DWG) ", "")
    End If
    If InStr(1, node.BrowserNodeDefinition.Label, "(IDW) ") > 0 Then
        node.NativeObject.Name = node.BrowserNodeDefinition.Label.Replace( "(IDW) ", "")
    End If
Next

I hope you like it, is not perfect but work fine for me.

 

Bregs

Rossano Praderi



--------------------------------------
If my post answers your question, please click the "Accept as Solution"
button. This helps everyone find answers more quickly!
---------------
0 Likes
Message 4 of 4

rossano_praderi
Collaborator
Collaborator
Hi,
did you tried my code?


--------------------------------------
If my post answers your question, please click the "Accept as Solution"
button. This helps everyone find answers more quickly!
---------------
0 Likes