Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello All. Again, i am in deed of some programming assistance. i am writing code to delete a bunch of components from an assembly based on certain criteria. the code is working but it takes a while. for example, 30 seconds to delete 60 parts. however, if i choose the same components/parts interactively by a window, they delete in less than 10 seconds. so i thought that maybe by making a collection set, like for a pattern for example, i could delete them all at once and it would be quicker... however, i am stumbling on deleting the collection.is this possible? i assume there must be some way to delete all at once but....
Dim DELETE_THESE As ObjectCollection = oTO.CreateObjectCollection Dim oObjects_R As ObjectCollection = oTO.CreateObjectCollection
If InStr(CLEAR_BOX_NAME, "FLAT-CH") Or InStr(CLEAR_BOX_NAME, "-RA-")Then 'DELETE CHANNELS FOR S02 Logger.Debug("CHANNEL" & CLEAR_BOX_NAME) DELETE_THESE.Add(oCc23.Name) End If If oCc23.ActiveModelState = "NO_HOLES" Then 'Logger.Debug("let's move..." & oOcc.Name) DELETE_THESE.Add(oCc23.Name) End If If InStr(CLEAR_BOX_NAME, "BC") >0 Then Logger.Debug ("let delete it") End If Next HOW_MANY = DELETE_THESE.Count Logger.Debug("WE ARE DELETEING..." & HOW_MANY) 'For Each occName In DELETE_THESE ' Components.Delete(occName) 'Next Components.Delete(DELETE_THESE)
as always, any help/suggestions are gladly appreciated!
Solved! Go to Solution.