看起来是这样的:
- Attribute VB_Name = "RichtungAendern"
- Option Explicit
- 'Attribute VB_Name = "Richtung Ändern"
- 'Reverse line direction - German Version
- Sub RichtungAendern()
- Dim objLineEnt As AcadEntity
- Dim txtEnt As AcadText
- Dim linEnt As AcadLine
- Dim orgLineAngle As Double
- Dim varSelPoint As Variant
- Dim linAngle As Double
- Dim PI As Double
- Dim varLineStart As Variant
- Dim varLineEnd As Variant
- Dim varTemp As Variant
- 'initialise variables
- varSelPoint = 0#
- 'get a line
- Do
- On Error Resume Next
- START:
- ThisDrawing.Utility.GetEntity objLineEnt, varSelPoint, "eine Linie wählen"
- Dim entName As String
- entName = objLineEnt.ObjectName
-
- 'only process if a line was selected
- If objLineEnt.ObjectName = "AcDbLine" Then
- varLineStart = objLineEnt.StartPoint
- varLineEnd = objLineEnt.EndPoint
- varTemp = varLineStart
- varLineStart = varLineEnd
- varLineEnd = varTemp
- objLineEnt.color = acRed
- objLineEnt.Update
- Else 'inform user that no line was selected
- MsgBox ("das war keine Linie!" & vbCr & "Bitte eine Linie wählen")
- GoTo START
- End If
- Loop 'go back and get another line
- End Sub
_____u_ _NU_NU _ _它将线条颜色更新为红色,但不交换端点。 |