These are the readouts in DXF (entget (car (entsel))) and VLA (vlax-dump-object (vlax-ename->vla-object (car (entsel))) T) of the same ArrayRect:
((-1 . <Entity name: 219e13b2f70>) (0 . "INSERT") (5 . "287") (102 . "{ACAD_REACTORS") (330 . <Entity name: 219e10c60c0>) (102 . "}") (330 . <Entity name: 219e13b39f0>) (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 . "0") (100 . "AcDbBlockReference") (2 . "*U3") (10 1638.0 1071.29 0.0) (41 . 1.0) (42 . 1.0) (43 . 1.0) (50 . 0.0) (70 . 0) (71 . 0) (44 . 0.0) (45 . 0.0) (210 0.0 0.0 1.0))
; Property values:
; Application (RO) = #<VLA-OBJECT IAcadApplication 00007ff6e5024110>
; Document (RO) = #<VLA-OBJECT IAcadDocument 000002198fadda28>
; EffectiveName (RO) = "*U3"
; EntityTransparency = "ByLayer"
; Handle (RO) = "287"
; HasAttributes (RO) = 0
; HasExtensionDictionary (RO) = 0
; Hyperlinks (RO) = #<VLA-OBJECT IAcadHyperlinks 000002198eda7c68>
; InsertionPoint = (1638.0 1071.29 0.0)
; InsUnits (RO) = "Unitless"
; InsUnitsFactor (RO) = 1.0
; IsDynamicBlock (RO) = 0
; Layer = "0"
; Linetype = "ByLayer"
; LinetypeScale = 1.0
; Lineweight = -1
; Material = "ByLayer"
; Name = "*U3"
; Normal = (0.0 0.0 1.0)
; ObjectID (RO) = 42
; ObjectName (RO) = "AcDbBlockReference"
; OwnerID (RO) = 43
; PlotStyleName = "ByLayer"
; Rotation = 0.0
; TrueColor = #<VLA-OBJECT IAcadAcCmColor 000002198eda7780>
; Visible = -1
; XEffectiveScaleFactor = 1.0
; XScaleFactor = 1.0
; YEffectiveScaleFactor = 1.0
; YScaleFactor = 1.0
; ZEffectiveScaleFactor = 1.0
; ZScaleFactor = 1.0
; Methods supported:
; ArrayPolar (3)
; ArrayRectangular (6)
; ConvertToAnonymousBlock ()
; ConvertToStaticBlock (1)
; Copy ()
; Delete ()
; Explode ()
; GetAttributes ()
; GetBoundingBox (2)
; GetConstantAttributes ()
; GetDynamicBlockProperties ()
; GetExtensionDictionary ()
; GetXData (3)
; Highlight (1)
; IntersectWith (2)
; Mirror (2)
; Mirror3D (3)
; Move (2)
; ResetBlock ()
; Rotate (2)
; Rotate3D (3)
; ScaleEntity (2)
; SetXData (2)
; TransformBy (1)
; Update ()
You have several clues to determine it is an array and not a regular block reference:
the name of the block is anonymous (starts with a * - *U3)
If you look up the name in the block definition table you will not find it, so you can test for that in your routine.
(tblobjname "layer" "*U3")