<?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: Translating leader notes on idw using i-logic in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/translating-leader-notes-on-idw-using-i-logic/m-p/9823610#M56947</link>
    <description>&lt;P&gt;Hi Michael&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks, can you please give some example to put on the i-logic below&lt;/P&gt;&lt;P&gt;- from Spanish to the Indonesian language&lt;/P&gt;&lt;P&gt;- old text: COMO SE MESTRA&lt;/P&gt;&lt;P&gt;- new text: SEPERTI PETUNJUK&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Appreciated your help and advise&lt;/P&gt;</description>
    <pubDate>Mon, 26 Oct 2020 02:23:51 GMT</pubDate>
    <dc:creator>didin.suryadi6JREK</dc:creator>
    <dc:date>2020-10-26T02:23:51Z</dc:date>
    <item>
      <title>Translating leader notes on idw using i-logic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/translating-leader-notes-on-idw-using-i-logic/m-p/9819816#M56945</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am converting the drawing which has so many notes in other languages such as Spanish etc.&lt;/P&gt;&lt;P&gt;Can we make an i-logic to replace all notes with defined text from any language using i-logic?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;RGds&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Didin&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Spanish notes to be english by i-logic.JPG" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/835274i9B7358AD0051BD81/image-size/large?v=v2&amp;amp;px=999" role="button" title="Spanish notes to be english by i-logic.JPG" alt="Spanish notes to be english by i-logic.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Oct 2020 07:10:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/translating-leader-notes-on-idw-using-i-logic/m-p/9819816#M56945</guid>
      <dc:creator>didin.suryadi6JREK</dc:creator>
      <dc:date>2020-10-23T07:10:05Z</dc:date>
    </item>
    <item>
      <title>Re: Translating leader notes on idw using i-logic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/translating-leader-notes-on-idw-using-i-logic/m-p/9820939#M56946</link>
      <description>&lt;P&gt;For static text is it very easy, but you need to specify languages from and to.&lt;/P&gt;&lt;P&gt;But this approach is very vulnerable. When somebody change anything in the text, this method can't translate it.&lt;/P&gt;&lt;P&gt;Better approach is to use some "textId" stored in LeaderNote attributes. Then user can specify this textId (select from list of corresponding texts) and then you store this id to attributes. When you start translation, you just read this textId and from target dictionary select appropriate text.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Sub Main
	Dim drawing As DrawingDocument = ThisDoc.Document
	Dim activeSheet As Sheet = drawing.ActiveSheet
	For Each oLeaderNote As LeaderNote In activeSheet.DrawingNotes.LeaderNotes
		Dim oldText = oLeaderNote.FormattedText
		Dim newText = Translate(oldText, "en", "es")
		If newText IsNot Nothing Then
			oLeaderNote.FormattedText = newText
		End If
	Next
End Sub

Dim enDictionary As New List(Of String)({
"EN description"
})


Dim esDictionary As New List(Of String)({
"ES descripción"
})


Dim deDictionary As New List(Of String)({
"DE Beschreibung"
})

Function Translate(oldText As String, fromLang As String, toLang As String) As String
	Dim fromDictionary = GetDictionary(fromLang)
	Dim toDictionary = GetDictionary(toLang)
	Dim i = fromDictionary.IndexOf(oldText)
	If i &amp;gt;= 0 Then
		Return toDictionary(i)
	Else
		Return Nothing
	End If
End Function

Function GetDictionary(lang As String) As List(Of String)
	Select Case lang
		Case "en"
			Return enDictionary
		Case "es"
			Return esDictionary
		Case "de"
			Return deDictionary
		Case Else
			Return Nothing
	End Select
End Function&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Oct 2020 16:02:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/translating-leader-notes-on-idw-using-i-logic/m-p/9820939#M56946</guid>
      <dc:creator>Michael.Navara</dc:creator>
      <dc:date>2020-10-23T16:02:01Z</dc:date>
    </item>
    <item>
      <title>Re: Translating leader notes on idw using i-logic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/translating-leader-notes-on-idw-using-i-logic/m-p/9823610#M56947</link>
      <description>&lt;P&gt;Hi Michael&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks, can you please give some example to put on the i-logic below&lt;/P&gt;&lt;P&gt;- from Spanish to the Indonesian language&lt;/P&gt;&lt;P&gt;- old text: COMO SE MESTRA&lt;/P&gt;&lt;P&gt;- new text: SEPERTI PETUNJUK&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Appreciated your help and advise&lt;/P&gt;</description>
      <pubDate>Mon, 26 Oct 2020 02:23:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/translating-leader-notes-on-idw-using-i-logic/m-p/9823610#M56947</guid>
      <dc:creator>didin.suryadi6JREK</dc:creator>
      <dc:date>2020-10-26T02:23:51Z</dc:date>
    </item>
  </channel>
</rss>

