Hi
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
Dave
Solved! Go to Solution.
Solved by Curtis_Waguespack. Go to Solution.
Curtis Waguespaeck has a lot of great information on iLogic on his blog:
http://inventortrenches.blogspot.co.uk/2011/08/copy-design-and-revision-rolling-with.html
Check it out
Hi dclunie,
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,
Curtis
http://inventortrenches.blogspot.com
'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
Thank's very much for the code it works perfect and really fast ,it is appreciated
Dave
Sorry for jumping in a little late 😉
I found similar samples of iLogic on this forum to set iproperties in all leaf occurrences , but these samples never write to suppressed parts in the assembly.
Is it possible to have the code also effecting EVERY part in the assy included the suppressed ones?
All help very welcome
thanks
Joris