11-02-2023
12:35 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
11-02-2023
12:35 PM
You may need to get the placement and sketch symbol definition from the existing sketch symbol, delete it and place another one using SketchedSymbols.Add(). It doesn't really looks like you can remove leaders from sketch symbols, but you can add them...
Edit:
I was mistaken. After fooling around with it more, you can delete the all the Nodes in the leader of each sketch symbol:
Dim oDrawDoc As DrawingDocument = ThisApplication.ActiveDocument
Dim oSheet As Sheet = oDrawDoc.ActiveSheet
Dim oSketchedSymbols As SketchedSymbols = oSheet.SketchedSymbols
For Each oItem As SketchedSymbol In oSketchedSymbols
If Not oItem.Leader Is Nothing AndAlso Not oItem.Leader.AllNodes Is Nothing Then
While Not oItem.Leader.AllNodes Is Nothing AndAlso oItem.Leader.AllNodes.Count > 0
oItem.Leader.AllNodes(1).Delete
End While
End If
Next
edit2: code fix