the idea was an specific mtext in col X, row Y and it doesn't matter ename or vla entity
yes, block table entity
I think I got it.
returns the vla mtext, if the cell is empty or there's a block returns nil.
(if cal () (arxload "geomcal")) ; for calculator
(DEFUN GetVlaMtext (Table row col / InsPt lst mtxt n npt PtoMtxt TableBlkDef vector xcol xrow zero)
(SETQ TableBlkDef
(VLA-ITEM
(vla-get-Blocks (vla-get-ActiveDocument (vlax-get-acad-object)))
(CDR (ASSOC 2 (ENTGET (VLAX-VLA-OBJECT->ENAME Table))))
)
)
(SETQ InsPt (VLAX-SAFEARRAY->LIST ; table's insertion point
(VLAX-VARIANT-VALUE
(VLA-GET-INSERTIONPOINT TABLE)
)
)
vector (VLAX-3D-POINT 1 1 1)
zero '(0.0 0.0 0.0)
n 0
)
(vlax-for x TableBlkDef
(IF (= "AcDbMText" (VLA-GET-OBJECTNAME x))
(SETQ lst (CONS x lst))
)
)
(WHILE
(AND
(SETQ mtxt (NTH n lst))
(SETQ PtoMtxt (VLAX-SAFEARRAY->LIST
(VLAX-VARIANT-VALUE
(VLA-GET-INSERTIONPOINT mtxt)
)
)
npt (CAL "INSPT+vec(zero,PtoMtxt)") ; i don't like coords functions
n (1+ n)
)
(VLA-HITTEST table (VLAX-3D-POINT npt) vector 'xrow 'xcol)
(NOT
(AND (= xrow row)
(= xcol col)
)
)
)
(SETQ mtxt nil)
)
mtxt
)