VV-Lisp-file-Download-Free-Write-Offset-Elevations-in-Sections

VV Lisp file Download Free Write Offset Elevations in Sections

VV Lisp is also named as PRL lisp for AutoCAD. If you are working on a project where you need to draw cross-sections manually, then the VV lisp is a must-have for you. VV lisp is used to annotate the cross-sections or longitudinal sections. The VV Lisp file Download link is given below. Feel free to download, use and share.  

For longitudinal sections or profiles, it is used to write the chainage and elevations of the polyline vertices. You can use this lisp file to annotate the polylines that represent your finished levels and original ground levels.  

For earthwork Cross-sections, PRL lisp for AutoCAD or VV lisp is very handy for writing the elevations and offsets of your final ground and original ground. The use of this lisp is very easy, and it saves a lot of time by automatically writing all the offsets and elevations of your cross-sections.

This lisp file writes the offset and elevation data correctly without any mistakes. While typing manually, you can make any typing or calculating mistakes. The chances of mistakes are eliminated while we use VV lisp for our cross-sections.

The operation of the VV lisp is very simple and accurate. It uses the current coordinates system and the X, Y locations of vertices along the polyline.

The X value of each vertex is referred to as offset or chainage, while the Y value is the numeric representation of the Elevation of the vertex at that specific offset. PRL lisp is very hand and used by a variety of drafters.  

Credits go to the writers of this very useful lisp. The VV lisp is written by Mr. Muhammad Javed & Muhammad Ali.

How to use VV lisp: 

First of all, you will need to draw the cross-section in AutoCAD, and you must have a polyline drawn. Below the cross-section line, you need to specify the location of bands to show offset and elevations. When you have done so, follow the below stated procedure to annotate your cross-sections with simple clicks.

  • Enter the AP command in the AutoCAD command line to appload the VV lisp
  • A new window will appear, browse to the file and, click load, click on close
  • Now enter VV in the command line to start the command
  • The commands prompt asks to select the polyline, Select the polyline which you want to annotate
  • Click at the base point for the X value. Click inside the band where you want to write the values of Offset or chainage
  • Now again, click inside the band where you want to write the elevation values when the command prompt asks you to click on the base point for Y-axis.
  • Done! You will see the values written in the same alignment as your specified points.

Below is the complete tutorial video to use VV lisp.

Troubleshooting Errors 

Sometimes you may see some issues while using VV Lisp, like;  

  • the text is not written when the command is finished 
  • the values are written as zero 
  • Or the text size is very big or very small 

The best way to deal with these issues is to copy your polylines to a new AutoCAD file and paste at the original coordinates, then apply and run the VV lisp command again. 

In some cases, it may be named PRL lisp  Moreover, try changing the current text style or text font. While using the lisp, avoid zooming the extent or zooming in too much.  

I hope this is a complete guide to using VV lisp to annotate your Cross sections the fastest way, accurately, and without any extra effort.

PRL Lisp File for AutoCAD 

Basically, the PRL lisp file and VV Lisp file are both used for the same purpose. Some people have saved the same file with the name of the VV.lisp file, and Others have saved it with PRL.lsp.

So, in either case, you get the same result and file. Both files are used to achieve the same results in AutoCAD.

;;; 12345678901234567890123456789012345678901234567890
;;; VERTEXT.LSP  A program to extract the xyz
;;; coordinates from any polyline and export them
;;; to an ascii file.

(defun ERR (S)
   (if (= S "Function cancelled")
      (princ "\nVERTEXT - cancelled: ")
      (progn (princ "\nVERTEXT - Error: ") (princ S) (terpri)) ;_ progn
   ) ; if
   (RESETTING)
   (princ "SYSTEM VARIABLES have been reset\n")
   (princ)
) ; err
(defun SETV (SYSTVAR NEWVAL)
   (setq X (read (strcat SYSTVAR "1")))
   (set X (getvar SYSTVAR))
   (setvar SYSTVAR NEWVAL)
) ; setv 
(defun SETTING ()
   (setq OERR *ERROR*)
   (setq *ERROR* ERR)
   (SETV "CMDECHO" 0)
   (SETV "BLIPMODE" 0)
) ; end of setting 
(defun RSETV (SYSTVAR) (setq X (read (strcat SYSTVAR "1"))) (setvar SYSTVAR (eval X)))
 ; restv
(defun RESETTING () (RSETV "CMDECHO") (RSETV "BLIPMODE") (setq *ERROR* OERR))
 ; end of resetting 

(defun DXF (CODE ENAME) (cdr (assoc CODE (entget ENAME)))) ; dxf

(defun VERTEXT (/ EN VLIST)
   (setq EN (GET-EN))
   (if (= (DXF 0 EN) "LWPOLYLINE")
      (setq VLIST (GET-LWVLIST EN))
      (setq VLIST (GET-PLVLIST EN))
   ) ; if
   (WRITE-IT VLIST EN)
) ;_ vertext

(defun GET-EN (/ NO-ENT EN MSG1 MSG2)
   (setq NO-ENT 1
         EN     NIL
         MSG1   "\nSelect a polyline: "
         MSG2   "\nNo polyline selected, try again."
   ) ; setq
   (while NO-ENT
      (setq EN (car (entsel MSG1)))
      (if (and EN
               (or (= (DXF 0 EN) "LWPOLYLINE") (= (DXF 0 EN) "POLYLINE")) ; or
          ) ; and
         (progn (setq NO-ENT NIL)) ; progn
         (prompt MSG2)
      ) ; if
   ) ; while
   EN
) ; get-en

(defun GET-LWVLIST (EN / ELIST NUM-VERT VLIST)
   (setq ELIST    (entget EN)
         NUM-VERT (cdr (assoc 90 ELIST))
         ELIST    (member (assoc 10 ELIST) ELIST)
         VLIST    NIL
   ) ; setq
   (repeat NUM-VERT
      (setq VLIST (append VLIST (list (cdr (assoc 10 ELIST)))) ; append
      ) ; setq
      (setq ELIST (cdr ELIST)
            ELIST (member (assoc 10 ELIST) ELIST)
      ) ; setq
   ) ; repeat
   VLIST
) ; get-lwvlist

(defun GET-PLVLIST (EN / VLIST)
   (setq VLIST NIL
         EN    (entnext EN)
   ) ; setq
   (while (/= "SEQEND" (DXF 0 EN))
      (setq VLIST (append VLIST (list (DXF 10 EN))))
      (setq EN (entnext EN))
   ) ; while
   VLIST
) ; get-plvlist

(defun WRITE-IT (VLST EN / NEWVLIST MSG3 FNAME)
   (setq NEWVLIST (mapcar '(lambda (X) (trans X EN 0)) ;_ lambda
                          VLST
                  ) ;_ mapcar
         MSG3     "Polyline vertex file"
        ;FNAME    (getfiled MSG3 "" "txt" 1)
         F1       (open "FNAME" "w")
   ) ; setq
   (WRITE-HEADER)
   (WRITE-VERTICES NEWVLIST)
   (setq F1 (close F1))
) ;_ write-it

(defun WRITE-HEADER (/ STR)
  (setq STR "        POLYLINE VERTEX POINTS")
   (write-line STR F1)
  (setq STR (strcat "  X            " "  Y            " "  Z") ;_ strcat
   ) ;_ setq
   (write-line STR F1)
) ;_ write-header


(defun WRITE-VERTICES (NEWVLIST / XSTR YSTR ZSTR STR)
(setq httt "0.2") 
(setq gptx (getpoint "\nBasepoint for X axis: "))
(setq gpty (getpoint "\nBasepoint for Y axis: "))

   (foreach ITEM NEWVLIST
      (setq XSTR (rtos (nth 0 ITEM) 2 3)
            YSTR (rtos (nth 1 ITEM) 2 3)
            ZSTR (rtos (nth 2 ITEM) 2 3)
            STR  (strcat XSTR (SPACES XSTR) YSTR (SPACES YSTR) ZSTR) ;_ strcat
      ) ; setq
;      (write-line STR F1)
 


(command "text" (list (+(atof xstr)(/ (atof httt) 2.0)) (cadr gptx)) httt "90" (strcat xstr))
(command "text" (list (+(atof xstr)(/ (atof httt) 2.0)) (cadr gpty)) httt "90" (strcat ystr))

   ) ; foreach

) ; write-vertices


(defun SPACES (STR / FIELD NUM CHAR SPACE)
   (setq FIELD 15
         NUM   (- FIELD (strlen STR))
         CHAR  " "
         SPACE ""
   ) ;_ setq
   (repeat NUM (setq SPACE (strcat SPACE CHAR))) ;_ repeat
) ;_ spaces

(defun C:prl () (SETTING) (VERTEXT) (RESETTING) (princ)) ; c:nsl

(prompt "\nwritten by Tariq and company")
(prompt "\nEnter PRL to start")

VV Lisp file Download 

The download link to VV lisp is given below. Feel free to share this post with your friends and colleagues.

If the above link is not working, please download it from the below link.


(defun ERR (S)
  (if (= S "Function cancelled")
    (princ "\nVERTEXT - cancelled: ")
    (progn (princ "\nVERTEXT - Error: ") (princ S) (terpri))
  )
  (RESETTING)
  (princ "SYSTEM VARIABLES have been reset\n")
  (princ)
)
(defun SETV (SYSTVAR NEWVAL)
  (setq X (read (strcat SYSTVAR "1")))
  (set X (getvar SYSTVAR))
  (setvar SYSTVAR NEWVAL)
)
(defun SETTING ()
  (setq OERR *ERROR*)
  (setq *ERROR* ERR)
  (SETV "CMDECHO" 0)
  (SETV "BLIPMODE" 0)
)
(defun RSETV (SYSTVAR)
  (setq X (read (strcat SYSTVAR "1")))
  (setvar SYSTVAR (eval X))
)

(defun RESETTING ()
  (RSETV "CMDECHO")
  (RSETV "BLIPMODE")
  (setq *ERROR* OERR)
)


(defun DXF (CODE ENAME) (cdr (assoc CODE (entget ENAME)))) ; dxf

(defun VERTEXT (/ EN VLIST)
  (setq EN (GET-EN))
  (if (= (DXF 0 EN) "LWPOLYLINE")
    (setq VLIST (GET-LWVLIST EN))
    (setq VLIST (GET-PLVLIST EN))
  )
  (WRITE-IT VLIST EN)
)

(defun GET-EN (/ NO-ENT EN MSG1 MSG2)
  (setq	NO-ENT 1
	EN     NIL
	MSG1   "\nSelect a polyline: "
	MSG2   "\nNo polyline selected, try again."
  )					; setq
  (while NO-ENT
    (setq EN (car (entsel MSG1)))
    (if	(and EN
	     (or (= (DXF 0 EN) "LWPOLYLINE") (= (DXF 0 EN) "POLYLINE"))
					; or
	)				; and
      (progn (setq NO-ENT NIL))		; progn
      (prompt MSG2)
    )					; if
  )					; while
  EN
)					; get-en

(defun GET-LWVLIST (EN / ELIST NUM-VERT VLIST)
  (setq	ELIST	 (entget EN)
	NUM-VERT (cdr (assoc 90 ELIST))
	ELIST	 (member (assoc 10 ELIST) ELIST)
	VLIST	 NIL
  )					; setq
  (repeat NUM-VERT
    (setq VLIST	(append VLIST (list (cdr (assoc 10 ELIST)))) ; append
    )					; setq
    (setq ELIST	(cdr ELIST)
	  ELIST	(member (assoc 10 ELIST) ELIST)
    )					; setq
  )					; repeat
  VLIST
)					; get-lwvlist

(defun GET-PLVLIST (EN / VLIST)
  (setq	VLIST NIL
	EN    (entnext EN)
  )					; setq
  (while (/= "SEQEND" (DXF 0 EN))
    (setq VLIST (append VLIST (list (DXF 10 EN))))
    (setq EN (entnext EN))
  )					; while
  VLIST
)					; get-plvlist

(defun WRITE-IT	(VLST EN / NEWVLIST MSG3 FNAME)
  (setq	NEWVLIST (mapcar '(lambda (X) (trans X EN 0)) ;_ lambda
			 VLST
		 ) ;_ mapcar
	MSG3	 "Polyline vertex file"
					;FNAME    (getfiled MSG3 "" "txt" 1)
	F1	 (open "FNAME" "w")
  )					; setq
  (WRITE-HEADER)
  (WRITE-VERTICES NEWVLIST)
  (setq F1 (close F1))
) ;_ write-it

(defun WRITE-HEADER (/ STR)
  (setq STR "        POLYLINE VERTEX POINTS")
  (write-line STR F1)
  (setq	STR (strcat "  X            " "  Y            " "  Z") ;_ strcat
  ) ;_ setq
  (write-line STR F1)
) ;_ write-header


(defun WRITE-VERTICES (NEWVLIST / XSTR YSTR ZSTR STR)
  (setq httt "0.670")
  (setq gptx (getpoint "\nBasepoint for X axis: "))
  (setq gpty (getpoint "\nBasepoint for Y axis: "))

  (foreach ITEM	NEWVLIST
    (setq XSTR (rtos (nth 0 ITEM) 2 3)
	  YSTR (rtos (nth 1 ITEM) 2 3)
	  ZSTR (rtos (nth 2 ITEM) 2 3)
	  STR  (strcat XSTR (SPACES XSTR) YSTR (SPACES YSTR) ZSTR) ;_ strcat
    )					; setq
					;      (write-line STR F1)



    (command "text"
	     (list (+ (atof xstr) (/ (atof httt) 2.0)) (cadr gptx))
	     httt
	     "90"
	     (strcat xstr)
    )
    (command "text"
	     (list (+ (atof xstr) (/ (atof httt) 2.0)) (cadr gpty))
	     httt
	     "90"
	     (strcat ystr)
    )

  )					; foreach

)					; write-vertices


(defun SPACES (STR / FIELD NUM CHAR SPACE)
  (setq	FIELD 15
	NUM   (- FIELD (strlen STR))
	CHAR  " "
	SPACE ""
  ) ;_ setq
  (repeat NUM (setq SPACE (strcat SPACE CHAR))) ;_ repeat
) ;_ spaces

(defun C:vv () (SETTING) (VERTEXT) (RESETTING) (princ)) ; c:nsl

(prompt "\nwritten by Mr. Muhammad Javed & Muhammad Ali")
(prompt "\Download From https://freecadtipsandtricks.com/")
(prompt "\nEnter VV to start")

Here Are Some Related Posts

Stairs and Outdoor Design sample AutoCAD drawings and CAD blocks

100+ Cad blocks Sports and Gym equipment dwg AutoCAD drawing Free Download

Scroll to Top