AttachmentPoint Пример

Sub Example_AttachmentPoint()
    Dim MTextObj As AcadMText
    Dim width As Double
    Dim text As String
    Dim count As Integer
    Dim attachPoint As String
    Dim corner(0 To 2) As Double
        
    corner(0) = 3#: corner(1) = 3#: corner(2) = 0#
    width = 10
    text = "Hello, World."
    ' Создает объект MText в пространстве модели
    Set MTextObj = ThisDrawing.ModelSpace.AddMText(corner, width, text)

    For count = 1 To 9
        MTextObj.AttachmentPoint = count
    
        ' Получает точку положения объекта MText
        attachPoint = Choose(MTextObj.AttachmentPoint, "TopLeft", "TopCenter", "TopRight", "MiddleLeft", "MiddleCenter", "MiddleRight", "BottomLeft", "BottomCenter", "BottomRight")
    
        ThisDrawing.Regen True
        MsgBox "Точка положения MText - теперь: " & attachPoint, vbInformation, "AttachmentPoint Пример"
    Next
End Sub
Сайт управляется системой uCoz