Hi, i would like a code that can check if every parts and assemblies contained i a main assembly have a drawing linked to it.
I would like every content center parts to be excluded.
i need to look in this folder C:\3D Novathermboiler LOCAL
Thanks.
Hi @felix.bouchard ,
Here is an example that will report which drawings exists for the models in the active assembly file.
I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com
Dim NoDrawingList As String Dim HasDrawingList As String Dim oDoc As Document = ThisApplication.ActiveDocument If oDoc.DocumentType <> DocumentTypeEnum.kAssemblyDocumentObject Then Exit Sub For Each xDoc As Document In oDoc.AllReferencedDocuments oPath = IO.Path.GetDirectoryName(xDoc.FullFileName) oModelName = IO.Path.GetFileName(xDoc.FullFileName) oName = IO.Path.GetFileNameWithoutExtension(xDoc.FullFileName) & ".idw" oDrawingFilePath = oPath & "\" & oName If System.IO.File.Exists(oDrawingFilePath) = True Then HasDrawingList = HasDrawingList & vbLf & oModelName Else NoDrawingList = NoDrawingList & vbLf & oModelName End If Next MsgBox("has drawing:" & vbLf & HasDrawingList & vbLf & vbLf & "has NO drawing:" & vbLf & NoDrawingList, , "iLogic")
This is great, is there a way to exclude the content center parts?
Thanks.
Hi @felix.bouchard ,
ooops! I thought I had that in there. ( I wrote this using a different method at first and then changed my mind and apparently dropped the CC line in doing so).
Give this a try ( note, I didn't test it just now, so post back it this doesn't work).
I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com
Dim NoDrawingList As String Dim HasDrawingList As String Dim oDoc As Document = ThisApplication.ActiveDocument If oDoc.DocumentType <> DocumentTypeEnum.kAssemblyDocumentObject Then Exit Sub For Each xDoc As Document In oDoc.AllReferencedDocuments If xDoc.DocumentType = DocumentTypeEnum.kPartDocumentObject Then If xDoc.ComponentDefinition.IsContentMember = True Then Continue For End If oPath = IO.Path.GetDirectoryName(xDoc.FullFileName) oModelName = IO.Path.GetFileName(xDoc.FullFileName) oName = IO.Path.GetFileNameWithoutExtension(xDoc.FullFileName) & ".idw" oDrawingFilePath = oPath & "\" & oName If System.IO.File.Exists(oDrawingFilePath) = True Then HasDrawingList = HasDrawingList & vbLf & oModelName Else NoDrawingList = NoDrawingList & vbLf & oModelName End If Next MsgBox("has drawing:" & vbLf & HasDrawingList & vbLf & vbLf & "has NO drawing:" & vbLf & NoDrawingList, , "iLogic")
Can't find what you're looking for? Ask the community or share your knowledge.