PromptString Пример |
Sub Example_PromptString() 'Этот пример создает определение признака блока. 'Затем вставляет блок. Затем изменяет строку подсказки определения 'признака и вставляет блок снова. 'Создайте блок Dim blockObj As AcadBlock Dim insertionPnt(0 To 2) As Double insertionPnt(0) = 0#: insertionPnt(1) = 0#: insertionPnt(2) = 0# Set blockObj = ThisDrawing.Blocks.Add(insertionPnt, "TEST") 'Добавьте круг Dim circleObj As AcadCircle Dim center(0 To 2) As Double Dim radius As Double center(0) = 0: center(1) = 0: center(2) = 0 radius = 1 Set circleObj = blockObj.AddCircle(center, radius) 'Определение признака Dim attributeObj As AcadAttribute Dim height As Double Dim mode As Integer Dim prompt As String Dim tag As String Dim value As String height = 1# mode = acAttributeModeVerify prompt = "Enter value:" insertionPnt(0) = 0#: insertionPnt(1) = 0#: insertionPnt(2) = 0 tag = "Tag1" value = "Circle1" 'Создайте определение признака блока Set attributeObj = blockObj.AddAttribute(height, mode, prompt, insertionPnt, tag, value) 'Вставьте блок Dim blockRefObj1 As AcadBlockReference insertionPnt(0) = 2#: insertionPnt(1) = 2#: insertionPnt(2) = 0 Set blockRefObj1 = ThisDrawing.ModelSpace.InsertBlock(insertionPnt, "TEST", 1#, 1#, 1#, 0) 'Измените строку подсказки и тэг определения признака attributeObj.PromptString = "Verify value:" 'Вставьте блок снова Dim blockRefObj2 As AcadBlockReference insertionPnt(0) = 4#: insertionPnt(1) = 4#: insertionPnt(2) = 0 Set blockRefObj2 = ThisDrawing.ModelSpace.InsertBlock(insertionPnt, "TEST", 1#, 1#, 1#, 0) ZoomAll End Sub