Creating automatic note number

Creating automatic note number

86171VLTWG_2014_0F
Observer Observer
303 Views
3 Replies
Message 1 of 4

Creating automatic note number

86171VLTWG_2014_0F
Observer
Observer

I want an iLogic rule that creates an increasing text number string each time I insert a note into an Inventor drawing of type: "W001", W002" etc.  Any help is greatly appreciated!

86171VLTWG_2014_0F_0-1735563910708.png 

0 Likes
304 Views
3 Replies
Replies (3)
Message 2 of 4

bradeneuropeArthur
Mentor
Mentor

I could create you an add-in for that!

Is that also ok?

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 3 of 4

86171VLTWG_2014_0F
Observer
Observer
Thanks, that would be great!!
0 Likes
Message 4 of 4

C_Haines_ENG
Collaborator
Collaborator

I know @bradeneuropeArthur is making an Add-In but I thought I'd have a crack at it. With this code you can place multiple note leaders and it will name them all correctly! Just place the note leader how you normally would but don't enter any text! When you hit escape to back out of the tool it will update the names. Enjoy!

 

Sub Main

	Dim oDoc As DrawingDocument = ThisDoc.Document

	Dim oLeaderNotes As LeaderNotes = oDoc.ActiveSheet.DrawingNotes.LeaderNotes
	Dim oCount As Integer = oLeaderNotes.Count

	Dim oHighestNumber As New List(Of Integer)

	For Each oLeader As LeaderNote In oLeaderNotes
		If oLeader.Text.StartsWith("W")

			oHighestNumber.Add(Right(oLeader.Text, 2))

		End If
	Next

	ThisApplication.CommandManager.ControlDefinitions("DrawingLeaderTextCmd").Execute2(True)
	
	Dim oNoteNum As Integer = 1
	If oHighestNumber.Count <> 0 Then oNoteNum = oHighestNumber.Max + 1
		
	If oLeaderNotes.Count - oCount >= 1

		For i = oLeaderNotes.Count - (oLeaderNotes.Count - oCount) + 1 To oLeaderNotes.Count 
			
			Select Case oNoteNum
				Case < 10 
					oLeaderNotes(i).Text = "W00" & oNoteNum
				Case < 100 
					oLeaderNotes(i).Text = "W0" & oNoteNum
				Case >= 100
					oLeaderNotes(i).Text = "W" & oNoteNum
			End Select
			
			oNoteNum += 1

		Next

	Else

		Exit Sub

	End If
	
End Sub