Print Page | Close Window

How to get elevation between two contours

Printed From: CAD Forum
Category: EN
Forum Name: AutoCAD
Forum Description: Discussion about AutoCAD and AutoCAD LT, viewers, DWG and DWF formats, Design Review, AutoCAD 360, add-ons
URL: https://www.cadforum.cz/forum_en/forum_posts.asp?TID=9359
Printed Date: 16.May.2026 at 06:18


Topic: How to get elevation between two contours
Posted By: ABHAYPAGRUT
Subject: How to get elevation between two contours
Date Posted: 02.Jul.2013 at 05:58
I Want to take spot levels bwt two contours in autocad 2006


-------------
abhaypagrut



Replies:
Posted By: heinsite
Date Posted: 02.Jul.2013 at 06:50
This kind of question really makes me smile... and makes me happy I was learning how to do this sort of thing long before personal computers came along or anything even remotely called AutoCAD.

Here's how to think of contours:  they are points of equal elevation or the shoreline of water risen to that level.  And when you look at contours it's helpful to think of water in another way:  which way would it travel if it were a raindrop.

The answer in the second case is that a raindrop will always move the shortest distance or perpendicular to contour lines.  So the way to interpolate between contours is to draw a line between them that is mostly perpendicular to each.  Then you simply measure the length of that line and do the math to determine how to subdivide the distance.  If all you want to do is find an elevation half way between two contour lines you only need to look for a point halfway between them.

It's not rocket science.

Dave.


-------------
Dave Hein, P.E.
Hawaii District Engineer
Kona International Airport
AutoCAD Certified Professional
Autodesk Expert Elite


Posted By: ABHAYPAGRUT
Date Posted: 02.Jul.2013 at 08:09
Thanks , this is simple math i know, but i want result in autocad by single click between two polylines representing contours having elevations.

-------------
abhaypagrut


Posted By: heinsite
Date Posted: 02.Jul.2013 at 10:10
AutoCAD isn't built to do that sort of thing.  You might be able to write some kind of complex LISP routine to do it, but if you're going to work with contours, or more specifically digital terrain surfaces, you're going to need to use something like Civil 3D.

Dave.


-------------
Dave Hein, P.E.
Hawaii District Engineer
Kona International Airport
AutoCAD Certified Professional
Autodesk Expert Elite


Posted By: John Connor
Date Posted: 02.Jul.2013 at 12:19
Are you working in 2D or 3D?

Your profile says AutoCAD 2007 but your question references 2006.  Why?


-------------
"Humans have a strength that cannot be measured. This is John Connor. If you are reading this, you are the resistance."

<<AutoCAD 2015>>



Posted By: JSC
Date Posted: 02.Jul.2013 at 14:02
If your'e using Civil 3d (even the older version) and have (or can create) surfaces, the process is conceptually simple. But it can be cumbersome to carry out (as you should expect with just about any advanced Civil 3D function). Are you using Civil 3D?


Posted By: Kent Cooper
Date Posted: 02.Jul.2013 at 15:05
>>> ...i want result in autocad by single click between two polylines representing contours having elevations.
 
Try Midpoint-between-two-points [M2P] object snap if you have it, using Nearest object snap on each of the two contours to get the points to find the midpoint between.  If your version doesn't have M2P object snap [I don't remember when that was introduced], there are many routines out there built to do the equivalent -- this is the one I made years ago:
 
(defun m2 (/ pt1 pt2 osm) ; Midway between 2 points snap
  (setq
    pt1 (getpoint "\nFirst point: ")
    pt2 (getpoint pt1 "\nSecond point: ")
    osm (getvar 'osmode)
  ); end setq
  (setvar 'osmode 0)
  (command (mapcar '/ (mapcar '+ pt1 pt2) '(2 2 2)))
  (setvar 'osmode osm)
  (princ)
); end defun
 
Use it by typing (m2) [including the parentheses] or put that into a toolbar button or something.  You can apply Nearest or any other Osnap mode on the two contours when it's asking for points.  You can use it inside something like a Point or Insert command to place something at the midpoint between, including halfway between in the Z direction.


Posted By: Kent Cooper
Date Posted: 02.Jul.2013 at 15:13
Or now I'm wondering whether I misunderstood.  If you want to pick a single point, which won't necessarily be halfway between two contours in the XY direction, and you want the elevation at the same proportion of the distance in the Z direction as the point is between the two contours in the XY direction, that can certainly be done, but it's more complicated.  A routine would need to "reach out" somehow to find the adjacent contours, such as possibly with increasingly larger crossing windows until it finds two, and do some calculations based on the nearest points on them.  Does that sound like what you're after?


Posted By: ABHAYPAGRUT
Date Posted: 02.Jul.2013 at 18:33
working in 3 D
i am working in both the version of AUTOCAD at different places at home and at office. iam just Beginner to Autocad.


-------------
abhaypagrut


Posted By: ABHAYPAGRUT
Date Posted: 02.Jul.2013 at 18:37
thanks, You are using Code to explain my Query. Please Elaborate it.



-------------
abhaypagrut


Posted By: John Connor
Date Posted: 02.Jul.2013 at 20:00
M2P also known as MTP is a command modifier used during the execution of another command.  In this case the command modifier will find a point midway between two other points specified by the user.

Re: code.  Haven't you ever heard of lisp?  There are lisp routines that are built into AutoCAD and those that are created by CAD users.  One of the suggestions above hints that someone familiar with lisp might be able to write a custom code to help you find that elusive point between two contours but to do so you would have to provide more detail as to what you are looking for.  There probably won't be a one click solution as some input might be required from the user.


-------------
"Humans have a strength that cannot be measured. This is John Connor. If you are reading this, you are the resistance."

<<AutoCAD 2015>>



Posted By: heinsite
Date Posted: 03.Jul.2013 at 06:42
M2P came along as a command modifier with AutoCAD 2005.  Smile

Dave.


-------------
Dave Hein, P.E.
Hawaii District Engineer
Kona International Airport
AutoCAD Certified Professional
Autodesk Expert Elite


Posted By: jevnydaniel
Date Posted: 04.Jul.2013 at 09:23
Thanks for the Heinsite's comments,it is helpful.Smile

-------------
Rapid prototyping and Tooling with best price in China(www.jevny.com)



Print Page | Close Window