Message 1 of 1
mtext arial to BOLD

Not applicable
02-05-2009
04:37 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Why doesn't this mtext change to arial bold, If you run the message it says
it changes from not bold to bold but when you edit the mtext in the editor
the bold button if not displayed as active.
any ideas
Have a great day
John Coon
Sub mtextbold()
Dim pt1(0 To 2) As Double
Dim mtxtlabel As AcadMText
pt1(0) = 0#
pt1(1) = 0#
pt1(2) = 0
Dim typeFace As String
Dim Bold As Boolean
Dim charSet As Long
Dim PitchandFamily As Long
Dim Italic As Boolean
Dim txtStyleObj As AcadTextStyle
Set txtStyleObj = ThisDrawing.TextStyles.Add("wxytxt1")
' set font for new test style
txtStyleObj.SetFont "Arial", False, False, 0, 0
ThisDrawing.ActiveTextStyle = ThisDrawing.TextStyles.Item("wxytxt1")
ThisDrawing.ActiveTextStyle.GetFont typeFace, Bold, Italic, charSet,
PitchandFamily
'MsgBox "The current text style has the following font properties:" &
vbCrLf _
' & "Typeface: " & typeFace & vbCrLf _
'& "Bold: " & Bold & vbCrLf _
'& "Italic: " & Italic & vbCrLf _
'& "Character set: " & charSet & vbCrLf _
'& "Pitch and Family: " & PitchandFamily
' Change the bold property
Bold = Not Bold
ThisDrawing.ActiveTextStyle.SetFont typeFace, Bold, Italic, charSet,
PitchandFamily
' MsgBox "The current text style has the following font properties:" &
vbCrLf _
& "Typeface: " & typeFace & vbCrLf _
& "Bold: " & Bold & vbCrLf _
& "Italic: " & Italic & vbCrLf _
& "Character set: " & charSet & vbCrLf _
& "Pitch and Family: " & PitchandFamily
' Reset the font
Bold = Not Bold
ThisDrawing.ActiveTextStyle.SetFont typeFace, Bold, Italic, charSet,
PitchandFamily
Set mtxtlabel = ThisDrawing.PaperSpace.AddMText(pt1, 1, "1234.00")
mtxtlabel.Height = 0.06
mtxtlabel.Rotation = dblrot + 1.57
mtxtlabel.AttachmentPoint = acAttachmentPointMiddleLeft
mtxtlabel.InsertionPoint = pt1
Update
End Sub
it changes from not bold to bold but when you edit the mtext in the editor
the bold button if not displayed as active.
any ideas
Have a great day
John Coon
Sub mtextbold()
Dim pt1(0 To 2) As Double
Dim mtxtlabel As AcadMText
pt1(0) = 0#
pt1(1) = 0#
pt1(2) = 0
Dim typeFace As String
Dim Bold As Boolean
Dim charSet As Long
Dim PitchandFamily As Long
Dim Italic As Boolean
Dim txtStyleObj As AcadTextStyle
Set txtStyleObj = ThisDrawing.TextStyles.Add("wxytxt1")
' set font for new test style
txtStyleObj.SetFont "Arial", False, False, 0, 0
ThisDrawing.ActiveTextStyle = ThisDrawing.TextStyles.Item("wxytxt1")
ThisDrawing.ActiveTextStyle.GetFont typeFace, Bold, Italic, charSet,
PitchandFamily
'MsgBox "The current text style has the following font properties:" &
vbCrLf _
' & "Typeface: " & typeFace & vbCrLf _
'& "Bold: " & Bold & vbCrLf _
'& "Italic: " & Italic & vbCrLf _
'& "Character set: " & charSet & vbCrLf _
'& "Pitch and Family: " & PitchandFamily
' Change the bold property
Bold = Not Bold
ThisDrawing.ActiveTextStyle.SetFont typeFace, Bold, Italic, charSet,
PitchandFamily
' MsgBox "The current text style has the following font properties:" &
vbCrLf _
& "Typeface: " & typeFace & vbCrLf _
& "Bold: " & Bold & vbCrLf _
& "Italic: " & Italic & vbCrLf _
& "Character set: " & charSet & vbCrLf _
& "Pitch and Family: " & PitchandFamily
' Reset the font
Bold = Not Bold
ThisDrawing.ActiveTextStyle.SetFont typeFace, Bold, Italic, charSet,
PitchandFamily
Set mtxtlabel = ThisDrawing.PaperSpace.AddMText(pt1, 1, "1234.00")
mtxtlabel.Height = 0.06
mtxtlabel.Rotation = dblrot + 1.57
mtxtlabel.AttachmentPoint = acAttachmentPointMiddleLeft
mtxtlabel.InsertionPoint = pt1
Update
End Sub