Hello, I made this macro in VBA to calculate the perimeter of a polyline and insert dimensions in all the segments. Public Function LengthOfPolyline(PLine As AcadLWPolyline) As Double Dim ExplodedObjects As Variant On Error Resume Next ExplodedObjects = PLine.Explode Dim Index As Integer Dim Perimeter As Double Dim line As AcadLine Dim punto1(0 To 2) As Double Dim punto2(0 To 2) As Double Dim loc(0 To 2) As Double Dim quota As AcadDimension For Index = 0 To UBound(ExplodedObjects) Perimeter = Perimeter + ExplodedObjects(Index).Length Set line = ExplodedObjects(Index) punto1(0) = line.StartPoint(0) punto1(1) = line.StartPoint(1) punto1(2) = line.StartPoint(2) punto2(0) = line.EndPoint(0) punto2(1) = line.EndPoint(1) punto2(2) = line.EndPoint(2) loc(0) = punto1(0) + ((punto2(0) - punto1(0)) / 2) loc(1) = punto1(1) + ((punto2(1) - punto1(1)) / 2) loc(2) = 0 'Disegno la quota Set quota = ThisDrawing.ModelSpace.AddDimAligned(punto1, punto2, loc) quota.Layer = "QUOTE" line.Delete Next Index ThisDrawing.Regen True LengthOfPolyline = Round(Perimeter) End Function Dimensions are “Aligned Dimensions†but I want to have “Linear Dimensionsâ€. How can I resolve this matter? Thank you Diego Alejandro Talledo