<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: LISP in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp/m-p/9771703#M70089</link>
    <description>&lt;P&gt;العفو من الملف الاصلي كان ناقص قوس بالاخير&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;اشتغل عندي بس ملفات الي عندي SEWER&amp;nbsp;&lt;/P&gt;&lt;P&gt;لازم جرب&amp;nbsp; ملف الخاص به&amp;nbsp; WATER&lt;/P&gt;&lt;P&gt;اذا ما اشتغل معك&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="lisp"&gt;;;;;=============error================
(defun myerr2 (msg2)
  (defun *error* (s)
    (if	old_error2
      (setq *error* old_error2)
    )
    (princ)
  )
  (if msg2
    (princ msg2)
  )
  (exit)
)
;;;;;;;=========support path=============
;;;(setq ac_exe (findfile "acad.exe"))
;;;(setq ac_path (substr ac_exe 1 (- (strlen ac_exe) 8)))
;;;(setq supp_path (strcat ac_path "support\\"))
;;;;=============setup================
;;;(defun c:wasetup ()
;;;  (setq fstpf2 (findfile "wtrstp.txt"))
;;;  (if (= fstpf2 nil)
;;;    (progn
;;;      (setq hsc	"1000"
;;;	    vsc	"100"
;;;	    sst	"0.00"
;;;	    dtm	"0"
;;;      )
;;;    )
;;;    (progn
;;;      (setq ostpr2 (open fstpf2 "r"))
;;;      (setq hsc (read-line ostpr2))
;;;      (setq vsc (read-line ostpr2))
;;;      (setq sst (read-line ostpr2))
;;;      (setq dtm (read-line ostpr2))
;;;      (close ostpr2)
;;;    )
;;;  )
;;;;;;;==========load setup dialog==================
;;;  (setq wtr_dcl (load_dialog "water_prof.dcl"))
;;;  (if (/= wtr_dcl -1)
;;;    (new_dialog "wtr_prf" wtr_dcl)
;;;    (progn
;;;      (alert "\nDialog File &amp;lt; water_prof.dcl &amp;gt; not found.")
;;;      (myerr2 "Function Terminated.")
;;;    )
;;;  )
;;;  (set_tile "hsc" hsc)
;;;  (set_tile "vsc" vsc)
;;;  (set_tile "sst" sst)
;;;  (set_tile "dtm" dtm)
;;;  (action_tile "hsc" "(setq hsc1 $value)")
;;;  (action_tile "vsc" "(setq vsc1 $value)")
;;;  (action_tile "sst" "(setq sst1 $value)")
;;;  (action_tile "dtm" "(setq dtm1 $value)")
;;;  (setq hsc1 (get_tile "hsc"))
;;;  (setq vsc1 (get_tile "vsc"))
;;;  (setq sst1 (get_tile "sst"))
;;;  (setq dtm1 (get_tile "dtm"))
;;;  (start_dialog)
;;;  (setq ostpw2 (open (strcat supp_path "wtrstp.txt") "w"))
;;;  (write-line hsc1 ostpw2)
;;;  (write-line vsc1 ostpw2)
;;;  (write-line sst1 ostpw2)
;;;  (write-line dtm1 ostpw2)
;;;  (close ostpw2)
;;;)
;;;;swsetup

;;;start::
(defun c:water (/ filename filereader filereader2 filereader3 filereader4 filereader5 filereader6
		     datum startstation xscale yscale fitname
		     oneline nextline exit_loop_flage last_station
		     station groundlevel incrdes invertlevel pipefitting pipedia pipetype
		     station_n groundlevel_n incrdes_n invertlevel_n pipefitting_n pipedia_n pipetype_n
		     )

  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  
  (setq fstpf2 (findfile "wtrstp.txt"))
  (if (= fstpf2 nil)
    (progn
      (setq hsc	"1000"
	    vsc	"100"
	    sst	"0.00"
	    dtm	"0"
      )
    )
    (progn
      (setq ostpr2 (open fstpf2 "r"))
      (setq hsc (read-line ostpr2))
      (setq vsc (read-line ostpr2))
      (setq sst (read-line ostpr2))
      (setq dtm (read-line ostpr2))
      (close ostpr2)
    )
  )
;;;;==========load setup dialog==================
  (setq wtr_dcl (load_dialog "water_prof.dcl"))
  (if (/= wtr_dcl -1)
    (new_dialog "wtr_prf" wtr_dcl)
    (progn
      (alert "\nDialog File &amp;lt; water_prof.dcl &amp;gt; not found.")
      (myerr2 "Function Terminated.")
    )
  )
  (set_tile "hsc" hsc)
  (set_tile "vsc" vsc)
  (set_tile "sst" sst)
  (set_tile "dtm" dtm)
  (action_tile "hsc" "(setq hsc1 $value)")
  (action_tile "vsc" "(setq vsc1 $value)")
  (action_tile "sst" "(setq sst1 $value)")
  (action_tile "dtm" "(setq dtm1 $value)")
  (setq hsc1 (get_tile "hsc"))
  (setq vsc1 (get_tile "vsc"))
  (setq sst1 (get_tile "sst"))
  (setq dtm1 (get_tile "dtm"))
  (start_dialog)
;;;  (setq ostpw2 (open (strcat supp_path "wtrstp.txt") "w"))
;;;  (write-line hsc1 ostpw2)
;;;  (write-line vsc1 ostpw2)
;;;  (write-line sst1 ostpw2)
;;;  (write-line dtm1 ostpw2)
;;;  (close ostpw2)

  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  (setvar "cmdecho" 0)
;;;  (setq stpchk2 (findfile "wtrstp.txt"))
  (if hsc1
    
    (progn
;;;      (setq opchkf2 (open stpchk2 "r"))
  	(setq xscale (atof hsc1))
  	(setq yscale (atof vsc1))
  	(setq startstation (atof sst1))
  	(setq datum (atof dtm1))
;;;      (close opchkf2)

  
 ; (setq station_n nil)
  ;(setq groundlevel_n nil)
  ;(setq last_station nil)
  ;(setq groundlevel nil)
  ;(setq station nil)
  ;(setq nextline "")
  ;(setq oneline "")
  ;(setq invertlevel nil)
  ;(setq invertlevel_n nil)
  
  ; Get user input.
  ; Set the X Scale and the Y Scale.
  (setq filename (getfiled "Select data file"
                (strcat (getvar "dwgprefix")
;;;                (substr (getvar "DWGNAME") 1 (- (strlen (getvar "dwgname")) 1))
			)
                "prn"     ;file type
                4))
       
  ;(setq xscale (getreal "\nEnter Xscale: "))
  ;(setq yscale (getreal "\nEnter Yscale: "))
  ;(setq datum (getreal "\nEnter Datum: "))
  ;(setq startstation (getreal "\nEnter Start Station: "))
  ;(setq filename (getstring "\nEnter Data File name: "))
  (setq filereader (open filename "r"))
  ; Insert the legend from the file in the support files.
  (command "insert" "LEGEND_WATER_PROF" (list 0.0 0.0) "1" "1" "0")
  ; Write near legend the Datum and the X Scale and the Y Scale.
  (command "layer" "new" "vline" "color" "8" "vline" "")
  (command "layer" "new" "texts" "color" "white" "texts" "")
  (command "layer" "new" "upper_line" "color" "blue" "upper_line" "")
  (command "layer" "new" "lower_line" "color" "magenta" "lower_line" "")
  
  (command "layer" "set" "texts" "")
  (command "text" "s" "ST1" "j" "br" '(0 0.1) "0.3" "0" (strcat (rtos datum 2 2) " m"))
  (command "text" "s" "ST1" "j" "bl" '(-3.9 2.15) "0.3" "0" (rtos xscale 2 0))
  (command "text" "s" "ST1" "j" "bl" '(-6.3 5.1) "0.3" "0" (rtos yscale 2 0))

  ; Create layer to hold all the red lines.
  (command "layer" "new" "red_lines" "color" "red" "red_lines" "")
  (command "layer" "set" "red_lines" "")
    )
  )
  ; Create the Stations line. Working on the red lines.
  ; -------------------------------------------
  ; First loop starting from the Start Station.
  ; -------------------------------------------
  (while (/= (setq oneline (read-line filereader)) nil)
    (progn
      (setq station (atof (substr oneline 1 8)))
      (setq groundlevel (atof (substr oneline 9 8)))
      (if (= station startstation)
	(progn
	  (setq pipedia (atof (substr oneline 38 5)))
          (setq pipetype (substr oneline 43 5))
	)
      )
      (setq last_station station)

      ; Read next line.
      (if (/= (setq nextline (read-line filereader)) nil)
         (progn
           (setq station_n (atof (substr nextline 1 8)))
           (setq groundlevel_n (atof (substr nextline 9 8)))
	   (setq last_station station_n)
	 )
      );end if

      ; Write the stations and thier lines.
      (if (= startstation station)
	(progn
	  ; Drawing the Stations.
	  (command "layer" "set" "texts" "")
	  (command "text" "mc" (list (+ (/ station (/ xscale 100)) 0.2) -6.5) "0.15" "90" (rtos station 2 2))
	  (command "text" "mc" (list (+ (/ station_n (/ xscale 100)) 0.2) -6.5) "0.15" "90" (rtos station_n 2 2))
	  ; Drawing red lines.
	  (command "layer" "set" "red_lines" "")
	  (command "line" (list (/ station (/ xscale 100)) 0) (list (/ station_n (/ xscale 100)) 0) "")
	  (command "line" (list (/ station (/ xscale 100)) -1) (list (/ station_n (/ xscale 100)) -1) "")
	  (command "line" (list (/ station (/ xscale 100)) -2) (list (/ station_n (/ xscale 100)) -2) "")
	  (command "line" (list (/ station (/ xscale 100)) -3) (list (/ station_n (/ xscale 100)) -3) "")
	  (command "line" (list (/ station (/ xscale 100)) -4) (list (/ station_n (/ xscale 100)) -4) "")
	  (command "line" (list (/ station (/ xscale 100)) -5) (list (/ station_n (/ xscale 100)) -5) "")
	  (command "line" (list (/ station (/ xscale 100)) -6) (list (/ station_n (/ xscale 100)) -6) "")
	  (command "line" (list (/ station (/ xscale 100)) -7) (list (/ station_n (/ xscale 100)) -7) "")
	  (command "line" (list (/ station (/ xscale 100)) -8) (list (/ station_n (/ xscale 100)) -8) "")
	  (command "line" (list (/ station (/ xscale 100)) -9) (list (/ station_n (/ xscale 100)) -9) "")
	  ; Drawing upper line.
	  (command "layer" "set" "upper_line" "")
	  (command "line" (list (/ station (/ xscale 100)) (/ (- groundlevel datum) (/ yscale 100))) (list (/ station_n (/ xscale 100)) (/ (- groundlevel_n datum) (/ yscale 100))) "")
	  ; Drawing vertical lines.
	  (command "layer" "set" "vline" "")
	  (command "line" (list (/ station (/ xscale 100)) (/ (- groundlevel datum) (/ yscale 100))) (list (/ station (/ xscale 100)) 0) "")
	  (command "line" (list (/ station_n (/ xscale 100)) (/ (- groundlevel_n datum) (/ yscale 100))) (list (/ station_n (/ xscale 100)) 0) "")
	  ; Drawing the Ground Level.
	  (command "layer" "set" "texts" "")
	  (command "text" "mc" (list (+ (/ station (/ xscale 100)) 0.2) -2.5) "0.15" "90" (rtos groundlevel 2 2))
	  (command "text" "mc" (list (+ (/ station_n (/ xscale 100)) 0.2) -2.5) "0.15" "90" (rtos groundlevel_n 2 2))
	)
	(progn
	  ; Drawing the Stations.
	  (command "layer" "set" "texts" "")
	  (command "text" "mc" (list (/ station (/ xscale 100)) -6.5) "0.15" "90" (rtos station 2 2))
	  (command "text" "mc" (list (/ station_n (/ xscale 100)) -6.5) "0.15" "90" (rtos station_n 2 2))
	  ; Drawing red lines.
	  (command "layer" "set" "red_lines" "")
	  (command "line" (list (/ station (/ xscale 100)) 0) (list (/ station_n (/ xscale 100)) 0) "")
	  (command "line" (list (/ station (/ xscale 100)) -1) (list (/ station_n (/ xscale 100)) -1) "")
	  (command "line" (list (/ station (/ xscale 100)) -2) (list (/ station_n (/ xscale 100)) -2) "")
	  (command "line" (list (/ station (/ xscale 100)) -3) (list (/ station_n (/ xscale 100)) -3) "")
	  (command "line" (list (/ station (/ xscale 100)) -4) (list (/ station_n (/ xscale 100)) -4) "")
	  (command "line" (list (/ station (/ xscale 100)) -5) (list (/ station_n (/ xscale 100)) -5) "")
	  (command "line" (list (/ station (/ xscale 100)) -6) (list (/ station_n (/ xscale 100)) -6) "")
	  (command "line" (list (/ station (/ xscale 100)) -7) (list (/ station_n (/ xscale 100)) -7) "")
	  (command "line" (list (/ station (/ xscale 100)) -8) (list (/ station_n (/ xscale 100)) -8) "")
	  (command "line" (list (/ station (/ xscale 100)) -9) (list (/ station_n (/ xscale 100)) -9) "")
	  ; Drawing upper line.
	  (command "layer" "set" "upper_line" "")
	  (command "line" (list (/ station (/ xscale 100)) (/ (- groundlevel datum) (/ yscale 100))) (list (/ station_n (/ xscale 100)) (/ (- groundlevel_n datum) (/ yscale 100))) "")
	  ; Drawing vertical lines.
	  (command "layer" "set" "vline" "")
	  (command "line" (list (/ station (/ xscale 100)) (/ (- groundlevel datum) (/ yscale 100))) (list (/ station (/ xscale 100)) 0) "")
	  (command "line" (list (/ station_n (/ xscale 100)) (/ (- groundlevel_n datum) (/ yscale 100))) (list (/ station_n (/ xscale 100)) 0) "")
	  ; Drawing the Ground Level.
	  (command "layer" "set" "texts" "")
	  (command "text" "mc" (list (/ station (/ xscale 100)) -2.5) "0.15" "90" (rtos groundlevel 2 2))
	  (command "text" "mc" (list (/ station_n (/ xscale 100)) -2.5) "0.15" "90" (rtos groundlevel_n 2 2))
	)
      );end if
    );end progn of while
  );end while
  ; Draw the Pipe Diameter and the Pipe Type.
  (command "layer" "set" "texts" "")
  (command "text" "mc" (list (/ (/ last_station (/ xscale 100)) 2) -0.5) "0.35" "0" (strcat (rtos pipedia 2 0) " mm " pipetype))
  ; Draw the last top last line.
  (command "layer" "set" "red_lines" "")
  (command "line" (list (/ last_station (/ xscale 100)) -11) (list (/ last_station (/ xscale 100)) -10) "")
  (command "line" (list 0 -11) (list (/ last_station (/ xscale 100)) -11) "")
  (command "line" (list 0 -10) (list (/ last_station (/ xscale 100)) -10) "")
  ; Draw the last line.
  (command "layer" "set" "red_lines" "")
  (command "line" (list (/ last_station (/ xscale 100)) 0) (list (/ last_station (/ xscale 100)) -9) "")
  (close filereader)
  ; ------------------------------------------------------
  ; Second loop, starting from the Start Station plus one.
  ; ------------------------------------------------------
  (setq filereader2 (open filename "r"))
  (while (/= (setq oneline (read-line filereader2)) nil)
    (progn
      (setq station (atof (substr oneline 1 8)))
      (if (/= startstation station)
	(progn
          (setq groundlevel (atof (substr oneline 9 8)))

          ; Read next line.
          (if (/= (setq nextline (read-line filereader2)) nil)
            (progn
              (setq station_n (atof (substr nextline 1 8)))
              (setq groundlevel_n (atof (substr nextline 9 8)))
	    )
          );end if
          ; Drawing the rest of the Stations lines.
	  ; Drawing red lines.
	  (command "layer" "set" "red_lines" "")
          (command "line" (list (/ station (/ xscale 100)) 0) (list (/ station_n (/ xscale 100)) 0) "")
	  (command "line" (list (/ station (/ xscale 100)) -1) (list (/ station_n (/ xscale 100)) -1) "")
	  (command "line" (list (/ station (/ xscale 100)) -2) (list (/ station_n (/ xscale 100)) -2) "")
	  (command "line" (list (/ station (/ xscale 100)) -3) (list (/ station_n (/ xscale 100)) -3) "")
	  (command "line" (list (/ station (/ xscale 100)) -4) (list (/ station_n (/ xscale 100)) -4) "")
	  (command "line" (list (/ station (/ xscale 100)) -5) (list (/ station_n (/ xscale 100)) -5) "")
	  (command "line" (list (/ station (/ xscale 100)) -6) (list (/ station_n (/ xscale 100)) -6) "")
	  (command "line" (list (/ station (/ xscale 100)) -7) (list (/ station_n (/ xscale 100)) -7) "")
	  (command "line" (list (/ station (/ xscale 100)) -8) (list (/ station_n (/ xscale 100)) -8) "")
	  (command "line" (list (/ station (/ xscale 100)) -9) (list (/ station_n (/ xscale 100)) -9) "")
	  ; Drawing upper line.
	  (command "layer" "set" "upper_line" "")
	  (command "line" (list (/ station (/ xscale 100)) (/ (- groundlevel datum) (/ yscale 100))) (list (/ station_n (/ xscale 100)) (/ (- groundlevel_n datum) (/ yscale 100))) "")
        );end progn of inner if
      );end inner if
    );end progn of while
  );end while
  (close filereader2)
  ; ---------------------------------------------------------------
  ; Third loop, for the Invert Level and the Depth to Invert Level.
  ; ---------------------------------------------------------------
  (setq filereader3 (open filename "r"))
  (while (/= (setq oneline (read-line filereader3)) nil)
    (progn
      (setq exit_loop_flage "N")
      (setq station (atof (substr oneline 1 8)))
      (setq groundlevel (atof (substr oneline 9 8)))
      (setq invertlevel (atof (substr oneline 25 8)))
      (if (/= invertlevel 0.00)
        (progn
	  (while (and (= exit_loop_flage "N") (/= (setq nextline (read-line filereader3)) nil))
	    (progn
	      (setq station_n (atof (substr nextline 1 8)))
	      (setq groundlevel_n (atof (substr nextline 9 8)))
	      (setq invertlevel_n (atof (substr nextline 25 8)))
              (if (/= invertlevel_n 0.00)
		(progn
		  (setq exit_loop_flage "Y")
;;;		  (princ (rtos station 2 2))
;;;	          (princ "\n")
;;;	          (princ (rtos groundlevel 2 2))
;;;	          (princ "\n")
;;;	          (princ (rtos station_n 2 2))
;;;	          (princ "\n")
;;;	          (princ (rtos groundlevel_n 2 2))
;;;	          (princ "\n")
		  ; Drawing lower line.
		  (command "layer" "set" "lower_line" "")
                  (command "line" (list (/ station (/ xscale 100)) (/ (- invertlevel datum) (/ yscale 100))) (list (/ station_n (/ xscale 100)) (/ (- invertlevel_n datum) (/ yscale 100))) "")
;                  (command "line" (list (/ station (/ xscale 100)) (/ (- (+ invertlevel (/ pipedia 1000)) datum) (/ yscale 100))) (list (/ station_n (/ xscale 100)) (/ (- (+ invertlevel_n (/ pipedia 1000)) datum) (/ yscale 100))) "")
		  ; Drawing the Partial Distance line and text.
	          (command "layer" "set" "red_lines" "")
	          (command "line" (list (/ station_n (/ xscale 100)) -1) (list (/ station_n (/ xscale 100)) -2) "")
		  (command "layer" "set" "texts" "")
		  (command "text" "mc" (list (/ (+ (/ (- station_n station) 2) (- station startstation)) (/ xscale 100)) -1.5) "0.3" "0" (rtos (- station_n station) 2 2))
		  ; Drawing the Gradient line and text.
	          (command "layer" "set" "red_lines" "")
	          (command "line" (list (/ station_n (/ xscale 100)) -7) (list (/ station_n (/ xscale 100)) -8) "")
		  (command "layer" "set" "texts" "")
		  (if (/= station station_n)
		    (progn
		      (command "text" "mc" (list (/ (+ (/ (- station_n station) 2) (- station startstation)) (/ xscale 100)) -7.5) "0.3" "0" (rtos (/ (- invertlevel_n invertlevel) (- station_n station)) 1 2))
		    )
		  )
		  (if (= startstation station)
	            (progn
;;;	              (princ (rtos invertlevel 2 2))
;;;	              (princ "\n")
;;;	              (princ (rtos groundlevel 2 2))
;;;	              (princ "\n")
;;;	              (princ (rtos invertlevel_n 2 2))
;;;	              (princ "\n")
;;;	              (princ (rtos groundlevel_n 2 2))
;;;	              (princ "\n")
	              ; Writing the Invert Level texts.
	              (command "layer" "set" "texts" "")
	              (command "text" "mc" (list (+ (/ station (/ xscale 100)) 0.2) -3.5) "0.15" "90" (rtos invertlevel 2 2))
                      (command "text" "mc" (list (/ station_n (/ xscale 100)) -3.5) "0.15" "90" (rtos invertlevel_n 2 2))
	              ; Drawing Depth to Invert Level.
                      (command "layer" "set" "texts" "")
                      (command "text" "mc" (list (+ (/ station (/ xscale 100)) 0.2) -4.5) "0.15" "90" (rtos (- groundlevel invertlevel) 2 2))
	              (command "text" "mc" (list (/ station_n (/ xscale 100)) -4.5) "0.15" "90" (rtos (- groundlevel_n invertlevel_n) 2 2))
	              ; Drawing Depth to Bottom of Excavation.
	              (command "layer" "set" "texts" "")
                      (command "text" "mc" (list (+ (/ station (/ xscale 100)) 0.2) -5.5) "0.15" "90" (rtos (+ (- groundlevel invertlevel) 0.15) 2 2))
	              (command "text" "mc" (list (/ station_n (/ xscale 100)) -5.5) "0.15" "90" (rtos (+ (- groundlevel_n invertlevel_n) 0.15) 2 2))
	            );end progn
	            (progn
;;;	              (princ (rtos station 2 2))
;;;	              (princ "\n")
;;;	              (princ (rtos invertlevel 2 2))
;;;		      (princ "\n")
;;;		      (princ (rtos groundlevel 2 2))
;;;	              (princ "\n")
;;;	              (princ (rtos station_n 2 2))
;;;	              (princ "\n")
;;;	              (princ (rtos invertlevel_n 2 2))
;;;	              (princ "\n")
;;;		      (princ (rtos groundlevel_n 2 2))
;;;	              (princ "\n")
	              ; Writing the Invert Level texts.
	              (command "layer" "set" "texts" "")
	              (command "text" "mc" (list (/ station (/ xscale 100)) -3.5) "0.15" "90" (rtos invertlevel 2 2))
                      (command "text" "mc" (list (/ station_n (/ xscale 100)) -3.5) "0.15" "90" (rtos invertlevel_n 2 2))
	              ; Drawing Depth to Invert Level.
                      (command "layer" "set" "texts" "")
                      (command "text" "mc" (list (/ station (/ xscale 100)) -4.5) "0.15" "90" (rtos (- groundlevel invertlevel) 2 2))
	              (command "text" "mc" (list (/ station_n (/ xscale 100)) -4.5) "0.15" "90" (rtos (- groundlevel_n invertlevel_n) 2 2))
	              ; Drawing Depth to Bottom of Excavation.
	              (command "layer" "set" "texts" "")
                      (command "text" "mc" (list (/ station (/ xscale 100)) -5.5) "0.15" "90" (rtos (+ (- groundlevel invertlevel) 0.15) 2 2))
	              (command "text" "mc" (list (/ station_n (/ xscale 100)) -5.5) "0.15" "90" (rtos (+ (- groundlevel_n invertlevel_n) 0.15) 2 2))
	            );end progn
	          );end if
		);end progn
	      );end if
	    );end progn
	  );end while
	);end progn
      );end if
    );end progn
  );end while
  (close filereader3)
  ; -----------------------------------------------------------------------------------------
  ; Fourth loop, the rest of the Invert Level and the Depth to Invert Level (Just the lines).
  ; -----------------------------------------------------------------------------------------
  (setq filereader4 (open filename "r"))
  (while (/= (setq oneline (read-line filereader4)) nil)
    (progn
      (setq exit_loop_flage "N")
      (setq station (atof (substr oneline 1 8)))
      (setq groundlevel (atof (substr oneline 9 8)))
      (setq invertlevel (atof (substr oneline 25 8)))
      (if (/= station startstation)
        (progn
          (if (/= invertlevel 0.00)
            (progn
	      (while (and (= exit_loop_flage "N") (/= (setq nextline (read-line filereader4)) nil))
	        (progn
	          (setq station_n (atof (substr nextline 1 8)))
		  (setq groundlevel_n (atof (substr oneline 9 8)))
	          (setq invertlevel_n (atof (substr nextline 25 8)))
                  (if (/= invertlevel_n 0.00)
		    (progn
		      (setq exit_loop_flage "Y")
		      ; Drawing lower line.
		      (command "layer" "set" "lower_line" "")
                      (command "line" (list (/ station (/ xscale 100)) (/ (- invertlevel datum) (/ yscale 100))) (list (/ station_n (/ xscale 100)) (/ (- invertlevel_n datum) (/ yscale 100))) "")
		      ; Drawing the Partial Distance line and text.
		      (command "layer" "set" "red_lines" "")
	              (command "line" (list (/ station_n (/ xscale 100)) -1) (list (/ station_n (/ xscale 100)) -2) "")
		      (command "layer" "set" "texts" "")
		      (command "text" "mc" (list (/ (+ (/ (- station_n station) 2) (- station startstation)) (/ xscale 100)) -1.5) "0.3" "0" (rtos (- station_n station) 2 2))
		      ; Drawing the Gradient line and text.
	              (command "layer" "set" "red_lines" "")
	              (command "line" (list (/ station_n (/ xscale 100)) -7) (list (/ station_n (/ xscale 100)) -8) "")
		      (command "layer" "set" "texts" "")
		      (if (/= station station_n)
		        (progn
		          (command "text" "mc" (list (/ (+ (/ (- station_n station) 2) (- station startstation)) (/ xscale 100)) -7.5) "0.3" "0" (rtos (/ (- invertlevel_n invertlevel) (- station_n station)) 1 2))
		        )
		      )
		    );end progn
	          );end if
	        );end progn
	      );end while
	    );end progn
          );end if
	);end progn
      );end if
    );end progn of while
  );end while
  (close filereader4)
  ; ------------------------------
  ; Fifth loop, for Pipe Fittings.
  ; ------------------------------
  (setq filereader5 (open filename "r"))
  (while (/= (setq oneline (read-line filereader5)) nil)
    (progn
      (setq station (atof (substr oneline 1 8)))
      (setq pipefitting (atof (substr oneline 33 5)))
      (if (/= pipefitting 0.00)
        (progn
          (cond ((eq pipefitting  1) (setq fitname "s-arv"))
            ((eq pipefitting  2) (setq fitname "d-arv"))
            ((eq pipefitting  3) (setq fitname "flow_mtr"))
            ((eq pipefitting  4) (setq fitname "futr_con"))
            ((eq pipefitting  5) (setq fitname "line_vlv"))
            ((eq pipefitting  6) (setq fitname "wash_out"))
            ((eq pipefitting  7) (setq fitname "adapter"))
            ((eq pipefitting   (setq fitname "elb45"))
            ((eq pipefitting  9) (setq fitname "end"))
            ((eq pipefitting 10) (setq fitname "fta-s"))
            ((eq pipefitting 11) (setq fitname "fta-d"))
            ((eq pipefitting 12) (setq fitname "reducer"))
            ((eq pipefitting 13) (setq fitname "tee-ask"))
            ((eq pipefitting 14) (setq fitname "elb22"))
            ((eq pipefitting 15) (setq fitname "elb11"))
            ((eq pipefitting 16) (setq fitname "t-ask45"))
            ((eq pipefitting 17) (setq fitname "crossing"))
            ((eq pipefitting 18) (setq fitname "end-flsh"))
            ((eq pipefitting 19) (setq fitname "vlv-fm"))
            ((eq pipefitting 20) (setq fitname "r-cross"))
            ((eq pipefitting 21) (setq fitname "w-cross"))
            ((eq pipefitting 22) (setq fitname "meter"))
            ((eq pipefitting 23) (setq fitname "flax-fr"))
            ((eq pipefitting 24) (setq fitname "sudle"))
            ((eq pipefitting 25) (setq fitname "box-culv"))
            ((eq pipefitting 26) (setq fitname "elb90"))
            ((eq pipefitting 27) (setq fitname "prv"))
            ((eq pipefitting 28) (setq fitname "tec"))
            ((eq pipefitting 29) (setq fitname "u-cross"))
            ((eq pipefitting 30) (setq fitname "weld"))
            ((eq pipefitting 50) (setq fitname "av"))
	  )
          (command "insert" fitname (list (/ station (/ 	xscale 100)) -8.5) "1" "1" "0")
	)
      )
    );end progn of while
  );end while
  (close filereader5)
;;;  ; ------------------------------------------------------------------------------
;;;  ; Sixth loop, for the rest of Pipe Fittings. **Right now this loop is not used**
;;;  ; ------------------------------------------------------------------------------
;;;  (setq filereader6 (open filename "r"))
;;;  (while (/= (setq oneline (read-line filereader6)) nil)
;;;    (progn
;;;      (setq exit_loop_flage "N")
;;;      (setq station (atof (substr oneline 1 8)))
;;;      (setq groundlevel (atof (substr oneline 9 8)))
;;;      (setq pipefitting (atof (substr oneline 33 5)))
;;;      (if (/= pipefitting 0.00)
;;;        (progn
;;;	  (while (and (/= (setq nextline (read-line filereader5)) nil) (= exit_loop_flage "N"))
;;;	    (progn
;;;	      (setq station_n (atof (substr nextline 1 8)))
;;;	      (setq groundlevel_n (atof (substr oneline 9 8)))
;;;	      (setq pipefitting_n (atof (substr nextline 33 5)))
;;;              (if (/= pipefitting_n 0.00)
;;;		(progn
;;;		  (setq exit_loop_flage "Y")
;;;		  
;;;		)
;;;	      )
;;;	    )
;;;	  )
;;;	)
;;;      )
;;;    );end progn of while
;;;  );end while
;;;  (close filereader6)
  (command "zoom" "e")
);end water
  )
(prompt
  (strcat "\nTo setup water profile settings Run &amp;lt; WASetup &amp;gt;..."
	  "\n&amp;amp; &amp;lt; water &amp;gt; To run main program..."
  )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 08:38:28 GMT</pubDate>
    <dc:creator>hosneyalaa</dc:creator>
    <dc:date>2020-09-28T08:38:28Z</dc:date>
    <item>
      <title>LISP</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp/m-p/9763318#M70065</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a problem in loading LISP to my AutoCAD version 2019, it doesn't work!&lt;/P&gt;&lt;P&gt;I have uploaded the LISP files to the support files successfully, but when I write a command to run the LISP it gives (PRESS F1 FOR HELP)&lt;/P&gt;&lt;P&gt;Can you help me please?&lt;/P&gt;&lt;P&gt;I can provide you with the lisp files, in order to try it in your AutoCAD version.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Sep 2020 11:27:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp/m-p/9763318#M70065</guid>
      <dc:creator>marwah.izmeqna</dc:creator>
      <dc:date>2020-09-23T11:27:56Z</dc:date>
    </item>
    <item>
      <title>Re: LISP</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp/m-p/9763355#M70066</link>
      <description>&lt;P&gt;Please do, upload the *.lsp file you're trying to load.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Sep 2020 11:45:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp/m-p/9763355#M70066</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2020-09-23T11:45:38Z</dc:date>
    </item>
    <item>
      <title>Re: LISP</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp/m-p/9763475#M70067</link>
      <description>&lt;DIV style="box-shadow: 8px 8px; font-size: 12px; font-style: italic; color: #336699; font-family: verdana; margin: 5px 50px 25px 50px; padding: 8px; border: 1px dotted #336699;"&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/9672393"&gt;@marwah.izmeqna&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;I have uploaded the LISP files to the support files successfully, but when I write a command to run the LISP it gives (PRESS F1 FOR HELP)&lt;/P&gt;
&lt;/DIV&gt;
&lt;DIV style="font-size: 1.1em; font-family: 'Artifakt'; line-height: 1.3em; margin: 15px 100px 80px 100px;"&gt;
&lt;P&gt;I don't know exactly what you mean by "I have uploaded the LISP files to the support files...".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A lisp file does not have to be located in any particular folder. It can be loaded from anywhere. Now if it calls a .DCL file or other external files, then those other files may have to be in the support file search path.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Simply *placing* the .LSP file in your support file search path does not *load* it. The file must be *loaded* before it will work at the command line.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.cadtutor.net/forum/topic/65-how-to-use-the-lisp-routines-in-this-archive/" target="_blank" rel="noopener"&gt;See this&lt;/A&gt; for a variety of ways to *load* the lisp file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And then, note that if the lisp code contains errors that prevent it from loading, it still will not run from the command line.&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Wed, 23 Sep 2020 12:34:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp/m-p/9763475#M70067</guid>
      <dc:creator>rkmcswain</dc:creator>
      <dc:date>2020-09-23T12:34:01Z</dc:date>
    </item>
    <item>
      <title>Re: LISP</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp/m-p/9764935#M70068</link>
      <description>&lt;P&gt;Like rkmcswain sounds like typing the defun name and not doing a (load "mylisp") xxxx&lt;/P&gt;</description>
      <pubDate>Thu, 24 Sep 2020 04:42:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp/m-p/9764935#M70068</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2020-09-24T04:42:27Z</dc:date>
    </item>
    <item>
      <title>Re: LISP</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp/m-p/9765033#M70069</link>
      <description>&lt;P&gt;Thank you for your reply&lt;/P&gt;&lt;P&gt;I have already loaded the lisp file from the command line by (APPLOAD). The problem is not with the procedure.&lt;/P&gt;&lt;P&gt;I used to do this with AutoCAD 2007, and it always worked, but&amp;nbsp; this problem was raised with the earlier versions of AutoCAD (2013,2019,...)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Sep 2020 06:20:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp/m-p/9765033#M70069</guid>
      <dc:creator>marwah.izmeqna</dc:creator>
      <dc:date>2020-09-24T06:20:08Z</dc:date>
    </item>
    <item>
      <title>Re: LISP</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp/m-p/9765053#M70070</link>
      <description>&lt;P&gt;Attached two LISP files&lt;/P&gt;&lt;P&gt;You can run the LISP by typing&lt;/P&gt;&lt;P&gt;Sewer prof : SWSetup then sewer&lt;/P&gt;&lt;P&gt;Water prof: WASetup&amp;nbsp; &amp;nbsp;then water&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I will be thankful if you could help.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Sep 2020 06:30:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp/m-p/9765053#M70070</guid>
      <dc:creator>marwah.izmeqna</dc:creator>
      <dc:date>2020-09-24T06:30:04Z</dc:date>
    </item>
    <item>
      <title>Re: LISP</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp/m-p/9765199#M70071</link>
      <description>&lt;P&gt;These files are not enough to run the routine. You need to also have&lt;STRONG&gt;&amp;nbsp;water_prof.dcl&lt;/STRONG&gt; and&lt;STRONG&gt; sewer_prof.dcl&lt;/STRONG&gt; files.&lt;/P&gt;
&lt;P&gt;Put all the files to new folder, add the path of the folder between support paths at Options/Files dialog.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Sep 2020 07:42:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp/m-p/9765199#M70071</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2020-09-24T07:42:06Z</dc:date>
    </item>
    <item>
      <title>Re: LISP</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp/m-p/9765236#M70072</link>
      <description>&lt;P&gt;I know that and did it, it is not my first time using LISP. attached the files.&lt;/P&gt;&lt;P&gt;The problem raised with the new version of AutoCAD only.&lt;/P&gt;&lt;P&gt;I used to use this LISP in AUtoCAD 2007 and it always worked successfully.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Sep 2020 07:58:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp/m-p/9765236#M70072</guid>
      <dc:creator>marwah.izmeqna</dc:creator>
      <dc:date>2020-09-24T07:58:55Z</dc:date>
    </item>
    <item>
      <title>Re: LISP</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp/m-p/9765251#M70073</link>
      <description>&lt;P&gt;HI&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;What is the error message that appears?&lt;/P&gt;&lt;P&gt;AND&lt;/P&gt;&lt;P&gt;AutoCAD file as an example&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;;;;;=========support path=============
(setq ac_exe (findfile "acad.exe"))
(setq ac_path (substr ac_exe 1 (- (strlen ac_exe) 8)))
(setq supp_path (strcat ac_path "support\\"))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Sep 2020 08:09:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp/m-p/9765251#M70073</guid>
      <dc:creator>hosneyalaa</dc:creator>
      <dc:date>2020-09-24T08:09:50Z</dc:date>
    </item>
    <item>
      <title>Re: LISP</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp/m-p/9765254#M70074</link>
      <description>&lt;P&gt;So you know the routine, in 2007 worked for you, now in 2019 it's not. Right?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The issue is probably the security setting. Type SECURITYOPTIONS and lower the security level. Or add the location, where the routine is saved, between "Trusted Location"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Btw, I can load the routine successfully in 2020, but dunno how it works. So in case you need further help, post some the file with instructions on how to use the ruoítien.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Sep 2020 08:09:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp/m-p/9765254#M70074</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2020-09-24T08:09:39Z</dc:date>
    </item>
    <item>
      <title>Re: LISP</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp/m-p/9765472#M70076</link>
      <description>&lt;P&gt;Yes exactly, it works only on AutoCAD 2007.&lt;/P&gt;&lt;P&gt;I will try the security issue.&lt;/P&gt;&lt;P&gt;meanwhile , please try the attached files.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After Uploading the attached folder to the support files, follow&amp;nbsp;this procedure:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the command line type:&amp;nbsp; SWSETUP ---- In the appeared window Datum: 907&lt;/P&gt;&lt;P&gt;In the command line type: Sewer----in the window select the attached (.prn ) file&lt;/P&gt;&lt;P&gt;A sewer profile should be drawn.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Sep 2020 10:07:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp/m-p/9765472#M70076</guid>
      <dc:creator>marwah.izmeqna</dc:creator>
      <dc:date>2020-09-24T10:07:11Z</dc:date>
    </item>
    <item>
      <title>Re: LISP</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp/m-p/9765485#M70077</link>
      <description>&lt;P&gt;To run the lisp i should Type SWSETUP, and then fill the appeared window with a suitable Datum, then i should type SEWER to select the (.prn) file, but when i type SEWER in the command line this message is popping up!&lt;/P&gt;&lt;P&gt;&amp;nbsp; attached a screenshot for the messege.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Sep 2020 10:14:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp/m-p/9765485#M70077</guid>
      <dc:creator>marwah.izmeqna</dc:creator>
      <dc:date>2020-09-24T10:14:54Z</dc:date>
    </item>
    <item>
      <title>Re: LISP</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp/m-p/9765504#M70078</link>
      <description>&lt;P&gt;What should i do with the Script in your reply??&lt;/P&gt;</description>
      <pubDate>Thu, 24 Sep 2020 10:24:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp/m-p/9765504#M70078</guid>
      <dc:creator>marwah.izmeqna</dc:creator>
      <dc:date>2020-09-24T10:24:55Z</dc:date>
    </item>
    <item>
      <title>Re: LISP</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp/m-p/9765520#M70079</link>
      <description>&lt;P&gt;Find this path:&amp;nbsp;"C:\\Program Files\\Autodesk\\AutoCAD 2019\\SUPPORT"&lt;/P&gt;
&lt;P&gt;and store the routine there. It can't be elsewhere. You must be able to write there.&lt;/P&gt;
&lt;P&gt;This path should be between "support paths" and "trusted path" (already)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you cannot store the routine there, use your own path and change it in the code:&lt;/P&gt;
&lt;P&gt;(setq supp_path "c:\\Users\\Desktop\\_Download\\tmp\\") - also add this between support paths.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Sep 2020 10:42:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp/m-p/9765520#M70079</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2020-09-24T10:42:15Z</dc:date>
    </item>
    <item>
      <title>Re: LISP</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp/m-p/9767098#M70080</link>
      <description>&lt;P&gt;HI&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/9672393"&gt;@marwah.izmeqna&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The problem was with the temporary file storing data&lt;BR /&gt;I switched it to a list&lt;BR /&gt;The preparatory order swsetup is canceled&lt;BR /&gt;Try it&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;;;;=============error================
(defun myerr (msg)
  (defun *error* (s)
    (if old_error (setq *error* old_error))
    (princ)
  )
  (if msg (princ msg))
  (exit)
)
;;;=============setup================
;;;(defun c:swsetup()
;;; (setq fstpf (findfile "swrstp.txt"))
;;;  (if (= fstpf nil)
;;;    (progn
;;;    (setq hsc "1000" vsc "100" sst "0.00" dtm "0"))
;;;   (progn
;;;    (setq ostpr (open fstpf "r"))
;;;     (setq hsc (read-line ostpr))
;;;     (setq vsc (read-line ostpr))
;;;     (setq sst (read-line ostpr))
;;;     (setq dtm (read-line ostpr))
;;;    (close ostpr)
;;;   )
;;;  );;if
;;;;;==========load setup dialog==================
;;;  (setq swr_dcl (load_dialog "sewer_prof.dcl"))
;;;   (if (/= swr_dcl -1)
;;;     (new_dialog "swr_prf" swr_dcl)
;;;    (progn
;;;     (alert "\nDialog File &amp;lt; sewer_prof.dcl &amp;gt; not found.")
;;;     (myerr "Function Terminated.")
;;;   ))
;;;(set_tile "hsc" hsc)
;;;(set_tile "vsc" vsc)
;;;(set_tile "sst" sst)
;;;(set_tile "dtm" dtm)
;;;
;;;(action_tile "hsc" "(setq hsc1 $value)")
;;;(action_tile "vsc" "(setq vsc1 $value)")
;;;(action_tile "sst" "(setq sst1 $value)")
;;;(action_tile "dtm" "(setq dtm1 $value)")
;;;
;;;(setq hsc1 (get_tile "hsc"))
;;;(setq vsc1 (get_tile "vsc"))
;;;(setq sst1 (get_tile "sst"))
;;;(setq dtm1 (get_tile "dtm"))
;;;    (start_dialog)
;;;
;;;   (setq ostpw (open (getfiled "Output file"
;;;                (strcat (getvar "dwgprefix")
;;;                "swrstp.")
;;;                "txt"     ;file type
;;;                1) "w"))
;;;    (write-line hsc1 ostpw)
;;;    (write-line vsc1 ostpw)
;;;    (write-line sst1 ostpw)
;;;    (write-line dtm1 ostpw)
;;;   (close ostpw)
;;;);;swsetup
;;;;==================main program========================
(defun c:sewer ()

  (setq fstpf (findfile "swrstp.txt"))
  (if (= fstpf nil)
    (progn
    (setq hsc "1000" vsc "100" sst "0.00" dtm "0"))
   (progn
    (setq ostpr (open fstpf "r"))
     (setq hsc (read-line ostpr))
     (setq vsc (read-line ostpr))
     (setq sst (read-line ostpr))
     (setq dtm (read-line ostpr))
    (close ostpr)
   )
  );;if
;;==========load setup dialog==================
  (setq swr_dcl (load_dialog "sewer_prof.dcl"))
   (if (/= swr_dcl -1)
     (new_dialog "swr_prf" swr_dcl)
    (progn
     (alert "\nDialog File &amp;lt; sewer_prof.dcl &amp;gt; not found.")
     (myerr "Function Terminated.")
   ))
(set_tile "hsc" hsc)
(set_tile "vsc" vsc)
(set_tile "sst" sst)
(set_tile "dtm" dtm)

(action_tile "hsc" "(setq hsc1 $value)")
(action_tile "vsc" "(setq vsc1 $value)")
(action_tile "sst" "(setq sst1 $value)")
(action_tile "dtm" "(setq dtm1 $value)")

(setq hsc1 (get_tile "hsc"))
(setq vsc1 (get_tile "vsc"))
(setq sst1 (get_tile "sst"))
(setq dtm1 (get_tile "dtm"))
    (start_dialog)
;;;
;;;   (setq ostpw (open (getfiled "Output file"
;;;                (strcat (getvar "dwgprefix")
;;;                "swrstp.")
;;;                "txt"     ;file type
;;;                1) "w"))
;;;    (write-line hsc1 ostpw)
;;;    (write-line vsc1 ostpw)
;;;    (write-line sst1 ostpw)
;;;    (write-line dtm1 ostpw)
;;;   (close ostpw)

 (setq ostpw (LIST hsc1 vsc1 sst1 dtm1))

  
       (setvar "cmdecho" 0)
       (setq absthc 5.7)
       (setq abstgrs 19.6)
       (setq dncircle 0.15)
       (SETVAR "OSMODE" 0)
  
;;;=============load setup================
;;;(setq stpchk (findfile "swrstp.txt"))
  
 (if ostpw
  
  (progn
;;;    (setq opchkf (open stpchk "r"))
     (setq xma (atof (CAR ostpw)))
     (setq xmas (/ xma  100))
     (setq yma (atof (CADR ostpw)))
     (setq ymas (/ yma  100))
     (setq lanf (atof (CADDR ostpw)))
     (setq bezhorg (atof (CADDDR ostpw)))
     (setq abstand (* absthc ymas))
     (setq bezh (- bezhorg abstand))
;;; (close opchkf)
  )
 )

  
;;;=============layer setup================
       (command "layer" "new" "sewer" "color" "cyan" "sewer" "")
       (command "layer" "new" "manhole" "color" "magenta" "manhole" "")
       (command "layer" "new" "press" "color" "green" "press" "")
       (command "layer" "new" "text" "color" "green" "text" "")
       (command "layer" "new" "ground" "color" "blue" "ground" "")
       (command "layer" "new" "vline" "color" "red" "vline" "")
       (command "layer" "new" "gsurf" "color" "red" "gsurf" "")
       (command "layer" "make" "legend" "color" "green" "legend" "")
;;;;====================================================
;;;    (setq ifp (getfiled "Select data file" "" "prn" 2))

  (setq ifp (getfiled "Select data file"
                (strcat (getvar "dwgprefix")
;;;                (substr (getvar "DWGNAME") 1 (- (strlen (getvar "dwgname")) 1))
			)
                "prn"     ;file type
                4)
	)
  
     (if (= ifp nil)
       (myerr "Invalid File Type.")
     )
       (setq op (open ifp "r"))
       (setq dummy (read-line op))
       (setq dummy (read-line op))
       (setq dummy (read-line op))
       (setq dummy (read-line op))
;;;;====================================================
       (setq pr_tbl (findfile "prof_tbl.dwg"))
        (if (/= pr_tbl nil)
          (command "insert" "prof_tbl" "0,0" "1" "1" "0" )
         (progn
          (alert "\n can't find &amp;lt; Prof_tbl.dwg &amp;gt; file. ")
          (myerr "Function Canceled.")
        ))
;;;;====================================================
;;       (command "zoom" "w" "-9,20" "30,-8.5" )
       (setq abb 0.0)
       (setq b 0)
       (setq b2 0)
       (setq cumzaehl 0)
       (setq defy2a 0)
       (setq erster 0)
       (setq gefy2a 0)
       (setq inderst 0)
       (setq indgel 0)
       (setq indsohl 0)
       (setq ind-hcn 0)
       (setq laeng 0.0)
       (setq lauf 0)
       (setq lcumsohl 0)
       (setq leist 7.05)
       (setq lcum 0)
       (setq pdm 0)
       (setq panfdm 0)
       (setq psch1 0)
       (setq schacht 0)
       (setq scherst 0)
       (setq schleif 0.0)
       (setq uebsohl2 0)
       (setq vert 0)
       (setq wink 0.0)
       (setq wcos 0.0)
       (setq xdm 0.0)
       (setq xlng 0.0)
       (setq xstr 0.0)
       (setq indend 0)
       (setq sbreit 0.1)
       (setq pnull (polar '(0.0 0.0) 0.0 0))
       (setq pkt1 (polar '(0.0 -7.05) 0.0 0))
       (setq pdm (polar '(0.0 0.0) 0.0 0))
       (setq pdt0 (polar '(0.0 0.0) 0.0 0))
       (command "layer" "set" "text" "")
   ;;  (command "text" "s" "standard" "-7.46,5.3" "0.4" "0" (rtos yma 2 0) )
   ;;  (command "text" "r" "-2.55,0.4" "0.4" "0" bezh )
       (command "text" "r" "-2.55,6.38" "0.4" "0" (RTOS bezhorg 2 2) )
       (command "text" "-2.55,6.38" "0.4" "0" " m" )
   ;;  (command "text" "-5.31,2.55" "0.4" "0" (rtos xma 2 0) )
(while (or (= abb 0) (= abb 5))
       (setq abb 0)
       (setq zaehl 0)
       (setq kpkt1 "")
  ( while (&amp;lt; zaehl 7)
  (if (setq dumm (read-char op))
	    (if (/= dumm 32) (progn
			     (setq zeich (chr dumm))
			     (setq kpkt1 (strcat kpkt1 zeich))			     )
	    )
       (progn
       (command "layer" "set" "vline" "")
       (setq abb 1.1)
       (setq p1a (polar p1b 0.0 0.0))
       (setq p1b (polar p1a 0.0 1.5))
       (setq p1bu (polar p1a 0.0 1.5))
       (command "line" p1a p1b "" )
       (setq p1a (polar p1a (* pi 0.5) 1.35))
       (setq p1b (polar p1b (* pi 0.5) 1.35))
       (command "line" p1a p1b "" )
       (setq p1a (polar p1a (* pi 0.5) 1.35))
       (setq p1b (polar p1b (* pi 0.5) 1.35))
       (command "line" p1a p1b "" )
       (setq p1a (polar p1a (* pi 0.5) 1.35))
       (setq p1b (polar p1b (* pi 0.5) 1.35))
       (command "line" p1a p1b "" )
       (setq p1a (polar p1a (* pi 0.5) 1.35))
       (setq p1b (polar p1b (* pi 0.5) 1.35))
       (command "line" p1a p1b "" )
       (setq p1a (polar p1a (* pi 0.5) 1.00))
       (setq p1b (polar p1b (* pi 0.5) 1.00))
       (command "line" p1a p1b "" )
       (setq p1a (polar p1a (* pi 0.5) 1.00))
       (setq p1b (polar p1b (* pi 0.5) 1.00))
       (command "line" p1a p1b "" )
       (setq p1a (polar p1a (* pi 0.5) 1.00))
       (setq p1b (polar p1b (* pi 0.5) 1.00))
       (command "line" p1a p1b "" )
       (command "line" p1b p1bu "" )
       (command "layer" "set" "gsurf" "")
       (command "line" (polar pkt3 (* pi 0.5) abstgrs) (polar pkt3 (* pi 0.5) (+ abstgrs 1)) "")
       (command "layer" "set" "manhole" "")
       (command "line" psohl4 (polar psohl4 0 sbreit) "" )
       (setq zaehl 7)
  )
  )
       (setq zaehl (+ zaehl 1))
  )
  (while (= abb 0)
       (setq dumm (read-char op))    
       (setq zaehl 0)
       (setq kpkt2 "")
  ( while (/= zaehl 7)
       (setq dumm (read-char op))
       (if (/= dumm 32) (progn
			(setq zeich (chr dumm))
			(setq kpkt2 (strcat kpkt2 zeich))
			)
       )
       (setq zaehl (+ zaehl 1))
  )
(IF (or (= "END" kpkt2) (= "end" kpkt2)) (setq indend 1))
       (setq dumm (read-char op))    
       (setq ausd (read-line op))
       (setq ahilf (substr ausd 1 7))
       (setq index1 33)
       (if (or (= "       " ahilf ) (= 0 (ascii ahilf)))
			     (progn
			     (setq a2 (rtos b))
			     (setq a (atof a2))
			     (setq gefy1 gefy2a)
			     (setq index1 0)
			     )
       )
       (if (/= 0 index1) (progn
			 (setq a (atof ahilf))
			 (setq gefy1 a)
			 (setq a (- a bezh))
			 (setq a (/ a ymas))
			 (setq index1 0)
			 (setq nix (- gefy1 gefy2a))
			 (if (&amp;lt;= 0.001 (abs nix)) (progn
						  (setq index1 1)
						   )
			 )
			 )
       )
       (setq b (atof (substr ausd 9 7)))
       (setq gefy2a b)
       (setq b (- b bezh))
       (setq b (/ b ymas))

(setq pkt1a (polar pkt1 0.0 laeng))
(setq panf (polar pnull 0.0 laeng))
(setq pkt0 (polar panf (/ pi 2.0) a))
       (setq defy1 0)
       (setq defy2a 0)
       (setq adruck (substr ausd 50 7))
       (setq d (atof adruck))
       (setq defy1 d)
       (setq d (- d bezh))
       (setq d (/ d ymas))
(setq adruck2 (substr ausd 58 7))       (setq b2 (atof adruck2))
       (setq defy2a b2)
       (setq b2 (- b2 bezh))
       (setq b2 (/ b2 ymas))
       (setq hcn1 (substr ausd 66 30))
       (setq hcn2 (substr ausd 97 30))
       (setq grsf (substr ausd 128 14))
       (setq pdnf (polar pnull 0.0 laeng))
       (if (/= defy1 0.0) (setq pdt0 (polar pdnf (/ pi 2.0) d)))
       (if (/= defy2a 0.0) (setq pdt20 (polar pdnf (/ pi 2.0) b2)))
       (if (/= defy1 0.0) (setq pdruck1 (polar pdt0 0 0)))
       (if (/= defy2a 0.0) (setq pdruck2 (polar pdt20 0 0)))
       (setq x (atof (substr ausd 17 7)))
       (setq lgef x)
       (setq lng (rtos x 2 2))
       (setq x (/ x xmas))
       (setq DN (atof (substr ausd 25 4)))
       (setq DURCHM (rtos DN 2 0))
       (setq DN (/ DN 1000))
       (setq DNGEF DN)
       (setq DN (/ DN ymas))
       (setq MAT (substr ausd 30 3))
       (setq laeng (+ laeng x))
       (setq pkt2 (polar pkt1 0.0 laeng))
       (setq pkt3 (polar pkt2 (/ pi 2.0) leist))
       (setq pkt4 (polar pkt3 (/ pi 2.0) b))
       (setq pdt2 (polar pkt1 0.0 laeng))
       (setq pdt3 (polar pdt2 (/ pi 2.0) leist))
       (setq pdt4 (polar pdt3 (/ pi 2.0) b2))
  (command "layer" "set" "vline" "")
  (if (= lauf 0) (progn
		 (command "line" pkt1a panf pkt0 "" )
		 (setq indgel 1)
		 )
  )
  (if (= vert 0) (progn
      (command "line" (polar panf (* pi 1.5) 3.0) (polar panf (* pi 1.5) 4.35) "" )
      (command "line" (polar panf (* pi 1.5) 5.7) (polar panf (* pi 1.5) 7.05) "" )
  ))
  (setq vert 1)
      (command "line" (polar pkt3 (* pi 1.5) 3.0) (polar pkt3 (* pi 1.5) 4.35) "")
      (command "line" (polar pkt3 (* pi 1.5) 5.7) (polar pkt3 (* pi 1.5) 7.05) "")
       (command "line" panf pkt3 "" )       (command "line" (polar panf (* pi 0.5) absthc) (polar pkt3 (* pi 0.5) absthc) "")
       (command "layer" "set" "gsurf" "")
       (command "line" (polar panf (* pi 0.5) abstgrs) (polar pkt3 (* pi 0.5) abstgrs) "")
       (command "line" (polar panf (* pi 0.5) (+ abstgrs 1)) (polar pkt3 (* pi 0.5) (+ abstgrs 1)) "")
       (command "layer" "set" "vline" "")
       (setq p1a (polar panf (* pi 1.5) 1.0))
       (setq p1b (polar pkt3 (* pi 1.5) 1.0))
       (command "line" p1a p1b "" )
       (setq p1a (polar p1a (* pi 1.5) 1.0))
       (setq p1b (polar p1b (* pi 1.5) 1.0))
       (command "line" p1a p1b "" )
       (setq p1a (polar p1a (* pi 1.5) 1.0))
       (setq p1b (polar p1b (* pi 1.5) 1.0))
       (command "line" p1a p1b "" )
       (setq p1a (polar p1a (* pi 1.5) 1.35))
       (setq p1b (polar p1b (* pi 1.5) 1.35))
       (command "line" p1a p1b "" )
       (setq p1a (polar p1a (* pi 1.5) 1.35))
       (setq p1b (polar p1b (* pi 1.5) 1.35))
       (command "line" p1a p1b "" )
       (setq p1a (polar p1a (* pi 1.5) 1.35))
       (setq p1b (polar p1b (* pi 1.5) 1.35))
       (command "line" p1a p1b "" )
       (setq p1a (polar p1a (* pi 1.5) 1.35))
       (setq p1b (polar p1b (* pi 1.5) 1.35))
       (command "line" p1a p1b "" )
       (setq uhilf (substr ausd 34 7))
       (setq index2 33)
       (if (or (= "       " uhilf) (= 0 (ascii uhilf)))
			   (progn
			   (setq u2 (rtos sohl2 2 2))
			   (setq sohl1 (atof u2))
			   (setq index2 0)
			   (setq uebsohl1a uebsohl2)
			   )
       )
       (if (/= 0 index2) (progn
			 (setq sohl1 (atof uhilf))
			 (setq uebsohl1a sohl1)
			 (setq nix (- uebsohl2 uebsohl1a))
			 (setq index2 0)
			 (if (&amp;lt;= 0.001 (abs nix)) (progn						  (setq index2 1)
						  )
			 )
			 (setq uebsohl1a (- uebsohl1a bezh))
			 (setq uebsohl1a (/ uebsohl1a ymas))
			 )
       )
       (setq pub0 (polar panf (/ pi 2) uebsohl1a))
       (if (= lauf 0) (setq psch1 pub0))
       (setq sohl2 (atof (substr ausd 42 7)))
       (setq uebsohl2 sohl2)
       (setq uebsohl2 (- uebsohl2 bezh))
       (setq uebsohl2 (/ uebsohl2 ymas))
       (setq pub4 (polar pkt3 (/ pi 2) uebsohl2))
	(If (/= sohl1 0.0) (progn
			   (setq psohl (polar pub0 0 0))
			   (setq indsohl (+ indsohl 1))
			   )
	)
	(If (/= sohl2 0.0) (progn
			   (setq psohl4 (polar pub4 0 0))
			   (setq indsohl (+ indsohl 1))
			   )
	)
       (If (/= sohl1 0.0) (progn
			  (setq psohl (polar pub0 0 0))
			  (setq ueb1a uebsohl1a)
			  (setq hanf lcumsohl)
			  )
       )
       (setq lcumsohl (+ lcumsohl lgef))

       (If (/= sohl2 0.0) (progn
			  (setq psohl4 (polar pub4 0 0))
			  (setq ueb2 uebsohl2)
			  (setq hend lcumsohl)
       ))

       (if (= indsohl 2) (progn
			  (setq wink (angle psohl psohl4))
			  (setq wcos (cos wink))
			  (setq xstr (/ sbreit wcos))
			  (setq psohl (polar psohl wink xstr))
			  (setq psohl4 (polar psohl4 wink (* -1 xstr)))
			   (command "layer" "set" "manhole" "")
			 ; (command "line" psch1 psohl "
			   (setq ykoord1 (cadr psch1))
			   (setq ykoord2 (cadr psohl))
			   (if (&amp;gt; inderst 0) (progn
			   (if (&amp;gt;= ykoord2 ykoord1) (command "pline" psohl (polar psch1 0 (* sbreit 2)) psch1 "" ))
			   (if (&amp;gt; ykoord1 ykoord2) (command "pline" pschl (polar psohl pi (* sbreit 2)) psohl "" ))
			   ))
			   (if (= inderst 0) (progn
			   (if (&amp;gt;= ykoord2 ykoord1) (command "pline" psohl (polar psch1 0 sbreit) psch1 "" ))
			   (if (&amp;gt; ykoord1 ykoord2) (command "pline" psch1 (polar psohl pi sbreit) psohl "" ))
			   (setq inderst 1)
			   ))
			   (setq ykoord1 nil)
			   (setq ykoord2 nil)
			   (command "layer" "set" "sewer" "")
			   (command "line" psohl psohl4 "" )
			   (setq psch1 (polar psohl4 0 0))
			   (if (= vert 0) (progn
					  (command "layer" "set" "vline" "")
					  (command "line" pkt1a panf pkt0 "" )
					  )
			   )
			   (setq vert 1)
			   (command "layer" "set" "vline" "")
			   (command "line" pkt2 pkt3 pkt4 "" )
			   )
       )
  (if (= indgel 1) (progn
		    (setq wink (angle pkt0 pkt4))
		    (setq wcos (cos wink))
		    (setq xstr (/ sbreit wcos))
		    (setq pkt0g (polar pkt0 wink xstr))
		    (setq indgel 0)
		    )
  )
  (if (= indsohl 2) (progn
		    (setq wink (angle pkt0 pkt4))
		    (setq wcos (cos wink))
		    (setq xstr (/ sbreit wcos))
		    (setq pkt4g (polar pkt4 wink (* -1 xstr)))
		    (setq indgel 1)
		    )
  )
  (if (= indend 0) (progn
     (command "layer" "set" "ground" "")
     (command "line" pkt0 pkt4 "" )
  ))
       (setq xdm (+ xdm x)) 
       (if (= indsohl 2) (setq panfdm pkt3))
       (if (= indsohl 2) (progn
			 (setq pdm1 (polar panfdm (* pi 1.5) 0.55))
			 (setq pdm (polar pdm1 pi (/ xdm 2)))
			 )
       )
       (setq DURCHM (strcat "ND " DURCHM " " MAT))
       (setq strl (strlen DURCHM))
       (setq strd (* strl 0.3))
       (setq shd 0.3)
       (if (&amp;gt;= strd xdm) (progn
			(setq strd (* strl 0.15))
			(setq shd 0.15)
			)
       )
       (setq xlng (+ xlng (atof lng)))
       (setq pdl (polar pdm (* pi 1.5) 1.00))
       (setq strl (strlen LNG))
       (setq str (* strl 0.3))
       (setq sh 0.3)
       (if (&amp;gt;= str xdm) (progn
			(setq str (* strl 0.15))
			(setq sh 0.15)
			)
       )

       (command "layer" "set" "text" "")
  (if (= indend 0) (progn

       (if (&amp;lt;= str xdm) (progn
			(if (= indsohl 2) (command "text" "m" pdl sh "0.0" (rtos XLNG 2 2)))
			)
			(if (= indsohl 2) (command "text" "m" pdl "0.1" "0.0" (rtos XLNG 2 2)))
       )
  ))
  (if (= indend 0) (progn
       (if (&amp;lt;= strd xdm) (progn
			(if (= indsohl 2) (command "text" "m" pdm shd "0.0" DURCHM ))
			)
			(if (= indsohl 2) (command "text" "m" pdm "0.1" "0.0" DURCHM ))
       )

  ))
       (setq pterra (polar panf (* pi 1.5) 3.675))
       (setq pterra (polar pterra 0.0 0.25))
       (setq pterrb (polar pkt3 (* pi 1.5) 3.675))
       (setq pterrb (polar pterrb pi 0.25))
  (if (= indend 0) (progn
       (if (= index1 1) (progn
			(command "text" "m" pterra "0.2" "90" (rtos gefy1 2 2) )
			)
       )
       (command "text" "m" pterrb "0.2" "90" (rtos gefy2a 2 2) )
  ))
       (if (/= defy1 0.0) (progn
		   (setq sol1 (polar pdruck1 (* pi 0.5) dncircle))
		   (command "layer" "set" "press" "")
		   (command "circle" "2p" pdruck1 sol1 )
		   (command "layer" "set" "vline" "")
		   (command "line" panf (polar panf (* pi 0.5) absthc) "" )
		  ;(command "text" "m" (polar pdruck1 (* pi 0.5) 0.5) "0.2" "0.0" (rtos defy1 2 2) )
		   )
       )
       (if (/= defy2a 0.0) (progn
		   (setq sol1 (polar pdruck2 (* pi 0.5) dncircle))
		   (command "layer" "set" "press" "")
		   (command "circle" "2p" pdruck2 sol1 )
		   (command "layer" "set" "vline" "")
		   (command "line" panf (polar panf (* pi 0.5) absthc) "" )
		 ; (command "text" "m" (polar pdruck2 (* pi 0.5) 0.5) "0.2" "0.0" (rtos defy2a 2 2) )
		   )
      )
 (command "layer" "set" "text" "")
 (command "text" (polar pdnf (* pi 0.7) 0.2) "0.2" "90" hcn1 )
 (command "text" "j" "tl" (polar pdnf (* pi 0.3) 0.2) "0.2" "90" hcn2 )
 (setq pgrsf (polar panf (* pi 0.5) abstgrs))
 (command "text" (polar pgrsf (* pi 0.25) 0.35) "0.4" "0" grsf )
 (command "layer" "set" "vline" "")
 (if (/= "              " grsf) (command "line" pgrsf (polar pgrsf (* pi 0.5) 1) "" ))
(command "layer" "set" "text" "")
(if (= indsohl 2) (progn
		  (setq ygef (- ueb2 ueb1a))
		  (setq ygef (* ygef ymas))
		  (if (/= 0 (fix (* ygef 100))) (progn
						(setq gef (/ ygef (- hend hanf)))
						(setq gef (* gef 1000))
						)
		  )
		  (if (= 0 (fix (* ygef 100))) (setq gef 0))
		      (setq gef (rtos gef 2 2))
		      (setq pdg (polar pdl (* pi 1.5) 1.00))
		      (setq strl (strlen GEF))
		      (setq str (* strl 0.3))
		      (setq sh 0.3)
		      (if (&amp;gt;= str xdm) (progn
				       (setq str (* strl 0.15))
				       (setq sh 0.15)
				       )
		  )
		  (if (= indend 0) (progn
		    (if (&amp;lt;= str xdm) (progn
				     (command "text" "m" pdg sh "0.0" GEF )
				    )
		       (command "text" "m" pdg sh "90." GEF )
		    )
		  ))
		  )
 )
       (setq pterra (polar panf (* pi 1.5) 5.025))
       (setq pterra (polar pterra 0.0 0.25))
       (setq pterrb (polar pkt3 (* pi 1.5) 5.025))
       (setq pterrb (polar pterrb pi 0.25))
  (if (= indend 0) (progn
       (if (= indsohl 2) (progn
			 (command "text" "m" pterrb "0.2" "90" (rtos (+ bezh (* ymas uebsohl2)) 2 2) )
       ))
       (if (= index2 0) (progn
		 (if (= cumzaehl 0) (progn
				    (command "text" "m" pterra "0.2" "90" (rtos (+ bezh (* ymas uebsohl1a)) 2 2) )
				    )
		 )
		 )
	)
  ))

(if (= indend 0) (progn
  (if (= index2 1) (progn
		   (command "text" "m" pterra "0.2" "90" (rtos (+ bezh (* ymas uebsohl1a)) 2 2) )
		   )
  )
))


    (if (= indend 0) (progn
       (setq pterra (polar panf (* pi 1.5) 6.375))
       (setq lcum (+ lcum lgef))
       (setq lcum2 (+ lcum lanf))
    ))
    (if (= indend 0) (progn
       (if (= 0 cumzaehl) (progn
		     (if (= indend 0) (progn
			  (setq pbetta (polar pterra 0.0 0.25))
			  (command "text" "m" pbetta "0.2" "90" (rtos lanf 2 1) )
			  (setq pkpkt (polar pkt1a (* pi 1.5) 0.70))
			  (if (&amp;gt; indsohl 0) (command "text" "m" pkpkt "0.4" "0" kpkt1 ))
		      ))
			  )
       )
       (setq cumzaehl (+ cumzaehl 1))
       (if (/= 0 cumzaehl) (progn
			   (setq pterra (polar pterra 0.0 x))
			   (setq pterra (polar pterra pi 0.25))
			(if (= indend 0) (progn
			   (command "text" "m" pterra "0.2" "90" (rtos lcum2 2 1) )
			   (setq pkpkt (polar pkt2 (* pi 1.5) 0.70))
			   (if (= indsohl 2) (command "text" "m" pkpkt "0.4" "0" kpkt2 ))
			))
			   )
	)
    ))
  (command "layer" "set" "sewer" "")
  (If (&amp;gt; indsohl 0) (setq pub0b (polar psohl (/ pi 2) DN)))
  (If (= indsohl 2) (progn
		    (setq pub4b (polar psohl4 (/ pi 2) DN))
	    (if (= indend 0) (progn
		    (command "line" pub0b pub4b "")
	    ))
		    (setq indsohl 0)
		    (setq schleif (+ schleif 1.0))
		    (setq xdm 0)
		    (setq xlng 0)
		    (command "layer" "set" "manhole" "")
	      (if (= indend 0) (progn
		    (command "line" pkt0g pub0b "")
		    (command "line" pkt4g pub4b "")
	      ))
		    )
  )
       (setq abb 5)
       (setq lauf (+ lauf 1))
       (setq indsohl2 0)
  )
  )
       (close op)
       (command "zoom" "ext")
);;end

(prompt (strcat 
                "\n&amp;amp; &amp;lt; sewer &amp;gt; To run main program..."
))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Sep 2020 22:52:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp/m-p/9767098#M70080</guid>
      <dc:creator>hosneyalaa</dc:creator>
      <dc:date>2020-09-24T22:52:45Z</dc:date>
    </item>
    <item>
      <title>Re: LISP</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp/m-p/9767114#M70081</link>
      <description>&lt;P&gt;اا&lt;/P&gt;</description>
      <pubDate>Thu, 24 Sep 2020 22:50:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp/m-p/9767114#M70081</guid>
      <dc:creator>hosneyalaa</dc:creator>
      <dc:date>2020-09-24T22:50:01Z</dc:date>
    </item>
    <item>
      <title>Re: LISP</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp/m-p/9767120#M70082</link>
      <description>&lt;P&gt;مم&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="22 (1).gif" style="width: 384px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/823382i29839147B08AD43D/image-size/large?v=v2&amp;amp;px=999" role="button" title="22 (1).gif" alt="22 (1).gif" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Sep 2020 22:50:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp/m-p/9767120#M70082</guid>
      <dc:creator>hosneyalaa</dc:creator>
      <dc:date>2020-09-24T22:50:53Z</dc:date>
    </item>
    <item>
      <title>Re: LISP</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp/m-p/9769323#M70083</link>
      <description>&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;Thank u very much&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6591997"&gt;@hosneyalaa&lt;/a&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;It worked!!&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Sep 2020 21:40:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp/m-p/9769323#M70083</guid>
      <dc:creator>marwah.izmeqna</dc:creator>
      <dc:date>2020-09-25T21:40:05Z</dc:date>
    </item>
    <item>
      <title>Re: LISP</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp/m-p/9769609#M70084</link>
      <description>&lt;P&gt;مرحبا مهندسة&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/9672393"&gt;@marwah.izmeqna&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;الحمد لله مشي الحال&lt;/P&gt;&lt;P&gt;اذا بدك شي تاني بموضوع الليسبات&amp;nbsp; انا اساعدك ان شاء الله&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 26 Sep 2020 04:51:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp/m-p/9769609#M70084</guid>
      <dc:creator>hosneyalaa</dc:creator>
      <dc:date>2020-09-26T04:51:02Z</dc:date>
    </item>
    <item>
      <title>Re: LISP</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp/m-p/9770038#M70085</link>
      <description>شكراً كتير الك... عندي نفس المشكلة بملف ال water، أرفقته سابقاً لو ما فيها&lt;BR /&gt;غلبة&lt;BR /&gt;</description>
      <pubDate>Sat, 26 Sep 2020 15:00:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp/m-p/9770038#M70085</guid>
      <dc:creator>marwah.izmeqna</dc:creator>
      <dc:date>2020-09-26T15:00:15Z</dc:date>
    </item>
  </channel>
</rss>

