I am after some help writing a ilogic rule to look at all part numbers on .ipt DocumentType = 12290
workflow is needed is to find all .ipt within assemblies and if part number on .ipt does notch match file name (without extension) then add.
Also on seperate rule if rev number equals (blank) or - then revision number on all .ipt to equal 1
Any help would be appreciated
Solved! Go to Solution.
Curtis Waguespaeck has a lot of great information on iLogic on his blog:
Check it out
Here's a sample rule to do this. And thanks to Paul for the recomendation.
I hope this helps.
Best of luck to you in all of your Inventor pursuits,
'Define the open document Dim openDoc As Document openDoc = ThisDoc.Document Dim docFile As Document 'kAssemblyDocumentObject = 12291 If openDoc.DocumentType = 12291 Then 'Iterate though the part files in the assembly For Each docFile In openDoc.AllReferencedDocuments 'kPartDocumentObject = 12290 If docFile.DocumentType = 12290 Then 'format file name Dim FNamePos As Long FNamePos = InStrRev(docFile.FullFileName, "\", -1) Dim docFName As String 'returns file name with extension docFName = Right(docFile.FullFileName, Len(docFile.FullFileName) - FNamePos) 'returns the number of characters in the file name nameLen = Len(docFName) 'trims off the file extension (last 4 characters) nameNoExtension = Left(docFName,nameLen-4) 'set part number to file name (without extension) if iProperties.Value(docFName,"Project", "Part Number") <> nameNoExtension then iProperties.Value(docFName,"Project", "Part Number") = nameNoExtension else end if 'check for empty Rev # if iProperties.Value(docFName,"Project", "Revision Number") = "" then iProperties.Value(docFName,"Project", "Revision Number") = 1 else end if 'check for empty description if iProperties.Value(docFName,"Project", "Description") = "" then 'get a description from the user myDescription = InputBox("Enter Description.", "Description - "& docFName, iProperties.Value(docFName,"Project", "Description")) iProperties.Value(docFName,"Project", "Description") = myDescription else end if End If Next Else MessageBox.Show("You must have a valid Assembly document open before using this code!", "File Type Mismatch!") End If
Did you find this reply helpful ? If so please use the Accept as Solution or Kudos button below.
Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register
Start with some of our most frequented solutions to get help installing your software.