Could someone please take a look at this code exerpt and tell why I am
getting a Compile error: 'can't assign to array' with LoopStartPt
highlighted? Thanks.
'Globals for this module
Dim tubeSeed As AcadEntity
Dim LoopStartPt(0 To 1) As Double
Public Sub StPoint()
LoopStartPt = tStartPt(tubeSeed)
End Sub
Public Function tStartPt(tubeSeg As AcadEntity) As Double()
Dim Pt As Variant
Dim rtnPt(0 To 1) As Double
Dim Index As Integer
Select Case tubeSeg.ObjectName
Case Is = "AcDbPolyline"
Pt = tubeSeg.Coordinates
If IsArray(Pt) Then
rtnPt(0) = Pt(0)
rtnPt(1) = Pt(1)
End If
Case Is = "AcDbLine"
Pt = tubeSeg.StartPoint
rtnPt(0) = Pt(0)
rtnPt(1) = Pt(1)
Case Is = "AcDbArc"
Pt = acEntity.StartPoint
rtnPt(0) = Pt(0)
rtnPt(1) = Pt(1)
End Select
tStartPt = rtnPt
End Function


Reply With Quote