Message 1 of 7
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Looking for some help on creating some ilogic code to replace obsolete components in assemblies when the assembly is opened and it contains that part.
Currently I've just add this simple code to each component that is obsolete so when I open an assembly it "reminds" me to manually replace it
MessageBox.Show ("0200058003 is Obsolete" & vbLf & "Please replace with 0230061111", "OBSOLETE ALERT", MessageBoxButtons.OKCancel, MessageBoxIcon.Error)
BUT.. Now I'd like to see if there is a way so that when an assembly is opened with an obsolete part that it will automatically replace it.
Tried this but it doesn't work (note this code is located in the obsolete part file not in the assembly..
MessageBox.Show("0200058003.ipt is obsolete", "Obsolete") 'Run this only if this is an assembly. doc = ThisDoc.ModelDocument If doc.DocumentType = kAssemblyDocumentObject Then Component.Replace("0200058003", "0230061111.ipt", True) MessageBox.Show("0200058003 has been replaced", "Obsolete Replaced") End If
-------------------------------------------------------------------------------------------
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
Solved! Go to Solution.