- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Im getting error while adding general note to the drawing.
DrawingNotes drawingNotes = oSheet.DrawingNotes;
GeneralNotes generalNotes = drawingNotes.GeneralNotes;
string formattedTextString = "<StyleOverride FontSize='0,4'><Parameter Resolved='True' ComponentIdentifier='"+oPartDoc.FullFileName+"' Name='Thickness' Precision='2'></Parameter></StyleOverride>";
generalNotes.AddFitted(app.TransientGeometry.CreatePoint2d(5, 3), formattedTextString);
I created the text and parameter manually in a drawing and with a debug session I find this exact string at formatted text.
"<StyleOverride FontSize='0,4'><Parameter Resolved='True' ComponentIdentifier='C:\\Users\\...\\Workspace\\sdabfgngfgn.ipt' Name='Thickness' Precision='2'>3,00</Parameter></StyleOverride>"I am not sure where is the problem.
I Also tried:
"<StyleOverride FontSize='0,4'><Parameter Resolved='False' ComponentIdentifier='"+oPartDoc.FullFileName+"' Name='Thickness' Precision='2'>1,50</Parameter></StyleOverride>"and
"<StyleOverride FontSize='0,4'><Parameter Resolved='False' ComponentIdentifier='"+oPartDoc.FullFileName+"' Name='Thickness' Precision='2'></Parameter></StyleOverride>"and
"<StyleOverride FontSize='0,4'><Parameter Resolved='True' ComponentIdentifier='"+oPartDoc.FullFileName+"' Name='Thickness' Precision='2'>1,50</Parameter></StyleOverride>"and also tried just occurrence name for the component identifier but none of them worked.
and just to be safe I tried code at the below with and It worked.
"<StyleOverride FontSize='0,25'> <Property Document='drawing' PropertySet='Inventor Summary Information' Property='Author' FormatID='' PropertyID=''>AUTHOR</Property> </StyleOverride>"the drawing is opened in background with false statement(DrawingDocument drawingdoc = (DrawingDocument)app.Documents.Open(oDrawingName, false);)
and the error is "The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))" happening at generalNotes.AddFitted method
Inventor vers.2021 and API netframework 4.7.2
Solved! Go to Solution.