Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

Displaying TextGraphics in fixed position

prakash.muthu
Advocate

Displaying TextGraphics in fixed position

prakash.muthu
Advocate
Advocate

Hi,

How to draw text graphics in fixed position and should not change on scrolling up/down. 

 

Dim oTextGraphics As TextGraphics

oTextGraphics.Anchor = oTG.CreatePoint(0, 0, 0)

oTextGraphics.Text = "user name displayed here"

 

This always changing text position on changing up/down scrolling. Instead it should always fixed position to view always and not moving with point.

 

0 Likes
Reply
190 Views
1 Reply
Reply (1)

WCrihfield
Mentor
Mentor

Hi @prakash.muthu.  Have you considered using a ModelGeneralNote for that situation.  The text in one of those will stay where you specify, based on your model area's view frame, instead of a position in model space.  It simply allows you to specify which quadrant of the screen you want the text to be shown in.  Below are some links to the online help pages for the associated API objects, and their methods.

ModelAnnotations

ModelGeneralNotes

ModelGeneralNotes.CreateDefinition Method

ModelGeneralNotes.Add Method

And here is a simple example that can be used on either a part or assembly:

 

Dim oMAs As ModelAnnotations = ThisDoc.Document.ComponentDefinition.ModelAnnotations
Dim oMGNs As ModelGeneralNotes = oMAs.ModelGeneralNotes
Dim sFText As String = "My Stationary Text Here"
Dim oMGNDef As ModelGeneralNoteDefinition
oMGNDef = oMGNs.CreateDefinition(sFText, True, ScreenQuadrantEnum.kUpperLeftQuadrant)
Dim oMGN As ModelGeneralNote = oMGNs.Add(oMGNDef)
oMGN.Name = "My Stationary Text Note 1"
oMGN.Visible = True

 

If this solved your problem, or answered your question, please click ACCEPT SOLUTION .
Or, if this helped you, please click (LIKE or KUDOS) 👍.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes