<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to add text in Bend Note in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/how-to-add-text-in-bend-note/m-p/10888577#M41363</link>
    <description>&lt;P&gt;I further developed the code to avoid the odd issue with the precision and tolerances.&amp;nbsp; Since neither you or I seem to be using any 'special' (non-default) settings for precision or tolerances, I added in a bit of code to completely replace all that unneeded special formatting for those things out of the BendAngle and BendRadius parts of the FormattedBendNote.&amp;nbsp; Also, you may want to change the special text it adds for a 90 degree bend to an empty string, instead of " (SQUARE) ".&amp;nbsp; I just included that for testing, to make sure everything was working as planned.&lt;/P&gt;
&lt;P&gt;See if this works for you now.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;Sub Main
	'get drawing document you want to target
	oDDoc = ThisDrawing.Document
	
	'specify what text to add after angle in different situations
	'we will use this later in the code
	oMap = ThisApplication.TransientObjects.CreateNameValueMap
	oMap.Add("&amp;lt;90", " (OPEN) ") 'angle is less than 90
	oMap.Add("=90", " (SQUARE) ") 'angle is 90
	oMap.Add("&amp;gt;90", " (CLOSE) ") 'angle is greater than 90

	For Each oSheet As Sheet In oDDoc.Sheets
		'if no bend notes on sheet, skip to next sheet
		If oSheet.DrawingNotes.BendNotes.Count = 0 Then Continue For
		oBNotes = oSheet.DrawingNotes.BendNotes
		For Each oBNote As BendNote In oBNotes
			oFBN = oBNote.FormattedBendNote
			'if this bend note does not contain any angle info, skip to next bend note
			If Not oFBN.Contains("&amp;lt;BendAngle") Then Continue For
			'create a variable to hold the text we will be adding after the angle
			Dim oTextToAdd As String = vbNullString
			'isolate and get the angle part of the text
			oParts = oBNote.Text.Split(" ") 'split into multiple sub-strings, by where spaces are
			Dim oAngle As String = vbNullString
			For Each oPart In oParts
				If oPart.Contains("°") Then 'if it contains the 'degree' mark
					oAngle = oPart
				End If
			Next
			'check to make sure we found the angle text
			If String.IsNullOrEmpty(oAngle) Then Continue For 'could not isolate the angle text
			'check angle (extract numerical value from String, then compare)
			If Val(oAngle) = 90 Then
				oTextToAdd = oMap.Value("=90") 'uses the Value of that place in the oMap
			ElseIf Val(oAngle) &amp;lt; 90 Then
				oTextToAdd = oMap.Value("&amp;lt;90") 'uses the Value of that place in the oMap
			ElseIf Val(oAngle) &amp;gt; 90 Then
				oTextToAdd = oMap.Value("&amp;gt;90") 'uses the Value of that place in the oMap
			End If
			'use our custom Function's below
			oFBN = FixBendAngle(oFBN, oTextToAdd)
			oFBN = FixRadius(oFBN)
			'now finally set the new value
			oBNote.FormattedBendNote = oFBN
		Next
	Next
End Sub

Function FixBendAngle(oFormattedBendNote As String, oTextToPutAfterAngle As String) As String
	'get BendAngle part of formatted text
	oPos1 = oFormattedBendNote.IndexOf("&amp;lt;BendAngle")
	oPos2 = oFormattedBendNote.IndexOf("&amp;lt;/BendAngle&amp;gt;") + Len("&amp;lt;/BendAngle&amp;gt;")
	oLen = oPos2 - oPos1
	oSubSt = oFormattedBendNote.Substring(oPos1, oLen)
	'MsgBox("oSubSt = " &amp;amp; oSubSt, , "")
	oResult = oFormattedBendNote.Replace(oSubSt, "&amp;lt;BendAngle&amp;gt; &amp;lt;/BendAngle&amp;gt;" &amp;amp; oTextToPutAfterAngle)
	Return oResult
End Function

Function FixRadius(oFormattedBendNote As String) As String
	'get Radius part of formatted text
	oPos1 = oFormattedBendNote.IndexOf("&amp;lt;BendRadius")
	oPos2 = oFormattedBendNote.IndexOf("&amp;lt;/BendRadius&amp;gt;") + Len("&amp;lt;/BendRadius&amp;gt;")
	oLen = oPos2 - oPos1
	oSubSt = oFormattedBendNote.Substring(oPos1, oLen)
	'MsgBox("oSubSt = " &amp;amp; oSubSt, , "")
	oResult = oFormattedBendNote.Replace(oSubSt, "&amp;lt;BendRadius&amp;gt; &amp;lt;/BendRadius&amp;gt;")
	Return oResult
End Function&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 18 Jan 2022 19:24:31 GMT</pubDate>
    <dc:creator>WCrihfield</dc:creator>
    <dc:date>2022-01-18T19:24:31Z</dc:date>
    <item>
      <title>How to add text in Bend Note</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/how-to-add-text-in-bend-note/m-p/10884825#M41357</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I want to add an extra note in bend note.&lt;/P&gt;&lt;P&gt;If the angle value smaller than 90°, add "OPEN" note, or "Close" Note for bigger angles&lt;/P&gt;&lt;P&gt;For example; The bend note is "DOWN 135° R1,5"; I want to write auotmatically "DOWN 135° (Closed) R1,5"&lt;/P&gt;&lt;P&gt;How can i create an ILogic rule about this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jan 2022 13:26:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/how-to-add-text-in-bend-note/m-p/10884825#M41357</guid>
      <dc:creator>f_yilmaz_82</dc:creator>
      <dc:date>2022-01-17T13:26:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to add text in Bend Note</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/how-to-add-text-in-bend-note/m-p/10884832#M41358</link>
      <description>&lt;P&gt;Credits go to&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5011186"&gt;@JelteDeJong&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Dim view As DrawingView = ThisApplication.CommandManager.Pick(
	           SelectionFilterEnum.kDrawingViewFilter,
	           "Select a drawing view")
If (view Is Nothing) Then Return
	
Dim bendCurves = view.DrawingCurves.Cast(Of DrawingCurve).
    Where(Function(curve) curve.EdgeType = DrawingEdgeTypeEnum.kBendDownEdge Or
                          curve.EdgeType = DrawingEdgeTypeEnum.kBendUpEdge).ToList()
						  
Dim bendNotes = view.Parent.DrawingNotes.BendNotes
For Each curve As DrawingCurve In bendCurves
    bendNotes.Add(curve)
Next&lt;/PRE&gt;</description>
      <pubDate>Mon, 17 Jan 2022 13:30:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/how-to-add-text-in-bend-note/m-p/10884832#M41358</guid>
      <dc:creator>m.van.valen_ECO</dc:creator>
      <dc:date>2022-01-17T13:30:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to add text in Bend Note</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/how-to-add-text-in-bend-note/m-p/10884949#M41359</link>
      <description>&lt;P&gt;Sorry i dont understand. Because i am new at I Logic.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want it to be like in the example below&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="f_yilmaz_82_0-1642428870942.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1012238iC83D86AF38F03BBE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="f_yilmaz_82_0-1642428870942.png" alt="f_yilmaz_82_0-1642428870942.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jan 2022 14:16:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/how-to-add-text-in-bend-note/m-p/10884949#M41359</guid>
      <dc:creator>f_yilmaz_82</dc:creator>
      <dc:date>2022-01-17T14:16:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to add text in Bend Note</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/how-to-add-text-in-bend-note/m-p/10885751#M41360</link>
      <description>&lt;P&gt;Hi &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3778620"&gt;@f_yilmaz_82&lt;/a&gt;.&amp;nbsp; This is likely going to be pretty challenging to achieve.&amp;nbsp; There is a lot of stuff going on behind the scenes of that fairly simple looking bend note on the drawing.&amp;nbsp; First of all, the default information shown by the bend line, is dictated by some settings within a dimension style.&amp;nbsp; On the Manage tab of the open/active drawing, click on the Styles Editor tool, to open up the main Style and Standard Editor dialog.&amp;nbsp; Then select the specific dimension style you were using when you created that bend note.&amp;nbsp; Now click on the 'Notes and Leaders' tab on the right part of the screen.&amp;nbsp; Now click on the Bend Notes icon just above the Note Format text box.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="WCrihfield_0-1642445804867.png" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1012402i629A01E494D9355A/image-size/large?v=v2&amp;amp;px=999" role="button" title="WCrihfield_0-1642445804867.png" alt="WCrihfield_0-1642445804867.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Here is where you can dictate which pieces of information should always be present, and in what order, and any other characters or special characters you may want to include.&amp;nbsp; However, you can't use anything like a If...Then statements in there for including the extra "(OPEN)" or "(CLOSED)" text you want.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To add that extra optional text in there, you will need some code to get the &lt;A href="https://help.autodesk.com/view/INVNTOR/2022/ENU/?guid=GUID-ECA28043-B57D-4028-8A8D-02DEA45AAE6B" target="_blank" rel="noopener"&gt;BendNote&lt;/A&gt; object in your &lt;A href="https://help.autodesk.com/view/INVNTOR/2022/ENU/?guid=GUID-D273D9C3-C24F-4CDD-B571-F2C0B5F7A5B3" target="_blank" rel="noopener"&gt;DrawingView&lt;/A&gt;, then you will need to check its contents, and be able to isolate just that angle part if the information, so you can check/compare it.&amp;nbsp; However, there are 3 different ways to check the 'contents' (a String) of that BendNote, and two of those returned Strings will include XML tag codes, which further complicates things.&amp;nbsp; In order to add the extra text into the bend note, in the location you are indicating, you will need to put it into the &lt;A href="https://help.autodesk.com/view/INVNTOR/2022/ENU/?guid=GUID-E6B50A5B-437C-4468-BCA2-3EA6C27BE41E" target="_blank" rel="noopener"&gt;BendNote.FormattedBendNote&lt;/A&gt;, which is one of those with the XML tags in it.&amp;nbsp; To give you some idea of what all is actually included in that, here is an iLogic rule that will find the first BendNote on the 'active' sheet of the drawing, then show you the 3 different contents in it.&amp;nbsp; The first one is the plain text, as it is seen on your drawing.&amp;nbsp; The second one shows you the FormattedBendNote contents using an InputBox, so you can copy the contents to a text file if you want, to better inspect it.&amp;nbsp; Then the third one is the FormattedText contents, also using an InputBox, so that it will be select-able and copy-able.&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;oDDoc = ThisDrawing.Document
oBNotes = oDDoc.ActiveSheet.DrawingNotes.BendNotes
oBNote = oBNotes.Item(1)
MsgBox("oBNote.Text = " &amp;amp; oBNote.Text,,"")
oFBNote = oBNote.FormattedBendNote
oFText = oBNote.FormattedText
a = InputBox("", "FormattedBendNote", oFBNote)
a = InputBox("", "FormattedText", oFText)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jan 2022 19:29:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/how-to-add-text-in-bend-note/m-p/10885751#M41360</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2022-01-17T19:29:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to add text in Bend Note</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/how-to-add-text-in-bend-note/m-p/10887385#M41361</link>
      <description>&lt;P&gt;Unfortunately i couldn't succeed. I tried some different ilogic codes but its not work.&lt;/P&gt;&lt;P&gt;There is a ilogic rule below. I tried it. It is working. But its only for&amp;nbsp;"135°" and "41°". I can write more number. But i know it is not true way.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;oDoc = ThisDoc.Document&lt;BR /&gt;oOriginalSheet = oDoc.ActiveSheet&lt;/P&gt;&lt;P&gt;'loop through sheets&lt;BR /&gt;For Each oSheet In oDoc.Sheets&lt;BR /&gt;oSheet.Activate&lt;BR /&gt;'loop through bend notes&lt;BR /&gt;For Each oNote In oSheet.DrawingNotes.BendNotes&lt;BR /&gt;'clear overrides (if any)&lt;BR /&gt;oNote.Hidevalue = False&lt;BR /&gt;oNote.Text = ""&lt;BR /&gt;'check direction and set note&lt;BR /&gt;If oNote.Text.Contains("135°") Then&lt;BR /&gt;oText = Replace(oNote.Text,"135°","135° (CLOSED)")&lt;BR /&gt;oNote.Hidevalue = True&lt;BR /&gt;oNote.Text = oText&lt;BR /&gt;End If&lt;BR /&gt;If oNote.Text.Contains("41°") Then&lt;BR /&gt;oText = Replace(oNote.Text,"41°","41° (OPEN)")&lt;BR /&gt;oNote.Hidevalue = True&lt;BR /&gt;oNote.Text = oText&lt;BR /&gt;End If&lt;BR /&gt;Next oNote&lt;BR /&gt;Next oSheet&lt;/P&gt;&lt;P&gt;'return to original sheet&lt;BR /&gt;oOriginalSheet.Activate&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jan 2022 11:49:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/how-to-add-text-in-bend-note/m-p/10887385#M41361</guid>
      <dc:creator>f_yilmaz_82</dc:creator>
      <dc:date>2022-01-18T11:49:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to add text in Bend Note</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/how-to-add-text-in-bend-note/m-p/10887878#M41362</link>
      <description>&lt;P&gt;Hi &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3778620"&gt;@f_yilmaz_82&lt;/a&gt;.&amp;nbsp; The code I posted was just to help you see all the hidden code contents behind the note, to give you a better idea of how Inventor keeps the text shown accurate and linked to the model.&amp;nbsp; Replacing all that with simple, non-coded text will break that link, and just won't work out as you are hoping for.&amp;nbsp; First of all, I see in your code that you are setting the BendNote.Text to a empty String, before testing its contents, which defeats the purpose and won't work, because there is nothing left to check.&amp;nbsp; Next, simply attempting to replace that angle value in the BendNote.Text with the same bend angle, plus some extra text won't work either, because all the formatting code still exists within the BendNote.FormattedBendNote, so you end up with different results than you are expecting.&amp;nbsp; You need to make the changes within the BendNote.FormattedBendNote, for them to turn out the way you want, which is going to be a bit trickier to do, due to the XML tags involved.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I created a simple example to test this functionality on.&amp;nbsp; I have small sheet metal part with a 90 degree bend in it, that I created a flat pattern view of in a drawing.&amp;nbsp; I added a default bend note to its one bend linen.&amp;nbsp; It reads "UP 90° R.13".&amp;nbsp; If I try to just replace the "90°" within the BendNote.Text, I end up with nearly twice as much text as I started with...essentially the original text, followed by the modified text.&amp;nbsp; So, since I know I need to be dealing with the BendNote.FormattedBendNote contents, and I know what text that holds due to the first code I posted, I know what to search for.&lt;/P&gt;
&lt;P&gt;The text within that is as follows:&lt;/P&gt;
&lt;P&gt;"&amp;lt;BendDirection/&amp;gt; &amp;lt;BendAngle Precision='2' UpperTolerance='0.000000' LowerTolerance='0.000000' ToleranceType='kSymmetricTolerance' TolerancePrecision='2'&amp;gt;&amp;lt;/BendAngle&amp;gt; R&amp;lt;BendRadius Precision='2' AlternatePrecision='2' UpperTolerance='0.000000' LowerTolerance='0.000000' ToleranceType='kSymmetricTolerance' TolerancePrecision='2' ToleranceAlternatePrecision='2'&amp;gt;&amp;lt;/BendRadius&amp;gt;"&lt;/P&gt;
&lt;P&gt;We can tell that there is a "&amp;lt;BendAngle" opener tag, then later a "&amp;lt;/BendAngle&amp;gt;" closing tag, all of which represents the "90°" part of the main Text.&amp;nbsp; And we know we want to insert our extra text after that, but before the rest of it.&amp;nbsp; So, here is an iLogic rule I created to do that, and it is working for my example.&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;oDDoc = ThisDrawing.Document
oSheet = oDDoc.ActiveSheet
oBNote = oSheet.DrawingNotes.BendNotes.Item(1)
If oBNote.Text.Contains("90°") Then
	oTerm = "&amp;lt;/BendAngle&amp;gt;" 'at the end of the bend angle note
	oFBN = oBNote.FormattedBendNote
	'find the position of that text within the overall text
	oPos = InStrRev(oFBN, oTerm)
	oBNote.FormattedBendNote = oFBN.Insert(oPos + Len(oTerm) -1, " (OPEN) ")
End If&lt;/LI-CODE&gt;
&lt;P&gt;This finds the position of the closing tag for the bend angle, so we can use that to help us know where to insert our extra text.&amp;nbsp; Then we set the new value of oBNote.FormattedBendNote to the new value we are inserting our extra text into.&amp;nbsp; Within that line, you see that I am also getting the length (# of characters) of the search term too, so that it will be inserted after the end of where that search term is found, instead of at the beginning of it.&amp;nbsp; The bend note in my drawing view now shows "UP 90°±.00° (OPEN) R.13±.00".&amp;nbsp; That's because, for some reason it toggled the settings within that note, and turned on the tolerances, that were previously not showing.&amp;nbsp; If I manually double click on that bend note, I get the small dialog labeled "Edit Bend Note" as seen here.&amp;nbsp; If I click on the Precision and Tolerance button, it will open up another small dialog labeled "Precision and Tolerance" as also seen here.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="WCrihfield_0-1642518138285.png" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1012801i716A59EB9050B815/image-size/large?v=v2&amp;amp;px=999" role="button" title="WCrihfield_0-1642518138285.png" alt="WCrihfield_0-1642518138285.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; If I click on the Precision and Tolerance button, it will open up another small dialog labeled "Precision and Tolerance" as also seen here.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="WCrihfield_1-1642518278734.png" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1012802iAA455FB9E3267818/image-size/large?v=v2&amp;amp;px=999" role="button" title="WCrihfield_1-1642518278734.png" alt="WCrihfield_1-1642518278734.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I had to uncheck both of those check boxes to the right, then check the box by "Use Global Precision", then click OK.&amp;nbsp; Then my bend note looked as I wanted it to ("UP 90° (OPEN) R.13").&amp;nbsp; Since I did not have any of that turned on to start with, I don't know why those settings were turned on afterwards, when all I did was inject that little bit of extra text in the middle of what was already there, but that's what happened in my case.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jan 2022 15:09:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/how-to-add-text-in-bend-note/m-p/10887878#M41362</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2022-01-18T15:09:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to add text in Bend Note</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/how-to-add-text-in-bend-note/m-p/10888577#M41363</link>
      <description>&lt;P&gt;I further developed the code to avoid the odd issue with the precision and tolerances.&amp;nbsp; Since neither you or I seem to be using any 'special' (non-default) settings for precision or tolerances, I added in a bit of code to completely replace all that unneeded special formatting for those things out of the BendAngle and BendRadius parts of the FormattedBendNote.&amp;nbsp; Also, you may want to change the special text it adds for a 90 degree bend to an empty string, instead of " (SQUARE) ".&amp;nbsp; I just included that for testing, to make sure everything was working as planned.&lt;/P&gt;
&lt;P&gt;See if this works for you now.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;Sub Main
	'get drawing document you want to target
	oDDoc = ThisDrawing.Document
	
	'specify what text to add after angle in different situations
	'we will use this later in the code
	oMap = ThisApplication.TransientObjects.CreateNameValueMap
	oMap.Add("&amp;lt;90", " (OPEN) ") 'angle is less than 90
	oMap.Add("=90", " (SQUARE) ") 'angle is 90
	oMap.Add("&amp;gt;90", " (CLOSE) ") 'angle is greater than 90

	For Each oSheet As Sheet In oDDoc.Sheets
		'if no bend notes on sheet, skip to next sheet
		If oSheet.DrawingNotes.BendNotes.Count = 0 Then Continue For
		oBNotes = oSheet.DrawingNotes.BendNotes
		For Each oBNote As BendNote In oBNotes
			oFBN = oBNote.FormattedBendNote
			'if this bend note does not contain any angle info, skip to next bend note
			If Not oFBN.Contains("&amp;lt;BendAngle") Then Continue For
			'create a variable to hold the text we will be adding after the angle
			Dim oTextToAdd As String = vbNullString
			'isolate and get the angle part of the text
			oParts = oBNote.Text.Split(" ") 'split into multiple sub-strings, by where spaces are
			Dim oAngle As String = vbNullString
			For Each oPart In oParts
				If oPart.Contains("°") Then 'if it contains the 'degree' mark
					oAngle = oPart
				End If
			Next
			'check to make sure we found the angle text
			If String.IsNullOrEmpty(oAngle) Then Continue For 'could not isolate the angle text
			'check angle (extract numerical value from String, then compare)
			If Val(oAngle) = 90 Then
				oTextToAdd = oMap.Value("=90") 'uses the Value of that place in the oMap
			ElseIf Val(oAngle) &amp;lt; 90 Then
				oTextToAdd = oMap.Value("&amp;lt;90") 'uses the Value of that place in the oMap
			ElseIf Val(oAngle) &amp;gt; 90 Then
				oTextToAdd = oMap.Value("&amp;gt;90") 'uses the Value of that place in the oMap
			End If
			'use our custom Function's below
			oFBN = FixBendAngle(oFBN, oTextToAdd)
			oFBN = FixRadius(oFBN)
			'now finally set the new value
			oBNote.FormattedBendNote = oFBN
		Next
	Next
End Sub

Function FixBendAngle(oFormattedBendNote As String, oTextToPutAfterAngle As String) As String
	'get BendAngle part of formatted text
	oPos1 = oFormattedBendNote.IndexOf("&amp;lt;BendAngle")
	oPos2 = oFormattedBendNote.IndexOf("&amp;lt;/BendAngle&amp;gt;") + Len("&amp;lt;/BendAngle&amp;gt;")
	oLen = oPos2 - oPos1
	oSubSt = oFormattedBendNote.Substring(oPos1, oLen)
	'MsgBox("oSubSt = " &amp;amp; oSubSt, , "")
	oResult = oFormattedBendNote.Replace(oSubSt, "&amp;lt;BendAngle&amp;gt; &amp;lt;/BendAngle&amp;gt;" &amp;amp; oTextToPutAfterAngle)
	Return oResult
End Function

Function FixRadius(oFormattedBendNote As String) As String
	'get Radius part of formatted text
	oPos1 = oFormattedBendNote.IndexOf("&amp;lt;BendRadius")
	oPos2 = oFormattedBendNote.IndexOf("&amp;lt;/BendRadius&amp;gt;") + Len("&amp;lt;/BendRadius&amp;gt;")
	oLen = oPos2 - oPos1
	oSubSt = oFormattedBendNote.Substring(oPos1, oLen)
	'MsgBox("oSubSt = " &amp;amp; oSubSt, , "")
	oResult = oFormattedBendNote.Replace(oSubSt, "&amp;lt;BendRadius&amp;gt; &amp;lt;/BendRadius&amp;gt;")
	Return oResult
End Function&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jan 2022 19:24:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/how-to-add-text-in-bend-note/m-p/10888577#M41363</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2022-01-18T19:24:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to add text in Bend Note</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/how-to-add-text-in-bend-note/m-p/10889657#M41364</link>
      <description>&lt;P&gt;Thank you so much for all.&lt;/P&gt;&lt;P&gt;It is working perfect.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jan 2022 06:52:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/how-to-add-text-in-bend-note/m-p/10889657#M41364</guid>
      <dc:creator>f_yilmaz_82</dc:creator>
      <dc:date>2022-01-19T06:52:36Z</dc:date>
    </item>
  </channel>
</rss>

