Message 1 of 3
Code upgrade: Include layer change of leader text

Not applicable
07-10-2019
09:53 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
What the code does right now:
- It "Catches" a leader text, if it has a $ in front or another symbol of my choosing. It then changes the leader text to: Filename-XXX1 (next following number)
What I would like to include in this code is:
- That not only does it renumber the leaders with $ in front, but it also changes the default layer of the leader to a certain layer. In this case, the layer name is: TAG Number
Dim oDoc As DrawingDocument = ThisDoc.Document Dim Filename As String = Nothing Filename=System.IO.Path.GetFileNameWithoutExtension(oDoc.FullFileName) Dim i As Integer =1 For Each oLeaderNote As LeaderNote In oDoc.ActiveSheet.DrawingNotes.LeaderNotes oValue = oLeaderNote.Text If oValue.StartsWith("$") Then Dim no As String If i < 10 Then no = "0000" & i End If If i > 10 And i < 100 Then no = "000" & i End If If i > 100 And i < 1000 Then no = "00" & i End If If i > 1000 And i < 10000 Then no = "0" & i End If oLeaderNote.Text = ("$" & Filename & "-"& no ) i=i+1 End If Next