Subbup, here's the parallel lines routine that I use (sorry about the broken links to the lisp's)
;;; Parallel.lsp *
;;; Check for parallel lines. If lines are not parallel, *
;;; then report information about intersection point. *
;;; 2000, Stig Madsen
;;; Rev. June 2004
(defun validate (ent enttypes / entl)
(and ent
(cond ((member (cdr (assoc 0 (setq entl (entget (car ent))))) enttypes)
(cond ((= (type (car (last ent))) 'ENAME) (princ " *subentity*"))))
((princ "\nWrong entity type"))
)
)
entl
)
(defun averageDist (plst pt)
(/ (apply '+ (mapcar (function (lambda (p) (distance p pt))) plst))
(length plst)
)
)
(defun C:PAR (/ ent1 ent2 p1 p2 p3 p4 ang dist pt ptd ptf)
(setvar "ERRNO" 0)
(while (and
(not (setq ent1 (validate (nentsel "\nSelect first line: ") '("LINE"))))
(/= (getvar "ERRNO") 52))
)
(while (and ent1
(not (setq ent2 (validate (nentsel "\nSelect second line: ") '("LINE"))))
(/= (getvar "ERRNO") 52))
)
(cond (ent2
(mapcar (function (lambda (p dxf e)(set p (cdr (assoc dxf e)))))
'(p1 p2 p3 p4) '(10 11 10 11) (list ent1 ent1 ent2 ent2))
(setq ang (- (angle p1 p2) (angle p3 p4))
ptf (inters p1 p2 p3 p4)
ptd (inters p1 p2 p3 p4 nil))
(and (zerop (getvar "WORLDUCS"))
(mapcar (function (lambda (p) (and (eval p)
(set p (trans (eval p) 0 1)))))
'(p1 p2 p3 p4 ptf ptd))
)
(cond (ptf
(mapcar 'princ
(list "\nObjects intersect physically: "
(car ptf) "," (cadr ptf) "," (caddr ptf)
(if (zerop (getvar "WORLDUCS"))
" (UCS)" " (WCS)")
"\nAngle between objects: " (angtos ang)))
)
(ptd
(setq dist (averageDist (list p1 p2 p3 p4) ptd))
(mapcar 'princ
(list "\nObjects intersect at distant point: "
(car ptd) "," (cadr ptd) "," (caddr ptd)
(if (zerop (getvar "WORLDUCS")) " (UCS)" " (WCS)")
"\nApprox. " dist " units away from objects."
"\nAngle between objects: " (angtos ang))
)
)
(t (princ "\nObjects are parallel"))
)
)
)
(princ)
)