AutoLISP Help

I want to write a simple AutoLISP routine that will list the slope between two entities be they points, nodes, polylines, 3dpolylines,
etc. I have the basic mathematics down, but I am having problems with the remainder. Currently the program loads, but gets stuck in initializing. I know I need to get the two points, but do not know how to do this. Here is the program, can anyone help me finish it?
(defun ges( pt1 pt2 / dZ d Slope) (setq     dZ (- (caddr pt2) (caddr pt1))     d (distance (list (car pt1) (cadr pt1) 0.0) (list (car pt2) (cadr pt2) 0.0))     Slope (* 100.0 (/ dZ d)) ) )
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Try this:
(defun c:ges( / dZ d Slope) (setq Pt1 (getpoint "\nFirst point: ")) (setq Pt2 (getpoint Pt1 "\nSecond point: ")) (setq dZ (- (caddr pt2) (caddr pt1)) d (distance (list (car pt1) (cadr pt1) 0.0) (list (car pt2) (cadr pt2) 0.0)) Slope (* 100.0 (/ dZ d)) ) (princ (strcat "Slope= " (rtos Slope 2 2) "%")) (princ) )
On Mar 20, 5:52 am, snipped-for-privacy@gmail.com wrote:

Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

Polytechforum.com is a website by engineers for engineers. It is not affiliated with any of manufacturers or vendors discussed here. All logos and trade names are the property of their respective owners.