@Anonymous wrote:
....
Assume you have some cubes (3d). The lower plan of each cubes is located in some arbitrary height from z=0. If I have many cubes with different coordinates (x,y,z) how can I find the z coordinates of the buttom plan of each cubes in respect of an imaginary plan located at z=0.
....
The suggestion to use the ID command will work if you're looking from a point of view such as in your image, in which you will be able to pick on a bottom corner of such a cube, presumably using ENDpoint or INTersection Object Snap. ID will report to you the XYZ coordinates of the point you pick -- the elevation you want will be the last number [the Z coordinate]. But if you want to do this in plan view, you won't be able to tell whether what it reports is the bottom corner or the top corner of the vertical edge at which you pick.
This will tell you what you want to know, from any object [even things that are not 3D solid, and even non-model-type objects such as Text], and no matter what direction you're viewing from, with just the selection of the object:
(defun C:BLF (/ esel minpt maxpt); = Base Level Finder
(if (setq esel (entsel "\nObject to report level of base: "))
(progn ; then
(vla-getboundingbox (vlax-ename->vla-object (car esel)) 'minpt 'maxpt)
(prompt
(strcat
"\nBase of object is at Z = "
(rtos (caddr (vlax-safearray->list minpt)))
"."
); strcat
); prompt
); progn
(prompt "\nNo object selected.")
); if
(princ)
); defun
(vl-load-com)
(prompt "\nType BLF for the Base Level Finder.")
Copy [Ctrl-C] the code and paste it into a plain-text editor such as Notepad. Save that to a file with a filetype ending of .LSP [call it whatever you want -- I would use something obvious like BaseLevelFinder.lsp], in any location you will be able to find. In an AutoCAD drawing, type AP [command alias for the APPLOAD command], navigate to where you saved that file, select and Load it. Then type BLF and select an object.
It reports the base level elevation in whatever type of Units is currently set [decimal, fractional, architectural, etc.] in the Length category in the Units command dialog box, and to whatever precision is set there. But it could be made to report it in any type of Units and precision you prefer [for instance, to round to the nearest whole unit, or to the nearest micron, or the nearest foot even if your drawing is not in architectural units, etc.].
If that reports what you are looking for, there are things you could do to make it potentially more useful. For example, it could easily be enhanced to let you select as many objects as you want, and to put the base elevations of all of them into an external file such as you can open in Notepad or Excel, or put them into the drawing as Text or Mtext, or average them, or....
Kent Cooper, AIA