Message 1 of 7
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I use the following code to select a certain component (whether in the pattern or not) and suppress it.
Sub Main here : If ThisApplication.ActiveDocumentType <> kAssemblyDocumentObject Then MessageBox.Show("This rule is designed to only work in assembly documents.", "Wrong Document Type") : Exit Sub Dim PickLeafOC As ComponentOccurrence = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kAssemblyLeafOccurrenceFilter, "Select a Component to Delete") If IsNothing(PickLeafOC) Then Exit Sub' If nothing gets selected then we're done PickLeafOC.Suppress() GoTo here End Sub
However, I would also like to see the code when the selected component gets deleted. I thought to replace Suppress with Delete or Delete2 but that does not work.
If somebody knows how to do it, please let me know.
Tom
Solved! Go to Solution.