(defun C:draw_fasade ( / fx fy insert-point list-num-points new-point p1 p2 point point-on-line point-x point-y point-z pr-line)
  ;фасады
  (load_global_variable)
  (if C3D_active_document
    (progn
      (vla-StartUndoMark active_document)
      (princ "\nВыбор COGO точек.")
      (setq list-num-points (vlax-invoke C3D_active_document 'SelectPoints))
      (setq pr-line (car(entsel "\nВыбери проектную линию стены: ")))
      (setq insert-point(getpoint "\nУкажи точку вставки: "))
      (princ(setq p1 (cdr (assoc 10 (entget pr-line)))))
      (setq p2 (cdr (assoc 11 (entget pr-line))))
      (entmake (list '(0 . "LINE") '(6 . "Continuous") (cons 10 insert-point) (cons 11(mapcar '+ insert-point (list (distance p1 p2) 0 0)))))
      (foreach x list-num-points
	(setq C3D_point (vlax-invoke C3D_points 'find x))
	(setq point-x (vlax-get C3D_point 'easting))
	(setq point-y (vlax-get C3D_point 'northing))
	(princ "\n z=")
	(princ(setq point-z (vlax-get C3D_point 'elevation)))
	(terpri)
	(princ(setq fy (- point-z(nth 2 p1))))
	(setq point-on-line (vlax-curve-getClosestPointTo pr-line (list point-x point-y (nth 2 p1))T))
	(if (equal(angle p1 p2)(angle p1 point-on-line)1)
	  (setq fx (distance p1 point-on-line))
	  (setq fx (*(distance p1 point-on-line)-1))
	  )
	(setq fz (*(distance p2 (list point-x point-y (nth 2 p1)))
		   (cos (- pi (- (- (angle p2 p1)(angle p2 (list point-x point-y (nth 2 p1)))) (/ pi 2)))))
	      )
	(setq new-point (mapcar '+ insert-point (list fx fy fz)))
	(entmake (list '(0 . "POINT") '(6 . "Continuous") (cons 10 new-point)))
	)
      (vla-EndUndoMark active_document)
      )
    (alert "Выполнение комманды предполагает ее запуск в AutoCAD Civil 3D!\nТекущий AutoCAD им не является или представляет собой не поддерживаемую(временно?) версию." )
    )
  (princ)
  )