Jump to content

Recommended Posts

Posted

I intend positioning text using the following code but it always ends up at 0,0. What am I doing wrong?

 

Private Sub CommandButton2_Click()
Dim myString As String
Dim Pos(2) As Double
Dim myText As AcadText
Dim myPos As Variant
Pos(0) = 43.62: Pos(1) = 43.03: Pos(2) = 0
myPos = Pos
Set myText = ThisDrawing.ModelSpace.AddText(txtIssue.Text, myPos, 4)
myText.color = acCyan
myText.Alignment = acAlignmentMiddleCenter
ThisDrawing.Regen acAllViewports
End Sub

Posted
I intend positioning text using the following code but it always ends up at 0,0. What am I doing wrong?

 

Private Sub CommandButton2_Click()
Dim myString As String
Dim Pos(2) As Double
Dim myText As AcadText
Dim myPos As Variant
Pos(0) = 43.62: Pos(1) = 43.03: Pos(2) = 0
myPos = Pos
Set myText = ThisDrawing.ModelSpace.AddText(txtIssue.Text, myPos, 4)
myText.color = acCyan
myText.Alignment = acAlignmentMiddleCenter
ThisDrawing.Regen acAllViewports
End Sub

 

Add TextAlignmentPoint:

myText.Alignment = acAlignmentMiddleCenter
myText.TextAlignmentPoint = myPos

 

~'J'~

Posted
excellent - thank you :)

 

You're welcome

Cheers :)

 

~'J'~

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...