<?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: Error when adding note with ComponentIdentifier to drawing via API in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/error-when-adding-note-with-componentidentifier-to-drawing-via/m-p/14254130#M181683</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/12869906"&gt;@batuhanozmen98&lt;/a&gt;.&amp;nbsp; If you try the same code while the target drawing is visible, and the true active document, does it work then?&amp;nbsp; I suspect that placement of notes into drawings requires the target drawing to not only be visible, but the target Sheet object to also be that drawing's active Sheet.&amp;nbsp; Selection is the same way...only possible within Inventor's active document, not within invisible background documents.&amp;nbsp; Interaction with the model browser tree is similar, because we can 'read' it from a background document, but can not modify it in a background document.&amp;nbsp; I am not sure about the proper use of the 'Resolved' spec of Parameters within FormattedText though.&lt;/P&gt;</description>
    <pubDate>Thu, 03 Sep 2026 13:43:33 GMT</pubDate>
    <dc:creator>WCrihfield</dc:creator>
    <dc:date>2026-09-03T13:43:33Z</dc:date>
    <item>
      <title>Error when adding note with ComponentIdentifier to drawing via API</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/error-when-adding-note-with-componentidentifier-to-drawing-via/m-p/14254066#M181681</link>
      <description>&lt;P&gt;Im getting error while adding general note to the drawing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;DrawingNotes drawingNotes = oSheet.DrawingNotes;
GeneralNotes generalNotes = drawingNotes.GeneralNotes;
string formattedTextString = "&amp;lt;StyleOverride FontSize='0,4'&amp;gt;&amp;lt;Parameter Resolved='True' ComponentIdentifier='"+oPartDoc.FullFileName+"' Name='Thickness' Precision='2'&amp;gt;&amp;lt;/Parameter&amp;gt;&amp;lt;/StyleOverride&amp;gt;";
generalNotes.AddFitted(app.TransientGeometry.CreatePoint2d(5, 3), formattedTextString);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="batuhanozmen98_0-1788439577060.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1659569i2ED224E8C70493A0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="batuhanozmen98_0-1788439577060.png" alt="batuhanozmen98_0-1788439577060.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I created the text and parameter manually in a drawing and with a debug session I find this exact string at formatted text.&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;"&amp;lt;StyleOverride FontSize='0,4'&amp;gt;&amp;lt;Parameter Resolved='True' ComponentIdentifier='C:\\Users\\...\\Workspace\\sdabfgngfgn.ipt' Name='Thickness' Precision='2'&amp;gt;3,00&amp;lt;/Parameter&amp;gt;&amp;lt;/StyleOverride&amp;gt;"&lt;/LI-CODE&gt;&lt;P&gt;I am not sure where is the problem.&lt;/P&gt;&lt;P&gt;I Also tried:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;"&amp;lt;StyleOverride FontSize='0,4'&amp;gt;&amp;lt;Parameter Resolved='False' ComponentIdentifier='"+oPartDoc.FullFileName+"' Name='Thickness' Precision='2'&amp;gt;1,50&amp;lt;/Parameter&amp;gt;&amp;lt;/StyleOverride&amp;gt;"&lt;/LI-CODE&gt;&lt;P&gt;and&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;"&amp;lt;StyleOverride FontSize='0,4'&amp;gt;&amp;lt;Parameter Resolved='False' ComponentIdentifier='"+oPartDoc.FullFileName+"' Name='Thickness' Precision='2'&amp;gt;&amp;lt;/Parameter&amp;gt;&amp;lt;/StyleOverride&amp;gt;"&lt;/LI-CODE&gt;&lt;P&gt;and&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;"&amp;lt;StyleOverride FontSize='0,4'&amp;gt;&amp;lt;Parameter Resolved='True' ComponentIdentifier='"+oPartDoc.FullFileName+"' Name='Thickness' Precision='2'&amp;gt;1,50&amp;lt;/Parameter&amp;gt;&amp;lt;/StyleOverride&amp;gt;"&lt;/LI-CODE&gt;&lt;P&gt;and also tried just occurrence name for the component identifier but none of them worked.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and just to be safe I tried code at the below with&amp;nbsp;&lt;SPAN&gt;and It worked.&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;"&amp;lt;StyleOverride FontSize='0,25'&amp;gt; &amp;lt;Property Document='drawing' PropertySet='Inventor Summary Information' Property='Author' FormatID='' PropertyID=''&amp;gt;AUTHOR&amp;lt;/Property&amp;gt; &amp;lt;/StyleOverride&amp;gt;"&lt;/LI-CODE&gt;&lt;P&gt;the drawing is opened in background with false statement(DrawingDocument drawingdoc = (DrawingDocument)app.Documents.Open(oDrawingName, false);)&lt;/P&gt;&lt;P&gt;and the error is&amp;nbsp;"The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))" happening at&amp;nbsp;generalNotes.AddFitted method&lt;/P&gt;&lt;P&gt;Inventor vers.2021 and API netframework 4.7.2&lt;/P&gt;</description>
      <pubDate>Thu, 03 Sep 2026 12:46:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/error-when-adding-note-with-componentidentifier-to-drawing-via/m-p/14254066#M181681</guid>
      <dc:creator>batuhanozmen98</dc:creator>
      <dc:date>2026-09-03T12:46:23Z</dc:date>
    </item>
    <item>
      <title>Re: Error when adding note with ComponentIdentifier to drawing via API</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/error-when-adding-note-with-componentidentifier-to-drawing-via/m-p/14254130#M181683</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/12869906"&gt;@batuhanozmen98&lt;/a&gt;.&amp;nbsp; If you try the same code while the target drawing is visible, and the true active document, does it work then?&amp;nbsp; I suspect that placement of notes into drawings requires the target drawing to not only be visible, but the target Sheet object to also be that drawing's active Sheet.&amp;nbsp; Selection is the same way...only possible within Inventor's active document, not within invisible background documents.&amp;nbsp; Interaction with the model browser tree is similar, because we can 'read' it from a background document, but can not modify it in a background document.&amp;nbsp; I am not sure about the proper use of the 'Resolved' spec of Parameters within FormattedText though.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Sep 2026 13:43:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/error-when-adding-note-with-componentidentifier-to-drawing-via/m-p/14254130#M181683</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2026-09-03T13:43:33Z</dc:date>
    </item>
    <item>
      <title>Re: Error when adding note with ComponentIdentifier to drawing via API</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/error-when-adding-note-with-componentidentifier-to-drawing-via/m-p/14254181#M181684</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7812054"&gt;@WCrihfield&lt;/a&gt;&amp;nbsp;Thanks for the reply. I tried with visible document and&amp;nbsp;drawing but unfortunately get the same error. Also tried to give Thickness parameter export and key options but did not work.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Sep 2026 14:24:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/error-when-adding-note-with-componentidentifier-to-drawing-via/m-p/14254181#M181684</guid>
      <dc:creator>batuhanozmen98</dc:creator>
      <dc:date>2026-09-03T14:24:58Z</dc:date>
    </item>
    <item>
      <title>Re: Error when adding note with ComponentIdentifier to drawing via API</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/error-when-adding-note-with-componentidentifier-to-drawing-via/m-p/14254276#M181686</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;DrawingNotes drawingNotes = oSheet.DrawingNotes;
GeneralNotes generalNotes = drawingNotes.GeneralNotes;
string formattedTextString = "&amp;lt;StyleOverride FontSize='0,4'&amp;gt;&amp;lt;Parameter Resolved='True' ComponentIdentifier='"+oPartDoc.FullFileName+"' Name='Thickness' Precision='2'&amp;gt;&amp;lt;/Parameter&amp;gt;&amp;lt;/StyleOverride&amp;gt;";
// the &amp;lt;Parameter&amp;gt; tag is rejected by AddFitted's FormattedText argument (E_INVALIDARG);
// create the note with a plain placeholder and assign the markup afterwards
GeneralNote generalNote = generalNotes.AddFitted(app.TransientGeometry.CreatePoint2d(5, 3), " ", Type.Missing);
generalNote.FormattedText = formattedTextString;&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 03 Sep 2026 15:34:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/error-when-adding-note-with-componentidentifier-to-drawing-via/m-p/14254276#M181686</guid>
      <dc:creator>Ivan_Sinicyn</dc:creator>
      <dc:date>2026-09-03T15:34:09Z</dc:date>
    </item>
    <item>
      <title>Re: Error when adding note with ComponentIdentifier to drawing via API</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/error-when-adding-note-with-componentidentifier-to-drawing-via/m-p/14254281#M181688</link>
      <description>The error is almost certainly the ComponentIdentifier value. You're passing oPartDoc.FullFileName, but ComponentIdentifier isn't the file name or path, it's an internal reference token that ties the note to how the drawing view references that model. A file path there won't resolve, so the formatted-text parse or the parameter lookup fails. Two ways forward: 1. Simplest and robust: resolve the parameter value in code and drop it in as literal text. Read the Thickness parameter from the model (oPartDoc.ComponentDefinition.Parameters), get its value, and build the note string with that value. You lose the live link, but it never errors and it's a couple of lines. 2. If you need a live parameter link that updates with the model, get the correct ComponentIdentifier from the drawing's reference to that model rather than FullFileName. The note has to bind to the referenced document the view already points at, not to an arbitrary path. What's the exact error text on the Add call? If it's a parse error it's the formatted string; if it's on resolving the parameter it's the identifier. That says which of the two you're hitting.</description>
      <pubDate>Thu, 03 Sep 2026 15:37:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/error-when-adding-note-with-componentidentifier-to-drawing-via/m-p/14254281#M181688</guid>
      <dc:creator>josebaqueror</dc:creator>
      <dc:date>2026-09-03T15:37:48Z</dc:date>
    </item>
    <item>
      <title>Re: Error when adding note with ComponentIdentifier to drawing via API</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/error-when-adding-note-with-componentidentifier-to-drawing-via/m-p/14254936#M181697</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1777941"&gt;@Ivan_Sinicyn&lt;/a&gt;&amp;nbsp;It worked ! Thank you for the solution and also the explanation.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Sep 2026 05:28:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/error-when-adding-note-with-componentidentifier-to-drawing-via/m-p/14254936#M181697</guid>
      <dc:creator>batuhanozmen98</dc:creator>
      <dc:date>2026-09-04T05:28:45Z</dc:date>
    </item>
  </channel>
</rss>

