(vl-load-com); if needed
(defun C:WHATEVER (/ minpt maxpt LL UR midpt)
(vla-getboundingbox
(vlax-ename->vla-object (car (entsel "\nSelect object: ")))
'minpt 'maxpt
); ...ename->obj...
(setq
LL (vlax-safearray->list minpt)
UR (vlax-safearray->list maxpt)
midpt (mapcar '/ (mapcar '+ LL UR) '(2 2 2))
); setq
(command
"_.layer" "_set" "YourOuterRectangleLayer" ""
"_.rectang" "_non" LL "_none" UR
"_.layer" "_set" "YourCrosshairsLayer" ""
"_.line" "_non" (list (car LL) (cadr midpt)) "_non" (list (car UR) (cadr midpt)) ""
"_.line" "_non" (list (car midpt) (cadr LL)) "_non" (list (car midpt) (cadr UR)) ""
"_.layer" "_set" "YourBlockLayer" ""
"_.insert" "YourBlockName" "_non" midpt "" "" ""
); command
); defun
Edit all the bold teal italic things appropriately.
It assumes:
1) the Layers and the Block definition exist in the drawing;
2) the Block is one with a wipeout to hide the crossing of the crosshairs behind it, so it can draw just the two Lines.
3) scale factors of 1 and rotation of 0 are appropriate for the Block Insertion.
But if those things can't be assumed, they can be accounted for with some additional code.
It takes selection of a single object, but can easily be adjusted to do the same around the collective extents of multiple objects [I have another routine with the code to do that].
It works [in minimal testing] whether or not the number in your image is an Attribute in the Block. If it is, the routine leaves you at the point of giving it a value for the Attribute, before the Block appears. If not, the placing of the number as Text can be added.
Kent Cooper, AIA