Hide Table of Contents
GetTextFormat Method (IAnnotation)

Gets the text format for the specified text in this annotation.

.NET Syntax

Visual Basic (Declaration) 
Function GetTextFormat( _
   ByVal Index As System.Integer _
) As System.Object
Visual Basic (Usage) 
Dim instance As IAnnotation
Dim Index As System.Integer
Dim value As System.Object
value = instance.GetTextFormat(Index)
System.object GetTextFormat( 
   System.int Index
System.Object^ GetTextFormat( 
&   System.int Index


Number indicating which text within this annotation to check

Return Value




The behavior of this method differs depending on the type of annotation.

  • Datum target and Datum feature symbols

    These symbols always use the document default setting for dimension text format to
    display text within the symbol. The index argument is not used and should be set
    to 0.
  • Geometric Tolerance, display dimensions, simple notes, surface finish, and weld symbols

    These symbols can either use the document default setting to display text within
    the symbol (dimension text setting for the geometric tolerance symbols and display
    dimensions, or note text setting for notes) or they can use a local format. The index
    argument is not used and should be set to 0.
  • Blocks (and compound notes in documents created with SOLIDWORKS 2015 and earlier)

    These symbols might contain several different pieces of text; each piece can use
    the document default setting for notes or a local format. The index argument identifies
    the text. The index value is 0-based. If the index value is invalid, then this method
    returns a Nothing or null pointer. To get the number of text or ITextFormat objects, use IAnnotation::GetTextFormatCount.
  • Rich text format

    If a note contains embedded rich text information in the string, then this method returns
    a text format that does not necessarily reflect what is displayed on the screen for
    that note. Use INote::HasMultipleFonts to determine if the note contains embedded
    rich text information.

ITextFormat is returned if it is for a local setting or for the document
default setting. To determine whether or not this annotation is using the document
default settings for text format, use IAnnotation::GetUseDocTextFormat. To set the
text format information, use IAnnotation::SetTextFormat.


See Also


SOLIDWORKS 2000 FCS, Revision Number 8.0.

Provide feedback on this topic

SOLIDWORKS welcomes your feedback concerning the presentation, accuracy, and thoroughness of the documentation. Use the form below to send your comments and suggestions about this topic directly to our documentation team. The documentation team cannot answer technical support questions. Click here for information about technical support.

* Required

Subject:   Feedback on Help Topics
Page:   GetTextFormat Method (IAnnotation)
*   I acknowledge I have read and I hereby accept the privacy policy under which my Personal Data will be used by Dassault Systèmes

Print Topic

Select the scope of content to print:


We have detected you are using a browser version older than Internet Explorer 7. For optimized display, we suggest upgrading your browser to Internet Explorer 7 or newer.

 Never show this message again

Web Help Content Version: API Help (English only) 2019 SP05

To disable Web help from within SOLIDWORKS and use local help instead, click Help > Use SOLIDWORKS Web Help.

To report problems encountered with the Web help interface and search, contact your local support representative. To provide feedback on individual help topics, use the “Feedback on this topic” link on the individual topic page.