The code below could be used to help create the shortened bend lines. This will only run on the active AutoCAD drawing inside of AutoCAD. The routine could be set to run against a batch of drawings with a little more work.
Public Sub TrimBendLines()
'Change the following line to match your layer names
Dim BendLineLayer As String: BendLineLayer = "IV_BEND"
'Change the following line to adjust how much line is left
Dim Remnant As Double: Remnant = 0.5
'Variable to hold PI for angle calculations
Const PI As Double = 3.14159265358979
'Need to declare a selection set in AutoCAD to store bend lines for trimming
Dim SelSet As AcadSelectionSet
On Error Resume Next
ThisDrawing.SelectionSets.Add ("BendLines")
Set SelSet = ThisDrawing.SelectionSets.Item("BendLines")
SelSet.Clear
On Error GoTo 0
Dim FilterType(1) As Integer
Dim FilterData(1) As Variant
'Create filters so that we only select line objects on the bend line layer
FilterType(0) = 8: FilterData(0) = BendLineLayer
FilterType(1) = 0: FilterData(1) = "Line"
'Select the objects (if any exist)
SelSet.Select acSelectionSetAll, , , FilterType, FilterData
'If no bend lines are found then exit the sub routine
If SelSet.Count = 0 Then
Exit Sub
End If
'Set the active layer to the bend line layer for newly created lines
ThisDrawing.ActiveLayer = ThisDrawing.Layers.Item(BendLineLayer)
'Enumerate the selection set and shorten the exiting bend line
'Next we create a new bend line existing at the endpoint.
Dim L As AcadLine
For Each L In SelSet
Dim EndPoint As Variant: EndPoint = L.EndPoint
L.EndPoint = ThisDrawing.Utility.PolarPoint(L.StartPoint, L.Angle, Remnant)
Call ThisDrawing.ModelSpace.AddLine(ThisDrawing.Utility.PolarPoint(EndPoint, L.Angle - PI, Remnant), EndPoint)
Next
End Sub
Ronnie Wilkins, Jr.