GetBoundingBox method example
Sub GetBoundingBox_Example()
Dim myText As String
Dim textObj As AcadText
Dim insPt(0 To 2) As Double
Dim height As Double
insPt(0) = 3: insPt(1) = 7: insPt(2) = 0
height = 5
myText = "Test string for bounding box"
Set textObj = ThisDrawing.ModelSpace.AddText(myText, insPt, height)
textObj.Update
ThisDrawing.Application.ZoomExtents
Dim LL As Variant
Dim UR As Variant
textObj.GetBoundingBox LL, UR
MsgBox "The extents of the bounding box for the text are:" & Chr(13) & _
"Lower Left: " & LL(0) & ", " & LL(1) & Chr(13) & "Max Extent: " & UR(0) & ", " & UR(1)
End Sub
© Bricsys NV. All rights reserved. |