|
Annotation Пример |
Sub Example_Annotation()
' Этот пример создает выноску в пространстве модели со связанной
' аннотацией и затем проверяет существование объекта Annotation для
' нового Leader
Dim leaderObj As AcadLeader, MTextObj As AcadMText
Dim points(0 To 8) As Double, insertionPoint(0 To 2) As Double, width As Double
Dim leaderType As Integer
Dim annotationObject As Object
Dim textString As String, msg As String
' Определите новый объект MText
textString = "Hello, World."
insertionPoint(0) = 5: insertionPoint(1) = 5: insertionPoint(2) = 0
width = 2
' Создайте объект MText в пространстве модели
Set MTextObj = ThisDrawing.ModelSpace.AddMText(insertionPoint, width, textString)
' Данные для Leader
points(0) = 0: points(1) = 0: points(2) = 0
points(3) = 4: points(4) = 4: points(5) = 0
points(6) = 4: points(7) = 5: points(8) = 0
leaderType = acLineWithArrow
' Создайте объект Leader в пространстве модели и Associate новый объект MText с новым Leader, делая объект MText аннотацией для Leader
Set annotationObject = MTextObj
Set leaderObj = ThisDrawing.ModelSpace.AddLeader(points, annotationObject, leaderType)
ThisDrawing.Application.ZoomAll
' Отображение, действительно ли эта Leader имеет связанный Annotation
msg = IIf(leaderObj.Annotation Is Nothing, "does not have", "has")
MsgBox "Новый объект Leader " & msg & " связанный объект Annotation. "
End Sub