Message 1 of 5
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello together,
I found this piece of code to delete instances of sketched symbols.
Public Sub Sketchsymbol_Delete() Dim oDoc As DrawingDocument Set oDoc = ThisApplication.ActiveDocument Dim oSheet As Sheet For Each oSheet In oDoc.Sheets oSheet.Activate Dim oSketchedSymbolDef As SketchedSymbolDefinition Set oSketchedSymbolDef = oDoc.SketchedSymbolDefinitions.Item("REVISION BLOCK") Set oSheet = oDoc.ActiveSheet Dim oTG As TransientGeometry Set oTG = ThisApplication.TransientGeometry Dim oSketchedSymbol As SketchedSymbol For X = 1 To oSheet.SketchedSymbols.Count If oSheet.SketchedSymbols.Item(X).Name = "REVISION BLOCK" Then oSheet.SketchedSymbols.Item(X).Delete 'Delete it from each sheet End If Next Next oSketchedSymbolDef.Delete 'Delete it from the library End Sub
When I run the code not all sketched symbols are deleted. I have to run the code several times. Is there any solution to run the code only once to delete the sketched symbols?
Thanks
Georg
Solved! Go to Solution.