Message 1 of 4

Not applicable
03-21-2017
12:57 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am attempting to use iLogic to alter a custom property on a series of drawing sheets. The sheets will each show a different model so the property can be different on each sheet.
The section of iLogic code that I am using is below. It works on the first sheet in the series, but leaves the property on all other sheets blank. Any suggestions?
For Each oSheet In oSheets oSheet.activate If ThisDoc.ModelDocument IsNot Nothing Then docFile = ThisDoc.ModelDocument Else MessageBox.Show("This drawing has no model reference", "iLogic") Return End If FNamePos = InStrRev(docFile.FullFileName, "\", -1) docFName = Right(docFile.FullFileName, Len(docFile.FullFileName) - FNamePos) 'define the property set customPropertySet = docFile.PropertySets.Item("Inventor User Defined Properties") 'look for the custom property and add it if not found Try prop = customPropertySet.Item("MATERIAL") Catch customPropertySet.Add("", "MATERIAL") End Try matl = iProperties.Material(docFName) iProperties.Value(docFName, "Custom", "Material") = matl 'iProperties.Value(oModelName, "Custom", "Vendor") Next iLogicVb.UpdateWhenDone = True
Solved! Go to Solution.