I think it's about how the Solid was made, as well as depending on certain other characteristics. If I make such a thing with the BOX command, length/width/height properties are all shown, but if I make it with EXTRUDE or PRESSPULL from a Polyline outline, they are not -- only Height. Maybe that's because a true Box necessarily has constant values for all three, but Solids made by other means can have variable dimensions in any direction. If I SLICE off part of my Box, even if I Slice it orthogonally so it's still a pure rectangular prism, it's no longer a "box," and no longer shows any of those.
Compare their "SolidType" VLA properties:
(vla-get-SolidType (vlax-ename->vla-object (car (entsel))))
and select one.
If they're orthogonally oriented, you can get those dimensions from the size of their bounding boxes:
(defun C:BB (/ minpt maxpt); Bounding Box of selected object
(vla-getboundingbox (vlax-ename->vla-object (car (entsel))) 'minpt 'maxpt)
(setq
box (list (vlax-safearray->list minpt) (vlax-safearray->list maxpt))
delta (mapcar '- (cadr box) (car box))
); setq
(prompt
(strcat
"\nBounding Box [in 'box' variable]: " (vl-princ-to-string box) ";"
"\nExtents: X direction " (rtos (car delta))
"; Y direction " (rtos (cadr delta))
"; Z direction " (rtos (caddr delta)) "."
); strcat
); prompt
(princ)
)
That leaves the 'delta' variable listing the XYZ of the extents, so you can extract the values as needed.
Kent Cooper, AIA