you must use AddDimAligned method wich has the sintax "RetVal = object.AddDimAligned(ExtLine1Point, ExtLine2Point, TextPosition)", where all parameters are three-element array of doubles.
so try this
Code:
Option Explicit
Sub DimAlignd()
' Dim ws As variant '<---- I'd not use variant variable for what you already know it'll be a "Range" object
Dim ws As range'<---- Use proper object type variable instead
Dim ACAD As AcadApplication
On Error Resume Next
Set ACAD = GetObject(, "AutoCAD.Application")
On Error GoTo 0
If ACAD Is Nothing Then
Set ACAD = New AcadApplication
ACAD.Visible = True
End If
ACAD.ActiveDocument.Utility.Prompt "Bla Bla Bla...!"
Dim Coords(0 To 2) As Double
Dim Coords2(0 To 2) As Double
Dim Coords3(0 To 2) As Double '<----------- add this
Dim ObjEnt As AcadDimAligned
Dim n As Integer
Dim LastRowXY As Integer
Set ws = Worksheets("Coord_PENZ").Cells ' <------- warning: you must be sure to executethis routine while "Coord_PENZ" is the active worksheet
LastRowXY = ws(Rows.Count, 2).End(xlUp).Row
Dim DimAligned As Variant
For n = 2 To LastRowXY - 1
Const Angl = 0.2
Coords(0) = ws(n, 2)
Coords(1) = ws(n, 3)
Coords(2) = ws(n, 4)
Coords2(0) = ws(n + 1, 2)
Coords2(1) = ws(n + 1, 3)
Coords2(2) = ws(n + 1, 4)
Coords3(0) = (Coords2(0) + Coords(0)) / 2 '<----------- add this
Coords3(1) = (Coords2(1) + Coords(1)) / 2 '<----------- add this
Coords3(2) = (Coords2(2) + Coords(2)) / 2 '<----------- add this
'Set ObjEnt = ACAD.ActiveDocument.ModelSpace '<----------- NO
'.DimAligned Coords, Coords2, Angl '<----------- NO this
Set ObjEnt = ACAD.ActiveDocument.ModelSpace.AddDimAligned(Coords, Coords2, Coords3) '<----------- add this
ObjEnt.TextRotation = Angl '<-----' I guess the Angl variable was to rotate dimension text
ObjEnt.Update
Next n
End Sub
also note what I thought about the use of your "Angl" variable
bye