If you want a rule to apply to multiple parts it "can" be a good idea to make it an external rule..
If you ever change it you only need to change it once vs having to edit the code in each and every file..
Material should just be picked from the Materials drop down list in all parts..
Not sure what your material spec is composed of.. Do you have a few example of what specifically you need to show in the notes?
But I would likely create it as a custom iproperty if its something that couldn't be handled right in the material list itself..
You could just have an external rule with a list of all your available material specs or pull them from an excel file or lots of different ways depending on how set in stone those are/how often that list is updated,etc...
Here is one way just creating the list of material specs in your ilogic rule..
Play around and run this in a part then look at the custom iproperty tab
'Create an array of all of your material specs
Dim CustMatl As New ArrayList
CustMatl.Add("SPEC 1")
CustMatl.Add("SPEC 2")
CustMatl.Add("SPEC 3")
Try
'attempts to set the value.. If custom field not found it errors out, creates the property and tries again
iProperties.Value("Custom", "MATERIAL_SPEC") = InputListBox("MATERIAL", CustMatl, iProperties.Value("Custom", "MATERIAL_SPEC"), Title := "Material Spec", ListName := "Material Spec")
Catch
' Assume error means the property was not found
'define custom property collection
oCustomPropertySet = ThisDoc.Document.PropertySets.Item("Inventor User Defined Properties")
'create the custom property
oCustomPropertySet.Add("", "MATERIAL_SPEC")
'set the custom property value
iProperties.Value("Custom", "MATERIAL_SPEC") = InputListBox("MATERIAL", CustMatl, iProperties.Value("Custom", "MATERIAL_SPEC"), Title := "Material Spec", ListName := "Material Spec")
End Try
-------------------------------------------------------------------------------------------
Inventor 2023 - Dell Precision 5570
Did you find this reply helpful ? If so please use the Accept Solution button below.
Maybe buy me a beer through Venmo @mcgyvr1269