- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi, I'm no expert in ilogic code but I need help. I'm looking through a lot of posts but I can't find a way so if someone have an idea, please help.
My goal : Have an Ilogic code that look through all the parts in an assembly, then check if they have a drawings created.
If the part have a drawing : Run an external rule
If the part doesn't have a drawing : tells me which one (I dont care how I didn't figure out yet)
So I "stole😂" a code from a post. Everything works but the problem is my drawings are in a different folder. Im trying to make it search through all subfolder from a defined path. Here is the code :
Imports System.IO
Dim oAss As AssemblyDocument = ThisApplication.ActiveDocument
Dim oRefDoc As Document
Dim ofilepath As String = "D:\ThisIsThePathIWant"
Dim oArray As New ArrayList
For Each oRefDoc In oAss.AllReferencedDocuments
Dim ofilename As String
ofilename = Left(oRefDoc.DisplayName, oRefDoc.DisplayName.Length - 4) & ".idw"
If System.IO.File.Exists(ofilepath & ofilename) = False
oArray.Add(oRefDoc.DisplayName)
End If
Next
Do
odrawing = InputListBox("Prompt", oArray)
If odrawing = "" Then Return
For Each oRefDoc In oAss.AllReferencedDocuments
If oRefDoc.DisplayName = odrawing
ThisApplication.Documents.Open(oRefDoc.FullDocumentName)
End If
Next
oArray.Remove(odrawing)
LoopI don't need help for the external rule thing I will find a way by my own but I really need help for the looking through every folder. Thanks a lot
Solved! Go to Solution.