MText "lines" of text
MText "lines" of text
(OP)
Any way on ACAD 2004 VBA to find the number of text lines in an MText "paragraph", or do ya just have to figure it out somehow by using the bounding box and text height?
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS Come Join Us!Are you an
Engineering professional? Join Eng-Tips Forums!
*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail. Posting GuidelinesJobs |
|
RE: MText "lines" of text
"Everybody is ignorant, only on different subjects." — Will Rogers
RE: MText "lines" of text
Dim blockObj As AcadBlock
Dim mtextObj As AcadMText
Dim insertPoint(0 To 2) As Double
Dim txwid As Variant
Dim txht as Variant
Dim txstr as String
Dim minExt As Variant
Dim maxExt As Variant
Dim junk as Variant
'set text data
insertPoint(0) = 0
insertPoint(1) = 0
insertPoint(2) = 0
txwid = 3 'sets text box width
txht = 0.25
txstr = "THIS PLACE IS NICE" 'sets text
'Create a text Object in the blocks model space
Set mtextObj = blockObj.AddMText(insertPoint, txwid, txstr)
mtextObj.Height = txht
'set ratio between text lines (1 = 0.66666 times height)
mtextObj.LineSpacingFactor = "1"
'Get bounding box info
mtextObj.GetBoundingBox minExt, maxExt
junk = Int((maxExt(1) - minExt(1)) / (txht * 1.66667) + 1)
MsgBox "MText lines = " & junk, vbInformation, "MText"
RE: MText "lines" of text
[copy] paragraph out of the way..
[explode] copied mtext to dtext..
[erase] dtext and refer to command line for how many entities were erased