I am now trying the same result with the selection on the block, without working with the line.
The reference points are the top and bottom center.
Thank you very much for your help.
The problem is that your block doesn't contain any lines, just the 3D Solid.
However it is possible to obtain these points, but the routine will work specifically for this particular block, Example:
(defun C:test ( / blk blkobj explosion TheSolid Lst pts)
(and
(setq blk (car (entsel "\nSelect the block: ")))
(setq blkobj (vlax-ename->vla-object blk))
(setq explosion (vlax-invoke blkobj 'Explode))
(vl-some (function (lambda (o) (and (eq (vla-get-ObjectName o) "AcDb3dSolid") (setq TheSolid o)))) explosion)
(not (command "_.EXPLODE" (setq TheSolid (vlax-vla-object->ename TheSolid))))
(setq Lst (GetEnamesFrom TheSolid))
(setq pts
(mapcar
(function
(lambda (o / ll ur)
(vla-GetBoundingBox o 'll 'ur)
(apply 'mapcar (cons '(lambda (a b) (/ (+ a b) 2.)) (mapcar 'vlax-safearray->list (list ll ur))))
)
)
(mapcar 'vlax-ename->vla-object (vl-remove-if-not (function (lambda (x) (= "REGION" (cdr (assoc 0 (entget x)))))) Lst))
)
)
(mapcar 'entdel Lst)
); and
(and pts (= 2 (length pts)) (apply 'grdraw (append pts (list 1 7))))
)
(defun GetEnamesFrom ( e / next Lst )
(if (setq next (entnext e))
(while next
(setq Lst (cons next Lst))
(setq next (entnext next))
)
)
Lst
)
In other words the above checks for the first occurence of a 3D Solid object, after exploding the block, then it explodes that same solid and looks for REGION objects.
After exploding the solid, both region objects are occuring at the top and bottom of the block, and just extract their boundingbox centroids, that are the desired points.
And at the end just erase all the created entities after exploding that block.