level finder!

level finder!

Anonymous
Not applicable
3,243 Views
10 Replies
Message 1 of 11

level finder!

Anonymous
Not applicable

Hello everyone!

I am super new in AutoCad and actually I am not a constructor;however, there is a project that I am working on it and I need to extract some info from a Cad file.

 

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.

 

Please check the attachment as an example and assume I have 2000 cubes with different size in different positions.

 

Thank you in advance!

 

have a nice weekend all!

/Sam

 

 

0 Likes
3,244 Views
10 Replies
Replies (10)
Message 2 of 11

Llam.Tech
Advocate
Advocate

type "ID" <<enter>>

ID: Identification

0 Likes
Message 3 of 11

Llam.Tech
Advocate
Advocate

Check some of my videos in youtube. Just go to Search and type LLAM TECH. There are some videos for beginners.

 

please subscribe and share.

Thank you very much.

http://youtu.be/eSys8gb2Ooo

 

0 Likes
Message 4 of 11

Anonymous
Not applicable
Hello
There are tones of materials in internet. I am looking specifically for the solution of what i posted. As i said i do not need to learn acad. It is not my field.

Anyhow thx
Best
Sam
0 Likes
Message 5 of 11

Llam.Tech
Advocate
Advocate

Check my first comment regarding "ID"..

0 Likes
Message 6 of 11

Kent1Cooper
Consultant
Consultant

@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
0 Likes
Message 7 of 11

Anonymous
Not applicable

Thanls I will try to see if it works in my case 

But thank you for the detail  description!

 

Best

Sam

0 Likes
Message 8 of 11

Anonymous
Not applicable
Hello Thanx for the guidelines.
It is interesting but still I need to click on each surface of the cube. Is there any possibilities to have a loop that it automatically counts all the objects with X,y,Z) coordinates?)
Thanks
0 Likes
Message 9 of 11

Kent1Cooper
Consultant
Consultant

@Anonymous wrote:
.... I need to click on each surface of the cube. Is there any possibilities to have a loop that it automatically counts all the objects with X,y,Z) coordinates?) ....

I don't quite understand.  You should get the base-plane elevation from selecting a cube [or anything else] anywhere, and only once.  So what is the "each surface" part about?

 

Yes, it can be made to work with multiple selection [see the second sentence in the last paragraph of Post 6].  But "all the objects with XYZ coordinates" would mean all objects in the drawing, since all drawn objects must necessarily have XYZ coordinates.  A simple count [reporting of a numerical quantity] would not need to have any relation to any object's level as the Subject line suggests there should be.

 

What kind of output are you looking for?  Report to the Command line?  Text in the drawing?  An external text or spreadsheet file?  Should there be an entry for every object, or some kind of collective information such as the word "count" implies to me?  If an entry for every object, what ingredients should the output for an object contain?  Only its base-plane elevation, as the Subject line implies?  The entity name and its base-plane elevation?  A set of XYZ coordinates, and if so, the coordinates of what location on the object?  Etc., etc., etc.

Kent Cooper, AIA
0 Likes
Message 10 of 11

john.vellek
Alumni
Alumni

Hi @Anonymous,

 

I am guessing that a data extraction would do this for you.  You can identify which items you want information and include the geometry with Z position. Then you can easily export the data to Excel and sort by the Z value.

 

Please select the Accept as Solution button if my post solves your issue or answers your question.


John Vellek


Join the Autodesk Customer Council - Interact with developers, provide feedback on current and future software releases, and beta test the latest software!

Autodesk Knowledge Network | Autodesk Account | Product Feedback
0 Likes
Message 11 of 11

john.vellek
Alumni
Alumni

Hi @Anonymous,

 

I am checking back to see if my post or others helped you with your problem.
Please add a post with how you decide to proceed and your results so other Community members may benefit.

Please select the Accept as Solution button if a post or posts fully solved your issue or answered your question.


John Vellek


Join the Autodesk Customer Council - Interact with developers, provide feedback on current and future software releases, and beta test the latest software!

Autodesk Knowledge Network | Autodesk Account | Product Feedback
0 Likes