(defun C:create-vedomost-skv ( / BAZE_POINT BAZE_POINT-NAME BAZE_POINT-POINT DIST G-ANGLE H LIST-POINTS LIST-STR NAME-SKV NIL_POINT NIL_POINT-NAME NIL_POINT-POINT POINT-SKV PUTCH-TEXT-FILE-COORD S SS V-ANGLE)
  (load_global_variable)
  (setq ss (ssget '((0 . "AECC_COGO_POINT"))))
  (if ss
    (progn
      (setq list-points (convert_ss_to_list ss))
      (setq baze_point (car list-points))
      (setq baze_point-name (vlax-get-property  (vlax-ename->vla-object baze_point) "Description"))
      (setq baze_point-point (list (vlax-get-property  (vlax-ename->vla-object baze_point) "Easting")
				   (vlax-get-property  (vlax-ename->vla-object baze_point) "Northing")
				   (vlax-get-property  (vlax-ename->vla-object baze_point) "ELEVATION")))
      (setq list-points (cdr list-points))
      (setq nil_point (car list-points))
      (setq nil_point-name (vlax-get-property  (vlax-ename->vla-object nil_point) "Description"))
      (setq nil_point-point (list (vlax-get-property  (vlax-ename->vla-object nil_point) "Easting")
				  (vlax-get-property  (vlax-ename->vla-object nil_point) "Northing")
				  (vlax-get-property  (vlax-ename->vla-object nil_point) "ELEVATION")))
      (setq list-points (cdr list-points))
      (foreach x list-points
	(setq name-skv (vlax-get-property  (vlax-ename->vla-object x) "Description"))
	(setq point-skv (list (vlax-get-property  (vlax-ename->vla-object x) "Easting")
			      (vlax-get-property  (vlax-ename->vla-object x) "Northing")
			      (vlax-get-property  (vlax-ename->vla-object x) "ELEVATION")))
	(setq dist (distance point-skv baze_point-point))
	(setq S (distance (reverse(cdr(reverse point-skv))) (reverse(cdr(reverse baze_point-point)))))
	(setq h (- (nth 2 point-skv)(nth 2 baze_point-point)))
	(setq g-angle (calculation_angle_be_3points nil_point-point baze_point-point point-skv))
	(setq v-angle (abs(asin (/ (/ h S)(sqrt (+ 1.0 (expt (/ h S) 2.0)))))))
	(setq list-str(append list-str (list (strcat name-skv"\t"
						     baze_point-name"\t"
						     nil_point-name"\t"
						     (rtos dist 2 3)"\t"
						     (convert-rad-to-str-grad g-angle)"\t"
						     (if (minusp h) "-" "")(convert-rad-to-str-grad v-angle)"\t"
						     (rtos (nth 1 point-skv) 2 3)"\t"
						     (rtos (nth 0 point-skv) 2 3)"\t"
						     (rtos (nth 2 point-skv) 2 3)
						     ))))
	)
      (setq putch-text-file-coord (strcat
				    (getvar "DWGPREFIX")
				    (strcat baze_point-name "-" nil_point-name)
				    ;(substr (getvar "DWGNAME") 1 (-(strlen (getvar "DWGNAME"))4))
				    ".txt"
				    ))
      (file_write_list_to_file putch-text-file-coord list-str)
      )
    )
  (princ)
  )