> LeonidSN
make error это была логическаеа строка а не оператор. Сейчас с ACAD не работаю так что вырезал код из контекста проекта и выложил тут.
> Артем
Чертим линию и после сразу подписываем пример основан на отлове ошибки
Public Sub TopoText(ac As Object)
SetZeroHeightTextStyleCurrent ac
DisableDraw90Pl ac
PrintMessage ac, 25 'Specify layer name:
DelByLayer ac, GoToLayer(ac, Replace(ac.Utility.getstring(False), "/", ""))
PrintMessage ac, 39 'Specify layer name for text:
strTemp3 = Replace(ac.Utility.getstring(False), "/", "")
OsmodeOff ac 'SetVar ac, "OSMODE", 0
PrintMessage ac, 38 'Specify text height:
strTemp2 = " " & Replace(ac.Utility.getstring(False), "/", "") & " "
PrintMessage ac, 23 'Specify angle:
strTemp4 = Replace(ac.Utility.getstring(False), "/", "") & " "
Dim oPoly As AcadLWPolyline
Dim optClose As Boolean
j = 0
On Error Resume Next
PrintMessage ac, 36 'Pick starting point:
varTemp = ac.Utility.GetPoint
If Err = 0 Then
ReDim MasVertex(1)
MasVertex(j) = varTemp(0): MasVertex(j + 1) = varTemp(1)
Do Until Err.Number <> 0
j = j + 2
varTemp = ac.Utility.GetPoint(varTemp, vbCr & GetMessage(37)) '...add new point:
ReDim Preserve MasVertex(UBound(MasVertex) + 2)
MasVertex(j) = varTemp(0): MasVertex(j + 1) = varTemp(1)
If oPoly Is Nothing Then
Set oPoly = ac.ModelSpace.AddLightWeightPolyline(MasVertex)
Else
oPoly.Coordinates = MasVertex
End If
Loop
Dim basePnt(0 To 2) As Double
Dim nextPnt(0 To 2) As Double
On Error Resume Next
basePnt(0) = MasVertex(0): basePnt(1) = MasVertex(1): basePnt(2) = 0#
nextPnt(0) = MasVertex(2): nextPnt(1) = MasVertex(3): nextPnt(2) = 0#
ZoomToPoint ac, basePnt, Trim(strTemp2) * 10
If strTemp4 = 360 Then
retAngle = ac.Utility.AngleFromXAxis(basePnt, nextPnt)
If retAngle > PI * 0.5 And retAngle < PI * 1.5 Then
retAngle = retAngle + PI
End If
Else
retAngle = Ang2Rad(Trim(strTemp4))
End If
GoToLayer ac, strTemp3
SendCmdEX ac, "_text " & Replace(MasVertex(0), ",", ".") & "," & Replace(MasVertex(1), ",", ".") & strTemp2 & Replace(Rad2Ang(retAngle), ",", ".") & " ", True
End If
OsmodeOff ac, False
End Sub