LISP

LISP

marwah.izmeqna
Participant Participant
4,665 Views
29 Replies
Message 1 of 30

LISP

marwah.izmeqna
Participant
Participant

Hi 

I have a problem in loading LISP to my AutoCAD version 2019, it doesn't work!

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)

Can you help me please?

I can provide you with the lisp files, in order to try it in your AutoCAD version.

0 Likes
Accepted solutions (1)
4,666 Views
29 Replies
Replies (29)
Message 2 of 30

ВeekeeCZ
Consultant
Consultant

Please do, upload the *.lsp file you're trying to load.

Message 3 of 30

rkmcswain
Mentor
Mentor
@marwah.izmeqna wrote:

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)

I don't know exactly what you mean by "I have uploaded the LISP files to the support files...".

 

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.

 

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.

 

See this for a variety of ways to *load* the lisp file.

 

And then, note that if the lisp code contains errors that prevent it from loading, it still will not run from the command line.

R.K. McSwain     | CADpanacea | on twitter
Message 4 of 30

Sea-Haven
Mentor
Mentor

Like rkmcswain sounds like typing the defun name and not doing a (load "mylisp") xxxx

0 Likes
Message 5 of 30

marwah.izmeqna
Participant
Participant

Thank you for your reply

I have already loaded the lisp file from the command line by (APPLOAD). The problem is not with the procedure.

I used to do this with AutoCAD 2007, and it always worked, but  this problem was raised with the earlier versions of AutoCAD (2013,2019,...)

 

0 Likes
Message 6 of 30

marwah.izmeqna
Participant
Participant

Attached two LISP files

You can run the LISP by typing

Sewer prof : SWSetup then sewer

Water prof: WASetup   then water

 

I will be thankful if you could help.

0 Likes
Message 7 of 30

ВeekeeCZ
Consultant
Consultant

These files are not enough to run the routine. You need to also have water_prof.dcl and sewer_prof.dcl files.

Put all the files to new folder, add the path of the folder between support paths at Options/Files dialog.

0 Likes
Message 8 of 30

marwah.izmeqna
Participant
Participant

I know that and did it, it is not my first time using LISP. attached the files.

The problem raised with the new version of AutoCAD only.

I used to use this LISP in AUtoCAD 2007 and it always worked successfully.

0 Likes
Message 9 of 30

hosneyalaa
Advisor
Advisor

HI 


What is the error message that appears?

AND

AutoCAD file as an example

 

;;;;=========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\\"))

 

 

0 Likes
Message 10 of 30

ВeekeeCZ
Consultant
Consultant

So you know the routine, in 2007 worked for you, now in 2019 it's not. Right?

 

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"

 

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.

Message 11 of 30

marwah.izmeqna
Participant
Participant

Yes exactly, it works only on AutoCAD 2007.

I will try the security issue.

meanwhile , please try the attached files.

 

After Uploading the attached folder to the support files, follow this procedure:

 

In the command line type:  SWSETUP ---- In the appeared window Datum: 907

In the command line type: Sewer----in the window select the attached (.prn ) file

A sewer profile should be drawn.

 

0 Likes
Message 12 of 30

marwah.izmeqna
Participant
Participant

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!

  attached a screenshot for the messege. 

0 Likes
Message 13 of 30

marwah.izmeqna
Participant
Participant

What should i do with the Script in your reply??

0 Likes
Message 14 of 30

ВeekeeCZ
Consultant
Consultant

Find this path: "C:\\Program Files\\Autodesk\\AutoCAD 2019\\SUPPORT"

and store the routine there. It can't be elsewhere. You must be able to write there.

This path should be between "support paths" and "trusted path" (already)

 

If you cannot store the routine there, use your own path and change it in the code:

(setq supp_path "c:\\Users\\Desktop\\_Download\\tmp\\") - also add this between support paths.

0 Likes
Message 15 of 30

hosneyalaa
Advisor
Advisor

HI @marwah.izmeqna 

The problem was with the temporary file storing data
I switched it to a list
The preparatory order swsetup is canceled
Try it

 

 

;;;=============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 < sewer_prof.dcl > 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 < sewer_prof.dcl > 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 < Prof_tbl.dwg > 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 (< 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 (<= 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 (<= 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 (> inderst 0) (progn
			   (if (>= ykoord2 ykoord1) (command "pline" psohl (polar psch1 0 (* sbreit 2)) psch1 "" ))
			   (if (> ykoord1 ykoord2) (command "pline" pschl (polar psohl pi (* sbreit 2)) psohl "" ))
			   ))
			   (if (= inderst 0) (progn
			   (if (>= ykoord2 ykoord1) (command "pline" psohl (polar psch1 0 sbreit) psch1 "" ))
			   (if (> 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 (>= 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 (>= str xdm) (progn
			(setq str (* strl 0.15))
			(setq sh 0.15)
			)
       )

       (command "layer" "set" "text" "")
  (if (= indend 0) (progn

       (if (<= 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 (<= 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 (>= str xdm) (progn
				       (setq str (* strl 0.15))
				       (setq sh 0.15)
				       )
		  )
		  (if (= indend 0) (progn
		    (if (<= 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 (> 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 (> 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& < sewer > To run main program..."
))

 

 

Message 16 of 30

hosneyalaa
Advisor
Advisor

اا

0 Likes
Message 17 of 30

hosneyalaa
Advisor
Advisor

مم

22 (1).gif

0 Likes
Message 18 of 30

marwah.izmeqna
Participant
Participant

Thank u very much @hosneyalaa 

It worked!!

🙂 

Message 19 of 30

hosneyalaa
Advisor
Advisor

مرحبا مهندسة

 @marwah.izmeqna 

الحمد لله مشي الحال

اذا بدك شي تاني بموضوع الليسبات  انا اساعدك ان شاء الله 

0 Likes
Message 20 of 30

marwah.izmeqna
Participant
Participant
شكراً كتير الك... عندي نفس المشكلة بملف ال water، أرفقته سابقاً لو ما فيها
غلبة
0 Likes