Rotate addtext in VBA

Rotate addtext in VBA

Anonymous
Not applicable
2,906 Views
1 Reply
Message 1 of 2

Rotate addtext in VBA

Anonymous
Not applicable

Dear all,

 

I am new to this and actually have only a small question:

 

I have written some code to quickly generate circles with text on top.

 

CODE:

Private Sub CommandButton3_Click()
pi = 3.14159265358979
UserForm3.Hide
pt1 = ThisDrawing.Utility.GetPoint(, "Pick lower left corner:")

If (ComboBox27.Text) = "DN50" And (ComboBox14.Text) = "NO" Then
pt2 = ThisDrawing.Utility.PolarPoint(pt1, 0, Val(125))
pt3 = ThisDrawing.Utility.PolarPoint(pt2, pi / 2, Val(25))
pt5 = ThisDrawing.Utility.PolarPoint(pt1, 0, Val(250))
pt6 = ThisDrawing.Utility.PolarPoint(pt2, pi / 2, Val(70))
pt7 = ThisDrawing.Utility.PolarPoint(pt6, pi / 2, 0)

ThisDrawing.ModelSpace.AddLine pt1, pt5
ThisDrawing.ModelSpace.AddCircle pt3, Val(25)
ThisDrawing.ModelSpace.AddText "DN50", pt7, 50
Else
End If

 

My question is how do i rotate the DN50 text already in my VBA code? 

And also how do unbold the "DN50" text?

 

 

DN50 picture 2.png

 

 

0 Likes
2,907 Views
1 Reply
Reply (1)
Message 2 of 2

Ed__Jobe
Mentor
Mentor

Save the results of the Addxxx method to a variable. Then you have something with which to change properties.

 

Dim oText as AcadText

oText = ThisDrawing.ModelSpace.AddText "DN50", pt7, 50

oText.Rotation = 90

Ed


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
How to post your code.

EESignature

0 Likes