<?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 Is there a Easy way to Text box that always writt the part number of the file? in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/is-there-a-easy-way-to-text-box-that-always-writt-the-part/m-p/12155986#M156130</link>
    <description>&lt;P&gt;Is there a Easy way to Text box that always writt the part number of the file? I would like that if I make a part with an laser cut text, then if I copy it later and create a new file.. the new file will have the new part number lasercut into the part. ? what is the easy way to do that `?&lt;/P&gt;</description>
    <pubDate>Tue, 08 Aug 2023 06:35:43 GMT</pubDate>
    <dc:creator>Darkforce_the_ilogic_guy</dc:creator>
    <dc:date>2023-08-08T06:35:43Z</dc:date>
    <item>
      <title>Is there a Easy way to Text box that always writt the part number of the file?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/is-there-a-easy-way-to-text-box-that-always-writt-the-part/m-p/12155986#M156130</link>
      <description>&lt;P&gt;Is there a Easy way to Text box that always writt the part number of the file? I would like that if I make a part with an laser cut text, then if I copy it later and create a new file.. the new file will have the new part number lasercut into the part. ? what is the easy way to do that `?&lt;/P&gt;</description>
      <pubDate>Tue, 08 Aug 2023 06:35:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/is-there-a-easy-way-to-text-box-that-always-writt-the-part/m-p/12155986#M156130</guid>
      <dc:creator>Darkforce_the_ilogic_guy</dc:creator>
      <dc:date>2023-08-08T06:35:43Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a Easy way to Text box that always writt the part number of the file?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/is-there-a-easy-way-to-text-box-that-always-writt-the-part/m-p/12156016#M156131</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5708980"&gt;@Darkforce_the_ilogic_guy&lt;/a&gt;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For a begining here is a code that changes a text box.. text. Asuming the text box is alone in the sketch and the said sketch is the second one of the part :&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="visual-basic"&gt;Dim doc As Inventor.PartDocument = ThisApplication.ActiveDocument
Dim pcd As Inventor.PartComponentDefinition = doc.ComponentDefinition
Dim sk As Inventor.PlanarSketch = pcd.Sketches.Item(2)
Dim txtbox As Inventor.TextBox = sk.TextBoxes.Item(1)

Dim newText As String = "Testing"
Dim actualText As String = txtbox.Text
Dim fText As String = txtbox.FormattedText

sk.Edit
txtbox.FormattedText = fText.Replace(actualText, newText)

sk.ExitEdit&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For the automation I would probably put the rule on the Open Document trigger. It would read the iProperty and put the value instead of the newText string. I guess you could accomplish that ?&lt;BR /&gt;&lt;BR /&gt;Kind regards,&lt;/P&gt;&lt;P&gt;FINET L.&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;FINET L.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Aug 2023 06:59:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/is-there-a-easy-way-to-text-box-that-always-writt-the-part/m-p/12156016#M156131</guid>
      <dc:creator>FINET_Laurent</dc:creator>
      <dc:date>2023-08-08T06:59:31Z</dc:date>
    </item>
  </channel>
</rss>

