;eqpt.lsp
;routine to insert text for signal equipment
;--------------------------------------------------------------------------------------------
;a10 multi-use pole - 
(defun a10pol ()
  (setq a10pol-e (ssget "x" (list (cons 2 "stb201"))));get list of exist poles
  (setq a10pol-p (ssget "x" (list (cons 2 "stb202"))));get list of prop poles
  (setq a10txt (strcat "traffic signal pole  type" " " "'a10'" " " "-" " " ));make text string
  (if a10pol-e
    (progn
      (setq a10_no1 (sslength a10pol-e));get number of poles
      (setq a10txt-e (strcat "  "(itoa a10_no1)" " "exist"));txt str no of poles
  ));end progn, end if
  (if a10pol-p
    (progn			 
      (setq a10_no2 (sslength a10pol-p));get number of poles
      (setq a10txt-p (strcat "  "(itoa a10_no2) " " "new"));txt str no of poles	 
  ));end progn, end if
  (if (and a10_no2 a10_no1);if prop & existing
    (progn
      (setq txt (strcat a10txt a10txt-p a10txt-e));combine txt
      (command "-insert" "stb128" pt1 "" "" "" num);insert hex symbol
      (command "text" "ml" pt2 "3" "0.0" txt);insert text
  ));end progn, if
  (if (and a10_no2 (not a10_no1));if prop & not existing
    (progn
      (setq txt (strcat a10txt a10txt-p));combine txt
      (command "-insert" "stb128" pt1 "" "" "" num);insert hex symbol
      (command "text" "ml" pt2 "3" "0.0" txt);insert text
  ));end progn, if
  (if (and a10_no1 (not a10_no2));if exist & not prop
    (progn
      (setq txt (strcat a10txt a10txt-e));combine txt
      (command "-insert" "stb125" pt1 "" "" "" num);insert hex symbol
      (command "text" "ml" pt2 "3" "0.0" txt);insert text
  ));end progn, if
  (if (or a10_no2 a10_no1)
    (setq num (+ num 1);reset number
	py1  (- py1 10);adjust for next line
	pt1 (strcat (rtos px) "," (rtos py1));reset insert point
	pt2 (strcat (rtos px1) "," (rtos py1));reset insert point
    );end setq
  );end if  
(setq a10pol-e nil);close selection set
(setq a10pol-p nil);close selection set
);end a10pol
;--------------------------------------------------------------------------------------------
;special (or spec ) pole - used to in place of the r pole
(defun spol ()
  (setq spol-e (ssget "x" (list (cons 2 "stb165"))));get list of exist poles
  (setq spol-p (ssget "x" (list (cons 2 "stb166"))));get list of prop poles
  (setq stxt (strcat "traffic signal pole  type" " " "'spec'" " " "-" " " ));make text string
  (if spol-e
    (progn
      (setq s_no1 (sslength spol-e));get number of poles
      (setq stxt-e (strcat "  "(itoa s_no1)" " "exist"));txt str no of poles
  ));end progn, end if
  (if spol-p
    (progn			 
      (setq s_no2 (sslength spol-p));get number of poles
      (setq stxt-p (strcat "  "(itoa s_no2) " " "new"));txt str no of poles	 
  ));end progn, end if
  (if (and s_no2 s_no1);if prop & existing
    (progn
      (setq txt (strcat stxt stxt-p stxt-e));combine txt
      (command "-insert" "stb128" pt1 "" "" "" num);insert hex symbol
      (command "text" "ml" pt2 "3" "0.0" txt);insert text
  ));end progn, if
  (if (and s_no2 (not s_no1));if prop & not existing
    (progn
      (setq txt (strcat stxt stxt-p));combine txt
      (command "-insert" "stb128" pt1 "" "" "" num);insert hex symbol
      (command "text" "ml" pt2 "3" "0.0" txt);insert text
  ));end progn, if
  (if (and s_no1 (not s_no2));if exist & not prop
    (progn
      (setq txt (strcat stxt stxt-e));combine txt
      (command "-insert" "stb125" pt1 "" "" "" num);insert hex symbol
      (command "text" "ml" pt2 "3" "0.0" txt);insert text
  ));end progn, if
  (if (or s_no2 s_no1)
    (setq num (+ num 1);reset number
	py1  (- py1 10);adjust for next line
	pt1 (strcat (rtos px) "," (rtos py1));reset insert point
	pt2 (strcat (rtos px1) "," (rtos py1));reset insert point
    );end setq
  )end if  
(setq spol-e nil);close selection set
(setq spol-p nil);close selection set
);end spol
;--------------------------------------------------------------------------------------------
;adot designated pole - 3' x 10' foundation.  can support up to a 55' ma
(defun rpol ()
  (setq rpol-e (ssget "x" (list (cons 2 "stb163"))));get list of exist poles
  (setq rpol-p (ssget "x" (list (cons 2 "stb164"))));get list of prop poles
  (setq rtxt (strcat "traffic signal pole  type" " " "'r'" " " "-" " " ));make text string
  (if rpol-e
    (progn
      (setq r_no1 (sslength rpol-e));get number of poles
      (setq rtxt-e (strcat "  "(itoa r_no1)" " "exist"));txt str no of poles
  ));end progn, end if
  (if rpol-p
    (progn			 
      (setq r_no2 (sslength rpol-p));get number of poles
      (setq rtxt-p (strcat "  "(itoa r_no2) " " "new"));txt str no of poles	 
  ));end progn, end if
  (if (and r_no2 r_no1);if prop & existing
    (progn
      (setq txt (strcat rtxt rtxt-p rtxt-e));combine txt
      (command "-insert" "stb128" pt1 "" "" "" num);insert hex symbol
      (command "text" "ml" pt2 "3" "0.0" txt);insert text
  ));end progn, if
  (if (and r_no2 (not r_no1));if prop & not existing
    (progn
      (setq txt (strcat rtxt rtxt-p));combine txt
      (command "-insert" "stb128" pt1 "" "" "" num);insert hex symbol
      (command "text" "ml" pt2 "3" "0.0" txt);insert text
  ));end progn, if
  (if (and r_no1 (not r_no2));if exist & not prop
    (progn
      (setq txt (strcat rtxt rtxt-e));combine txt
      (command "-insert" "stb125" pt1 "" "" "" num);insert hex symbol
      (command "text" "ml" pt2 "3" "0.0" txt);insert text
  ));end progn, if
  (if (or r_no2 r_no1)
    (setq num (+ num 1);reset number
	py1  (- py1 10);adjust for next line
	pt1 (strcat (rtos px) "," (rtos py1));reset insert point
	pt2 (strcat (rtos px1) "," (rtos py1));reset insert point
    );end setq
  );end if  
(setq rpol-e nil);close selection set
(setq rpol-p nil);close selection set
);end rpol
;--------------------------------------------------------------------------------------------
;standard multi-use pole
(defun mupol ()
  (setq mupol-e (ssget "x" (list (cons 2 "stb052"))));get list of exist poles
  (setq mupol-p (ssget "x" (list (cons 2 "stb024"))));get list of prop poles
  (setq mutxt (strcat "traffic signal pole  type" " " "'mu'" " " "-" " " ));make text string
  (if mupol-e
    (progn
      (setq mu_no1 (sslength mupol-e));get number of poles
      (setq mutxt-e (strcat "  "(itoa mu_no1)" " "exist"));txt str no of poles
  ));end progn, end if
  (if mupol-p
    (progn			 
      (setq mu_no2 (sslength mupol-p));get number of poles
      (setq mutxt-p (strcat "  "(itoa mu_no2) " " "new"));txt str no of poles	 
  ));end progn, end if
  (if (and mu_no2 mu_no1);if prop & existing
    (progn
      (setq txt (strcat mutxt mutxt-p mutxt-e));combine txt
      (command "-insert" "stb128" pt1 "" "" "" num);insert hex symbol
      (command "text" "ml" pt2 "3" "0.0" txt);insert text
  ));end progn, if
  (if (and mu_no2 (not mu_no1));if prop & not existing
    (progn
      (setq txt (strcat mutxt mutxt-p));combine txt
      (command "-insert" "stb128" pt1 "" "" "" num);insert hex symbol
      (command "text" "ml" pt2 "3" "0.0" txt);insert text
  ));end progn, if
  (if (and mu_no1 (not mu_no2));if exist & not prop
    (progn
      (setq txt (strcat mutxt mutxt-e));combine txt
      (command "-insert" "stb125" pt1 "" "" "" num);insert hex symbol
      (command "text" "ml" pt2 "3" "0.0" txt);insert text
  ));end progn, if
  (if (or mu_no2 mu_no1)
    (setq num (+ num 1);reset number
	py1  (- py1 10);adjust for next line
	pt1 (strcat (rtos px) "," (rtos py1));reset insert point
	pt2 (strcat (rtos px1) "," (rtos py1));reset insert point
    );end setq
  );end if
(setq mupol-e nil);close selection set
(setq mupol-p nil);close selection set
);end mupol
;--------------------------------------------------------------------------------------------
;standard m pole
(defun mpol ()
  (setq mpol-e (ssget "x" (list (cons 2 "stb051"))));get list of exist poles
  (setq mpol-p (ssget "x" (list (cons 2 "stb023"))));get list of prop poles
  (setq mtxt (strcat "traffic signal pole  type" " " "'m'" " " "-" " " ));make text string
  (if mpol-e
    (progn
      (setq m_no1 (sslength mpol-e));get number of poles
      (setq mtxt-e (strcat "  "(itoa m_no1)" " "exist"));txt str no of poles
  ));end progn, end if
  (if mpol-p
    (progn			 
      (setq m_no2 (sslength mpol-p));get number of poles
      (setq mtxt-p (strcat "  "(itoa m_no2) " " "new"));txt str no of poles	 
  ));end progn, end if
  (if (and m_no2 a_no1);if prop & existing
    (progn
      (setq txt (strcat mtxt mtxt-p mtxt-e));combine txt
      (command "-insert" "stb128" pt1 "" "" "" num);insert hex symbol
      (command "text" "ml" pt2 "3" "0.0" txt);insert text
  ));end progn, if
  (if (and m_no2 (not m_no1));if prop & not existing
    (progn
      (setq txt (strcat mtxt mtxt-p));combine txt
      (command "-insert" "stb128" pt1 "" "" "" num);insert hex symbol
      (command "text" "ml" pt2 "3" "0.0" txt);insert text
  ));end progn, if
  (if (and m_no1 (not m_no2));if exist & not prop
    (progn
      (setq txt (strcat mtxt mtxt-e));combine txt

     
      (command "-insert" "stb125" pt1 "" "" "" num);insert hex symbol
      (command "text" "ml" pt2 "3" "0.0" txt);insert text
  ));end progn, if
  (if (or m_no2 m_no1)
    (setq num (+ num 1);reset number
	py1  (- py1 10);adjust for next line
	pt1 (strcat (rtos px) "," (rtos py1));reset insert point
	pt2 (strcat (rtos px1) "," (rtos py1));reset insert point
    );end setq
  );end if  
(setq mpol-e nil);close selection set
(setq mpol-p nil);close selection set
);end mpol
;--------------------------------------------------------------------------------------------
;standard a pole
(defun apol ()
  (setq apol-e (ssget "x" (list (cons 2 "stb162"))));get list of exist poles
  (setq apol-p (ssget "x" (list (cons 2 "stb161"))));get list of prop poles
  (setq atxt (strcat "traffic signal pole  type" " " "'a'" " " "-" " " ));make text string
  (if apol-e
    (progn
      (setq a_no1 (sslength apol-e));get number of poles
      (setq atxt-e (strcat "  "(itoa a_no1)" " "exist"));txt str no of poles
  ));end progn, end if
  (if apol-p
    (progn			 
      (setq a_no2 (sslength apol-p));get number of poles
      (setq atxt-p (strcat "  "(itoa a_no2) " " "new"));txt str no of poles	 
  ));end progn, end if
  (if (and a_no2 a_no1);if prop & existing
    (progn
      (setq txt (strcat atxt atxt-p atxt-e));combine txt
      (command "-insert" "stb128" pt1 "" "" "" num);insert hex symbol
      (command "text" "ml" pt2 "3" "0.0" txt);insert text
  ));end progn, if
  (if (and a_no2 (not a_no1));if prop & not existing
    (progn
      (command "-insert" "stb128" pt1 "" "" "" num);insert hex symbol
      (command "text" "ml" pt2 "3" "0.0" atxt atxp-p);insert text
  ));end progn, if
  (if (and a_no1 (not a_no2));if exist & not prop
    (progn
      (command "-insert" "stb125" pt1 "" "" "" num);insert hex symbol
      (command "text" "ml" pt2 "3" "0.0" atxt atxt-e);insert text
  ));end progn, if
  (if (or a_no2 a_no1)
    (setq num (+ num 1);reset number
	py1  (- py1 10);adjust for next line
	pt1 (strcat (rtos px) "," (rtos py1));reset insert point
	pt2 (strcat (rtos px1) "," (rtos py1));reset insert point
    );end setq
  );end if  
(setq apol-e nil);close selection set
(setq apol-p nil);close selection set
);end apol
;
;--------------------------------------------------------------------------------------------
(defun 55ma ()
  (setq 55ma-e (ssget "x" (list (cons 2 "stb064"))));get list of exist mast arms
  (setq 55ma-p (ssget "x" (list (cons 2 "stb033"))));get list of prop mast arms
  (setq 55matxt (strcat "55 ft signal mast arm" " " "-" " " ));make text string
  (if 55ma-e
    (progn
      (setq 55ma_no1 (sslength 55ma-e));get number of mast arms
      (setq 55matxt-e (strcat "  "(itoa 55ma_no1)" " "exist"));txt str no mast arms
  ));end progn, end if
  (if 55ma-p
    (progn			 
      (setq 55ma_no2 (sslength 55ma-p));get number of mast arms
      (setq 55matxt-p (strcat "  "(itoa 55ma_no2) " " "new"));txt str no mast arms	 
  ));end progn, end if
  (if (and 55ma_no2 55ma_no1);if prop & existing
    (progn
      (setq txt (strcat 55matxt 55matxt-p 55matxt-e));combine txt
      (command "-insert" "stb128" pt1 "" "" "" num);insert hex symbol
      (command "text" "ml" pt2 "3" "0.0" txt);insert text
  ));end progn, if
  (if (and 55ma_no2 (not 55ma_no1));if prop & not existing
    (progn
      (command "-insert" "stb128" pt1 "" "" "" num);insert hex symbol
      (command "text" "ml" pt2 "3" "0.0" atxt atxp-p);insert text
  ));end progn, if
  (if (and 55ma_no1 (not 55ma_no2));if exist & not prop
    (progn
      (command "-insert" "stb125" pt1 "" "" "" num);insert hex symbol
      (command "text" "ml" pt2 "3" "0.0" atxt atxt-e);insert text
  ));end progn, if
  (if (or 55ma_no2 55ma_no1)
    (setq num (+ num 1);reset number
	py1  (- py1 10);adjust for next line
	pt1 (strcat (rtos px) "," (rtos py1));reset insert point
	pt2 (strcat (rtos px1) "," (rtos py1));reset insert point
    );end setq
  );end if  
(setq 55ma-e nil);close selection set
(setq 55ma-p nil);close selection set
);end 55ma
;
;-------------------------------------------------------------------------------------------- 
(defun 50ma ()
  (setq 50ma-e (ssget "x" (list (cons 2 "stb063"))));get list of exist mast arms
  (setq 50ma-p (ssget "x" (list (cons 2 "stb032"))));get list of prop mast arms
  (setq 50matxt (strcat "50 ft signal mast arm" " " "-" " " ));make text string
  (if 50ma-e
    (progn
      (setq 50ma_no1 (sslength 50ma-e));get number of mast arms
      (setq 50matxt-e (strcat "  "(itoa 50ma_no1)" " "exist"));txt str no of mast arms
  ));end progn, end if
  (if 50ma-p
    (progn			 
      (setq 50ma_no2 (sslength 50ma-p));get number of mast arms
      (setq 50matxt-p (strcat "  "(itoa 50ma_no2) " " "new"));txt str no of mast arms	 
  ));end progn, end if
  (if (and 50ma_no2 50ma_no1);if prop & existing
    (progn
      (setq txt (strcat 50matxt 50matxt-p 50matxt-e));combine txt
      (command "-insert" "stb128" pt1 "" "" "" num);insert hex symbol
      (command "text" "ml" pt2 "3" "0.0" txt);insert text
  ));end progn, if
  (if (and 50ma_no2 (not 50ma_no1));if prop & not existing
    (progn
      (command "-insert" "stb128" pt1 "" "" "" num);insert hex symbol
      (command "text" "ml" pt2 "3" "0.0" atxt atxp-p);insert text
  ));end progn, if
  (if (and 50ma_no1 (not 50ma_no2));if exist & not prop
    (progn
      (command "-insert" "stb125" pt1 "" "" "" num);insert hex symbol
      (command "text" "ml" pt2 "3" "0.0" atxt atxt-e);insert text
  ));end progn, if
  (if (or 50ma_no2 50ma_no1)
    (setq num (+ num 1);reset number
	py1  (- py1 10);adjust for next line
	pt1 (strcat (rtos px) "," (rtos py1));reset insert point
	pt2 (strcat (rtos px1) "," (rtos py1));reset insert point
    );end setq
  );end if  
(setq 50ma-e nil);close selection set
(setq 50ma-p nil);close selection set
);end 50ma
;
;--------------------------------------------------------------------------------------------
(defun 45ma ()
  (setq 45ma-e (ssget "x" (list (cons 2 "stb062"))));get list of exist mast arms
  (setq 45ma-p (ssget "x" (list (cons 2 "stb031"))));get list of prop mast arms
  (setq 45matxt (strcat "45 ft signal mast arm" " " "-" " " ));make text string
  (if 45ma-e
    (progn
      (setq 45ma_no1 (sslength 45ma-e));get number of mast arms
      (setq 45matxt-e (strcat "  "(itoa 45ma_no1)" " "exist"));txt str no of mast arms
  ));end progn, end if
  (if 45ma-p
    (progn			 
      (setq 45ma_no2 (sslength 45ma-p));get number of a poles
      (setq 45matxt-p (strcat "  "(itoa 45ma_no2) " " "new"));txt str no of poles	 
  ));end progn, end if
  (if (and 45ma_no2 45ma_no1);if prop & existing
    (progn
      (setq txt (strcat 45matxt 45matxt-p 45matxt-e));combine txt
      (command "-insert" "stb128" pt1 "" "" "" num);insert hex symbol
      (command "text" "ml" pt2 "3" "0.0" txt);insert text
  ));end progn, if
  (if (and 45ma_no2 (not 45ma_no1));if prop & not existing
    (progn
      (command "-insert" "stb128" pt1 "" "" "" num);insert hex symbol
      (command "text" "ml" pt2 "3" "0.0" atxt atxp-p);insert text
  ));end progn, if
  (if (and 45ma_no1 (not 45ma_no2));if exist & not prop
    (progn
      (command "-insert" "stb125" pt1 "" "" "" num);insert hex symbol
      (command "text" "ml" pt2 "3" "0.0" atxt atxt-e);insert text
  ));end progn, if
  (if (or 45ma_no2 45ma_no1)
    (setq num (+ num 1);reset number
	py1  (- py1 10);adjust for next line
	pt1 (strcat (rtos px) "," (rtos py1));reset insert point
	pt2 (strcat (rtos px1) "," (rtos py1));reset insert point
    );end setq
  );end if  
(setq 45ma-e nil);close selection set
(setq 45ma-p nil);close selection set
);end 45ma
;
;--------------------------------------------------------------------------------------------
(defun 40ma ()
  (setq 40ma-e (ssget "x" (list (cons 2 "stb061"))));get list of exist a poles
  (setq 40ma-p (ssget "x" (list (cons 2 "stb030"))));get list of prop a poles
  (setq 40matxt (strcat "40 ft signal mast arm" " " "-" " " ));make text string
  (if 40ma-e
    (progn
      (setq 40ma_no1 (sslength 40ma-e));get number of a poles
      (setq 40matxt-e (strcat "  "(itoa 40ma_no1)" " "exist"));txt str no of poles
  ));end progn, end if
  (if 40ma-p
    (progn			 
      (setq 40ma_no2 (sslength 40ma-p));get number of a poles
      (setq 40matxt-p (strcat "  "(itoa 40ma_no2) " " "new"));txt str no of poles	 
  ));end progn, end if
  (if (and 40ma_no2 40ma_no1);if prop & existing
    (progn
      (setq txt (strcat 40matxt 40matxt-p 40matxt-e));combine txt
      (command "-insert" "stb128" pt1 "" "" "" num);insert hex symbol
      (command "text" "ml" pt2 "3" "0.0" txt);insert text
  ));end progn, if
  (if (and 40ma_no2 (not 40ma_no1));if prop & not existing
    (progn
      (command "-insert" "stb128" pt1 "" "" "" num);insert hex symbol
      (command "text" "ml" pt2 "3" "0.0" atxt atxp-p);insert text
  ));end progn, if
  (if (and 40ma_no1 (not 40ma_no2));if exist & not prop
    (progn
      (command "-insert" "stb125" pt1 "" "" "" num);insert hex symbol
      (command "text" "ml" pt2 "3" "0.0" atxt atxt-e);insert text
  ));end progn, if
  (if (or 40ma_no2 40ma_no1)
    (setq num (+ num 1);reset number
	py1  (- py1 10);adjust for next line
	pt1 (strcat (rtos px) "," (rtos py1));reset insert point
	pt2 (strcat (rtos px1) "," (rtos py1));reset insert point
    );end setq
  );end if  
(setq 40ma-e nil);close selection set
(setq 40ma-p nil);close selection set
);end 40ma
;
;--------------------------------------------------------------------------------------------
(defun 35ma ()
  (setq 35ma-e (ssget "x" (list (cons 2 "stb060"))));get list of exist a poles
  (setq 35ma-p (ssget "x" (list (cons 2 "stb029"))));get list of prop a poles
  (setq 35matxt (strcat "35 ft signal mast arm" " " "-" " " ));make text string
  (if 35ma-e
    (progn
      (setq 35ma_no1 (sslength 35ma-e));get number of a poles
      (setq 35matxt-e (strcat "  "(itoa 35ma_no1)" " "exist"));txt str no of poles
  ));end progn, end if
  (if 35ma-p
    (progn			 
      (setq 35ma_no2 (sslength 35ma-p));get number of a poles
      (setq 35matxt-p (strcat "  "(itoa 35ma_no2) " " "new"));txt str no of poles	 
  ));end progn, end if
  (if (and 35ma_no2 35ma_no1);if prop & existing
    (progn
      (setq txt (strcat 35matxt 35matxt-p 35matxt-e));combine txt
      (command "-insert" "stb128" pt1 "" "" "" num);insert hex symbol
      (command "text" "ml" pt2 "3" "0.0" txt);insert text
  ));end progn, if
  (if (and 35ma_no2 (not 35ma_no1));if prop & not existing
    (progn
      (command "-insert" "stb128" pt1 "" "" "" num);insert hex symbol
      (command "text" "ml" pt2 "3" "0.0" atxt atxp-p);insert text
  ));end progn, if
  (if (and 35ma_no1 (not 35ma_no2));if exist & not prop
    (progn
      (command "-insert" "stb125" pt1 "" "" "" num);insert hex symbol
      (command "text" "ml" pt2 "3" "0.0" atxt atxt-e);insert text
  ));end progn, if
  (if (or 35ma_no2 35ma_no1)
    (setq num (+ num 1);reset number
	py1  (- py1 10);adjust for next line
	pt1 (strcat (rtos px) "," (rtos py1));reset insert point
	pt2 (strcat (rtos px1) "," (rtos py1));reset insert point
    );end setq
  );end if  
(setq 35ma-e nil);close selection set
(setq 35ma-p nil);close selection set
);end 35ma
;
;--------------------------------------------------------------------------------------------
(defun 30ma ()
  (setq 30ma-e (ssget "x" (list (cons 2 "stb059"))));get list of exist a poles
  (setq 30ma-p (ssget "x" (list (cons 2 "stb028"))));get list of prop a poles
  (setq 30matxt (strcat "30 ft signal mast arm" " " "-" " " ));make text string
  (if 30ma-e
    (progn
      (setq 30ma_no1 (sslength 30ma-e));get number of a poles
      (setq 30matxt-e (strcat "  "(itoa 30ma_no1)" " "exist"));txt str no of poles
  ));end progn, end if
  (if 30ma-p
    (progn			 
      (setq 30ma_no2 (sslength 30ma-p));get number of a poles
      (setq 30matxt-p (strcat "  "(itoa 30ma_no2) " " "new"));txt str no of poles	 
  ));end progn, end if
  (if (and 30ma_no2 30ma_no1);if prop & existing
    (progn
      (setq txt (strcat 30matxt 30matxt-p 35matxt-e));combine txt
      (command "-insert" "stb128" pt1 "" "" "" num);insert hex symbol
      (command "text" "ml" pt2 "3" "0.0" txt);insert text
  ));end progn, if
  (if (and 30ma_no2 (not 30ma_no1));if prop & not existing
    (progn
      (command "-insert" "stb128" pt1 "" "" "" num);insert hex symbol
      (command "text" "ml" pt2 "3" "0.0" atxt atxp-p);insert text
  ));end progn, if
  (if (and 30ma_no1 (not 30ma_no2));if exist & not prop
    (progn
      (command "-insert" "stb125" pt1 "" "" "" num);insert hex symbol
      (command "text" "ml" pt2 "3" "0.0" atxt atxt-e);insert text
  ));end progn, if
  (if (or 30ma_no2 30ma_no1)
    (setq num (+ num 1);reset number
	py1  (- py1 10);adjust for next line
	pt1 (strcat (rtos px) "," (rtos py1));reset insert point
	pt2 (strcat (rtos px1) "," (rtos py1));reset insert point
    );end setq
  );end if  
(setq 30ma-e nil);close selection set
(setq 30ma-p nil);close selection set
);end 30ma
;
;--------------------------------------------------------------------------------------------
(defun 25ma ()
  (setq 25ma-e (ssget "x" (list (cons 2 "stb058"))));get list of exist a poles
  (setq 25ma-p (ssget "x" (list (cons 2 "stb027"))));get list of prop a poles
  (setq 25matxt (strcat "25 ft signal mast arm" " " "-" " " ));make text string
  (if 25ma-e
    (progn
      (setq 25ma_no1 (sslength 25ma-e));get number of a poles
      (setq 25matxt-e (strcat "  "(itoa 25ma_no1)" " "exist"));txt str no of poles
  ));end progn, end if
  (if 25ma-p
    (progn			 
      (setq 25ma_no2 (sslength 25ma-p));get number of a poles
      (setq 25matxt-p (strcat "  "(itoa 25ma_no2) " " "new"));txt str no of poles	 
  ));end progn, end if
  (if (and 25ma_no2 25ma_no1);if prop & existing
    (progn
      (setq txt (strcat 25matxt 25matxt-p 25matxt-e));combine txt
      (command "-insert" "stb128" pt1 "" "" "" num);insert hex symbol
      (command "text" "ml" pt2 "3" "0.0" txt);insert text
  ));end progn, if
  (if (and 25ma_no2 (not 25ma_no1));if prop & not existing
    (progn
      (command "-insert" "stb128" pt1 "" "" "" num);insert hex symbol
      (command "text" "ml" pt2 "3" "0.0" atxt atxp-p);insert text
  ));end progn, if
  (if (and 25ma_no1 (not 25ma_no2));if exist & not prop
    (progn
      (command "-insert" "stb125" pt1 "" "" "" num);insert hex symbol
      (command "text" "ml" pt2 "3" "0.0" atxt atxt-e);insert text
  ));end progn, if
  (if (or 25ma_no2 25ma_no1)
    (setq num (+ num 1);reset number
	py1  (- py1 10);adjust for next line
	pt1 (strcat (rtos px) "," (rtos py1));reset insert point
	pt2 (strcat (rtos px1) "," (rtos py1));reset insert point
    );end setq
  );end if  
(setq 25ma-e nil);close selection set
(setq 25ma-p nil);close selection set
);end 25ma
;
;--------------------------------------------------------------------------------------------
(defun 20ma ()
  (setq 20ma-e (ssget "x" (list (cons 2 "stb057"))));get list of exist a poles
  (setq 20ma-p (ssget "x" (list (cons 2 "stb026"))));get list of prop a poles
  (setq 20matxt (strcat "20 ft signal mast arm" " " "-" " " ));make text string
  (if 20ma-e
    (progn
      (setq 20ma_no1 (sslength 20ma-e));get number of a poles
      (setq 20matxt-e (strcat "  "(itoa 20ma_no1)" " "exist"));txt str no of poles
  ));end progn, end if
  (if 20ma-p
    (progn			 
      (setq 20ma_no2 (sslength 20ma-p));get number of a poles
      (setq 20matxt-p (strcat "  "(itoa 20ma_no2) " " "new"));txt str no of poles	 
  ));end progn, end if
  (if (and 20ma_no2 20ma_no1);if prop & existing
    (progn
      (setq txt (strcat 20matxt 20matxt-p 20matxt-e));combine txt
      (command "-insert" "stb128" pt1 "" "" "" num);insert hex symbol
      (command "text" "ml" pt2 "3" "0.0" txt);insert text
  ));end progn, if
  (if (and 20ma_no2 (not 20ma_no1));if prop & not existing
    (progn
      (command "-insert" "stb128" pt1 "" "" "" num);insert hex symbol
      (command "text" "ml" pt2 "3" "0.0" atxt atxp-p);insert text
  ));end progn, if
  (if (and 20ma_no1 (not 20ma_no2));if exist & not prop
    (progn
      (command "-insert" "stb125" pt1 "" "" "" num);insert hex symbol
      (command "text" "ml" pt2 "3" "0.0" atxt atxt-e);insert text
  ));end progn, if
  (if (or 20ma_no2 20ma_no1)
    (setq num (+ num 1);reset number
	py1  (- py1 10);adjust for next line
	pt1 (strcat (rtos px) "," (rtos py1));reset insert point
	pt2 (strcat (rtos px1) "," (rtos py1));reset insert point
    );end setq
  );end if  
(setq 20ma-e nil);close selection set
(setq 20ma-p nil);close selection set
);end 20ma
;
;--------------------------------------------------------------------------------------------
(defun 15ma ()
  (setq 15ma-e (ssget "x" (list (cons 2 "stb056"))));get list of exist a poles
  (setq 15ma-p (ssget "x" (list (cons 2 "stb025"))));get list of prop a poles
  (setq 15matxt (strcat "15 ft signal mast arm" " " "-" " " ));make text string
  (if 15ma-e
    (progn
      (setq 15ma_no1 (sslength 15ma-e));get number of a poles
      (setq 15matxt-e (strcat "  "(itoa 15ma_no1)" " "exist"));txt str no of poles
  ));end progn, end if
  (if 15ma-p
    (progn			 
      (setq 15ma_no2 (sslength 15ma-p));get number of a poles
      (setq 15matxt-p (strcat "  "(itoa 15ma_no2) " " "new"));txt str no of poles	 
  ));end progn, end if
  (if (and 15ma_no2 15ma_no1);if prop & existing
    (progn
      (setq txt (strcat 15matxt 15matxt-p 15matxt-e));combine txt
      (command "-insert" "stb128" pt1 "" "" "" num);insert hex symbol
      (command "text" "ml" pt2 "3" "0.0" txt);insert text
  ));end progn, if
  (if (and 15ma_no2 (not 15ma_no1));if prop & not existing
    (progn
      (command "-insert" "stb128" pt1 "" "" "" num);insert hex symbol
      (command "text" "ml" pt2 "3" "0.0" atxt atxp-p);insert text
  ));end progn, if
  (if (and 15ma_no1 (not 15ma_no2));if exist & not prop
    (progn
      (command "-insert" "stb125" pt1 "" "" "" num);insert hex symbol
      (command "text" "ml" pt2 "3" "0.0" atxt atxt-e);insert text
  ));end progn, if
  (if (or 15ma_no2 15ma_no1)
    (setq num (+ num 1);reset number
	py1  (- py1 10);adjust for next line
	pt1 (strcat (rtos px) "," (rtos py1));reset insert point
	pt2 (strcat (rtos px1) "," (rtos py1));reset insert point
    );end setq
  );end if  
(setq 15ma-e nil);close selection set
(setq 15ma-p nil);close selection set
);end 15ma
;
;--------------------------------------------------------------------------------------------
(defun 8sh ()
  (setq 8sh-e (ssget "x" (list (cons 2 "stb167"))));get list of exist a poles
  (setq 8sh-p (ssget "x" (list (cons 2 "stb168"))));get list of prop a poles
  (setq 8shtxt (strcat "8in signal head" " " "-" " " ));make text string
  (if 8sh-e
    (progn
      (setq 8sh_no1 (sslength 8sh-e));get number of a poles
      (setq 8shtxt-e (strcat "  "(itoa 8sh_no1)" " "exist"));txt str no of poles
  ));end progn, end if
  (if 8sh-p
    (progn			 
      (setq 8sh_no2 (sslength 8sh-p));get number of a poles
      (setq 8shtxt-p (strcat "  "(itoa 8sh_no2) " " "new"));txt str no of poles	 
  ));end progn, end if
  (if (and 8sh_no2 8sh_no1);if prop & existing
    (progn
      (setq txt (strcat 8shtxt 8shtxt-p 8shtxt-e));combine txt
      (command "-insert" "stb128" pt1 "" "" "" num);insert hex symbol
      (command "text" "ml" pt2 "3" "0.0" txt);insert text
  ));end progn, if
  (if (and 8sh_no2 (not 8sh_no1));if prop & not existing
    (progn
      (command "-insert" "stb128" pt1 "" "" "" num);insert hex symbol
      (command "text" "ml" pt2 "3" "0.0" atxt atxp-p);insert text
  ));end progn, if
  (if (and 8sh_no1 (not 8sh_no2));if exist & not prop
    (progn
      (command "-insert" "stb125" pt1 "" "" "" num);insert hex symbol
      (command "text" "ml" pt2 "3" "0.0" atxt atxt-e);insert text
  ));end progn, if
  (if (or 8sh_no2 8sh_no1)
    (setq num (+ num 1);reset number
	py1  (- py1 10);adjust for next line
	pt1 (strcat (rtos px) "," (rtos py1));reset insert point
	pt2 (strcat (rtos px1) "," (rtos py1));reset insert point
    );end setq
  );end if  
(setq 8sh-e nil);close selection set
(setq 8sh-p nil);close selection set
);end 8sh
;
;--------------------------------------------------------------------------------------------
(defun 12sh ()
  (setq 12sh-e (ssget "x" (list (cons 2 "stb053"))));get list of exist a poles
  (setq 12sh-p (ssget "x" (list (cons 2 "stb034"))));get list of prop a poles
  (setq 12shtxt (strcat "12in signal head" " " "-" " " ));make text string
  (if 12sh-e
    (progn
      (setq 12sh_no1 (sslength 12sh-e));get number of a poles
      (setq 12shtxt-e (strcat "  "(itoa 12sh_no1)" " "exist"));txt str no of poles
  ));end progn, end if
  (if 12sh-p
    (progn			 
      (setq 12sh_no2 (sslength 12sh-p));get number of a poles
      (setq 12shtxt-p (strcat "  "(itoa 12sh_no2) " " "new"));txt str no of poles	 
  ));end progn, end if
  (if (and 12sh_no2 12sh_no1);if prop & existing
    (progn
      (setq txt (strcat 12shtxt 12shtxt-p 12shtxt-e));combine txt
      (command "-insert" "stb128" pt1 "" "" "" num);insert hex symbol
      (command "text" "ml" pt2 "3" "0.0" txt);insert text
  ));end progn, if
  (if (and 12sh_no2 (not 12sh_no1));if prop & not existing
    (progn
      (command "-insert" "stb128" pt1 "" "" "" num);insert hex symbol
      (command "text" "ml" pt2 "3" "0.0" atxt atxp-p);insert text
  ));end progn, if
  (if (and 12sh_no1 (not 12sh_no2));if exist & not prop
    (progn
      (command "-insert" "stb125" pt1 "" "" "" num);insert hex symbol
      (command "text" "ml" pt2 "3" "0.0" atxt atxt-e);insert text
  ));end progn, if
  (if (or 12sh_no2 12sh_no1)
    (setq num (+ num 1);reset number
	py1  (- py1 10);adjust for next line
	pt1 (strcat (rtos px) "," (rtos py1));reset insert point
	pt2 (strcat (rtos px1) "," (rtos py1));reset insert point
    );end setq
  );end if  
(setq 12sh-e nil);close selection set
(setq 12sh-p nil);close selection set
);end 12sh
;
;--------------------------------------------------------------------------------------------
(defun 5sltsh ()
  (setq 5sltsh-e (ssget "x" (list (cons 2 "stb054"))));get list of exist a poles
  (setq 5sltsh-p (ssget "x" (list (cons 2 "stb035"))));get list of prop a poles
  (setq 5sltshtxt (strcat "5 sect - left turn - 12in signal head" " " "-" " " ));make text string
  (if 5sltsh-e
    (progn
      (setq 5sltsh_no1 (sslength 5sltsh-e));get number of a poles
      (setq 5sltshtxt-e (strcat "  "(itoa 5sltsh_no1)" " "exist"));txt str no of poles
  ));end progn, end if
  (if 5sltsh-p
    (progn			 
      (setq 5sltsh_no2 (sslength 5sltsh-p));get number of a poles
      (setq 5sltshtxt-p (strcat "  "(itoa 5sltsh_no2) " " "new"));txt str no of poles	 
  ));end progn, end if
  (if (and 5sltsh_no2 5sltsh_no1);if prop & existing
    (progn
      (setq txt (strcat 5sltshtxt 5sltshtxt-p 5sltshtxt-e));combine txt
      (command "-insert" "stb128" pt1 "" "" "" num);insert hex symbol
      (command "text" "ml" pt2 "3" "0.0" txt);insert text
  ));end progn, if
  (if (and 5sltsh_no2 (not 5sltsh_no1));if prop & not existing
    (progn
      (command "-insert" "stb128" pt1 "" "" "" num);insert hex symbol
      (command "text" "ml" pt2 "3" "0.0" atxt atxp-p);insert text
  ));end progn, if
  (if (and 5sltsh_no1 (not 5sltsh_no2));if exist & not prop
    (progn
      (command "-insert" "stb125" pt1 "" "" "" num);insert hex symbol
      (command "text" "ml" pt2 "3" "0.0" atxt atxt-e);insert text
  ));end progn, if
  (if (or 5sltsh_no2 5sltsh_no1)
    (setq num (+ num 1);reset number
	py1  (- py1 10);adjust for next line
	pt1 (strcat (rtos px) "," (rtos py1));reset insert point
	pt2 (strcat (rtos px1) "," (rtos py1));reset insert point
    );end setq
  );end if  
(setq 5sltsh-e nil);close selection set
(setq 5sltsh-p nil);close selection set
);end 5sltsh
;
;--------------------------------------------------------------------------------------------
(defun 5srtsh ()
  (setq 5srtsh-e (ssget "x" (list (cons 2 "stb036a"))));get list of exist a poles
  (setq 5srtsh-p (ssget "x" (list (cons 2 "stb036"))));get list of prop a poles
  (setq 5srtshtxt (strcat "5 sect - left turn - 12in signal head" " " "-" " " ));make text string
  (if 5srtsh-e
    (progn
      (setq 5srtsh_no1 (sslength 5srtsh-e));get number of a poles
      (setq 5srtshtxt-e (strcat "  "(itoa 5srtsh_no1)" " "exist"));txt str no of poles
  ));end progn, end if
  (if 5srtsh-p
    (progn			 
      (setq 5srtsh_no2 (sslength 5srtsh-p));get number of a poles
      (setq 5srtshtxt-p (strcat "  "(itoa 5srtsh_no2) " " "new"));txt str no of poles	 
  ));end progn, end if
  (if (and 5srtsh_no2 5srtsh_no1);if prop & existing
    (progn
      (setq txt (strcat 5srtshtxt 5srtshtxt-p 5srtshtxt-e));combine txt
      (command "-insert" "stb128" pt1 "" "" "" num);insert hex symbol
      (command "text" "ml" pt2 "3" "0.0" txt);insert text
  ));end progn, if
  (if (and 5srtsh_no2 (not 5srtsh_no1));if prop & not existing
    (progn
      (command "-insert" "stb128" pt1 "" "" "" num);insert hex symbol
      (command "text" "ml" pt2 "3" "0.0" atxt atxp-p);insert text
  ));end progn, if
  (if (and 5srtsh_no1 (not 5srtsh_no2));if exist & not prop
    (progn
      (command "-insert" "stb125" pt1 "" "" "" num);insert hex symbol
      (command "text" "ml" pt2 "3" "0.0" atxt atxt-e);insert text
  ));end progn, if
  (if (or 5srtsh_no2 5srtsh_no1)
    (setq num (+ num 1);reset number
	py1  (- py1 10);adjust for next line
	pt1 (strcat (rtos px) "," (rtos py1));reset insert point
	pt2 (strcat (rtos px1) "," (rtos py1));reset insert point
    );end setq
  );end if  
(setq 5srtsh-e nil);close selection set
(setq 5srtsh-p nil);close selection set
);end 5srtsh
;
;--------------------------------------------------------------------------------------------
(defun cont ()
  (setq cont-e (ssget "x" (list (cons 2 "stb068"))));get list of exist a poles
  (setq cont-p (ssget "x" (list (cons 2 "stb041"))));get list of prop a poles
  (setq conttxt (strcat "controller" " " "-" " " ));make text string
  (if cont-e
    (progn
      (setq cont_no1 (sslength cont-e));get number of a poles
      (setq conttxt-e (strcat "  "(itoa cont_no1)" " "exist"));txt str no of poles
  ));end progn, end if
  (if cont-p
    (progn			 
      (setq cont_no2 (sslength cont-p));get number of a poles
      (setq conttxt-p (strcat "  "(itoa cont_no2) " " "new"));txt str no of poles	 
  ));end progn, end if
  (if (and cont_no2 cont_no1);if prop & existing
    (progn
      (setq txt (strcat conttxt conttxt-p conttxt-e));combine txt
      (command "-insert" "stb128" pt1 "" "" "" num);insert hex symbol
      (command "text" "ml" pt2 "3" "0.0" txt);insert text
  ));end progn, if
  (if (and cont_no2 (not cont_no1));if prop & not existing
    (progn
      (command "-insert" "stb128" pt1 "" "" "" num);insert hex symbol
      (command "text" "ml" pt2 "3" "0.0" atxt atxp-p);insert text
  ));end progn, if
  (if (and cont_no1 (not cont_no2));if exist & not prop
    (progn
      (command "-insert" "stb125" pt1 "" "" "" num);insert hex symbol
      (command "text" "ml" pt2 "3" "0.0" atxt atxt-e);insert text
  ));end progn, if
  (if (or cont_no2 cont_no1)
    (setq num (+ num 1);reset number
	py1  (- py1 10);adjust for next line
	pt1 (strcat (rtos px) "," (rtos py1));reset insert point
	pt2 (strcat (rtos px1) "," (rtos py1));reset insert point
    );end setq
  );end if  
(setq cont-e nil);close selection set
(setq cont-p nil);close selection set
);end cont
;
;--------------------------------------------------------------------------------------------
(defun 20loop ()
  (setq 20l-e (ssget "x" (list (cons 2 "stb043"))));get list of exist a poles
  (setq 20l-p (ssget "x" (list (cons 2 "stb044"))));get list of prop a poles
  (setq 20ltxt (strcat "5' x 20' quadrupole loop" " " "-" " " ));make text string
  (if 20l-e
    (progn
      (setq 20l_no1 (sslength 20l-e));get number of a poles
      (setq 20ltxt-e (strcat "  "(itoa 20l_no1)" " "exist"));txt str no of poles
  ));end progn, end if
  (if 20l-p
    (progn			 
      (setq 20l_no2 (sslength 20l-p));get number of a poles
      (setq 20ltxt-p (strcat "  "(itoa 20l_no2) " " "new"));txt str no of poles	 
  ));end progn, end if
  (if (and 20l_no2 20l_no1);if prop & existing
    (progn
      (setq txt (strcat 20ltxt 20ltxt-p 20ltxt-e));combine txt
      (command "-insert" "stb128" pt1 "" "" "" num);insert hex symbol
      (command "text" "ml" pt2 "3" "0.0" txt);insert text
  ));end progn, if
  (if (and 20l_no2 (not 20l_no1));if prop & not existing
    (progn
      (command "-insert" "stb128" pt1 "" "" "" num);insert hex symbol
      (command "text" "ml" pt2 "3" "0.0" atxt atxp-p);insert text
  ));end progn, if
  (if (and 20l_no1 (not 20l_no2));if exist & not prop
    (progn
      (command "-insert" "stb125" pt1 "" "" "" num);insert hex symbol
      (command "text" "ml" pt2 "3" "0.0" atxt atxt-e);insert text
  ));end progn, if
  (if (or 20l_no2 20l_no1)
    (setq num (+ num 1);reset number
	py1  (- py1 10);adjust for next line
	pt1 (strcat (rtos px) "," (rtos py1));reset insert point
	pt2 (strcat (rtos px1) "," (rtos py1));reset insert point
    );end setq
  );end if  
(setq 20l-e nil);close selection set
(setq 20l-p nil);close selection set
);end 20loop
;
;--------------------------------------------------------------------------------------------
(defun 40loop ()
  (setq 40l-e (ssget "x" (list (cons 2 "stb045"))));get list of exist a poles
  (setq 40l-p (ssget "x" (list (cons 2 "stb046"))));get list of prop a poles
  (setq 40ltxt (strcat "5' x 40' quadrupole loop" " " "-" " " ));make text string
  (if 40l-e
    (progn
      (setq 40l_no1 (sslength 40l-e));get number of a poles
      (setq 40ltxt-e (strcat "  "(itoa 40l_no1)" " "exist"));txt str no of poles
  ));end progn, end if
  (if 40l-p
    (progn			 
      (setq 40l_no2 (sslength 40l-p));get number of a poles
      (setq 40ltxt-p (strcat "  "(itoa 40l_no2) " " "new"));txt str no of poles	 
  ));end progn, end if
  (if (and 40l_no2 40l_no1);if prop & existing
    (progn
      (setq txt (strcat 40ltxt 40ltxt-p 40ltxt-e));combine txt
      (command "-insert" "stb128" pt1 "" "" "" num);insert hex symbol
      (command "text" "ml" pt2 "3" "0.0" txt);insert text
  ));end progn, if
  (if (and 40l_no2 (not 40l_no1));if prop & not existing
    (progn
      (command "-insert" "stb128" pt1 "" "" "" num);insert hex symbol
      (command "text" "ml" pt2 "3" "0.0" atxt atxp-p);insert text
  ));end progn, if
  (if (and 40l_no1 (not 40l_no2));if exist & not prop

    (progn
      (command "-insert" "stb125" pt1 "" "" "" num);insert hex symbol
      (command "text" "ml" pt2 "3" "0.0" atxt atxt-e);insert text
  ));end progn, if
  (if (or 40l_no2 40l_no1)
    (setq num (+ num 1);reset number
	py1  (- py1 10);adjust for next line
	pt1 (strcat (rtos px) "," (rtos py1));reset insert point
	pt2 (strcat (rtos px1) "," (rtos py1));reset insert point
    );end setq
  );end if  
(setq 40l-e nil);close selection set
(setq 40l-p nil);close selection set
);end 40loop
;--------------------------------------------------------------------------------------------
;peb heads
(defun pedh ()
  (setq ph-e (ssget "x" (list (cons 2 "stb138"))));get list of exist a poles
  (setq ph-p (ssget "x" (list (cons 2 "stb037"))));get list of prop a poles
  (setq phtxt (strcat "ped head" " " "-" " " ));make text string
  (if ph-e
    (progn
      (setq ph_no1 (sslength ph-e));get number of a poles
      (setq phtxt-e (strcat "  "(itoa ph_no1)" " "exist"));txt str no of poles
  ));end progn, end if
  (if ph-p
    (progn			 
      (setq ph_no2 (sslength ph-p));get number of a poles
      (setq phtxt-p (strcat "  "(itoa ph_no2) " " "new"));txt str no of poles	 
  ));end progn, end if
  (if (and ph_no2 ph_no1);if prop & existing
    (progn
      (setq txt (strcat phtxt phtxt-p phtxt-e));combine txt
      (command "-insert" "stb128" pt1 "" "" "" num);insert hex symbol
      (command "text" "ml" pt2 "3" "0.0" txt);insert text
  ));end progn, if
  (if (and ph_no2 (not ph_no1));if prop & not existing
    (progn
      (command "-insert" "stb128" pt1 "" "" "" num);insert hex symbol
      (command "text" "ml" pt2 "3" "0.0" atxt atxp-p);insert text
  ));end progn, if
  (if (and ph_no1 (not ph_no2));if exist & not prop
    (progn
      (command "-insert" "stb125" pt1 "" "" "" num);insert hex symbol
      (command "text" "ml" pt2 "3" "0.0" atxt atxt-e);insert text
  ));end progn, if
  (if (or ph_no2 ph_no1)
    (setq num (+ num 1);reset number
	py1  (- py1 10);adjust for next line
	pt1 (strcat (rtos px) "," (rtos py1));reset insert point
	pt2 (strcat (rtos px1) "," (rtos py1));reset insert point
    );end setq
  );end if  
(setq ph-e nil);close selection set
(setq ph-p nil);close selection set
);end pedh
;--------------------------------------------------------------------------------------------
;ped push buttons
(defun pedb ()
  (setq pb-e (ssget "x" (list (cons 2 "stb139"))));get list of exist a poles
  (setq pb-p (ssget "x" (list (cons 2 "stb038"))));get list of prop a poles
  (setq phtxt (strcat "ped head" " " "-" " " ));make text string
  (if pb-e
    (progn
      (setq pb_no1 (sslength pb-e));get number of a poles
      (setq pbtxt-e (strcat "  "(itoa pb_no1)" " "exist"));txt str no of poles
  ));end progn, end if
  (if pb-p
    (progn			 
      (setq pb_no2 (sslength pb-p));get number of a poles
      (setq pbtxt-p (strcat "  "(itoa pb_no2) " " "new"));txt str no of poles	 
  ));end progn, end if
  (if (and pb_no2 pb_no1);if prop & existing
    (progn
      (setq txt (strcat pbtxt pbtxt-p pbtxt-e));combine txt
      (command "-insert" "stb128" pt1 "" "" "" num);insert hex symbol
      (command "text" "ml" pt2 "3" "0.0" txt);insert text
  ));end progn, if
  (if (and pb_no2 (not pb_no1));if prop & not existing
    (progn
      (command "-insert" "stb128" pt1 "" "" "" num);insert hex symbol
      (command "text" "ml" pt2 "3" "0.0" atxt atxp-p);insert text
  ));end progn, if
  (if (and pb_no1 (not pb_no2));if exist & not prop
    (progn
      (command "-insert" "stb125" pt1 "" "" "" num);insert hex symbol
      (command "text" "ml" pt2 "3" "0.0" atxt atxt-e);insert text
  ));end progn, if
  (if (or pb_no2 pb_no1)
    (setq num (+ num 1);reset number
	py1  (- py1 10);adjust for next line
	pt1 (strcat (rtos px) "," (rtos py1));reset insert point
	pt2 (strcat (rtos px1) "," (rtos py1));reset insert point
    );end setq
  );end if  
(setq pb-e nil);close selection set
(setq pb-p nil);close selection set
);end pedb
;--------------------------------------------------------------------------------------------
;ped push buttons
(defun pedb ()
  (setq pb-e (ssget "x" (list (cons 2 "stb139"))));get list of exist a poles
  (setq pb-p (ssget "x" (list (cons 2 "stb038"))));get list of prop a poles
  (setq pbtxt (strcat "ped push buttons" " " "-" " " ));make text string
  (if pb-e
    (progn
      (setq pb_no1 (sslength pb-e));get number of a poles
      (setq pbtxt-e (strcat "  "(itoa pb_no1)" " "exist"));txt str no of poles
  ));end progn, end if
  (if pb-p
    (progn			 
      (setq pb_no2 (sslength pb-p));get number of a poles
      (setq pbtxt-p (strcat "  "(itoa pb_no2) " " "new"));txt str no of poles	 
  ));end progn, end if
  (if (and pb_no2 pb_no1);if prop & existing
    (progn
      (setq txt (strcat pbtxt pbtxt-p pbtxt-e));combine txt
      (command "-insert" "stb128" pt1 "" "" "" num);insert hex symbol
      (command "text" "ml" pt2 "3" "0.0" txt);insert text
  ));end progn, if
  (if (and pb_no2 (not pb_no1));if prop & not existing
    (progn
      (command "-insert" "stb128" pt1 "" "" "" num);insert hex symbol
      (command "text" "ml" pt2 "3" "0.0" atxt atxp-p);insert text
  ));end progn, if
  (if (and pb_no1 (not pb_no2));if exist & not prop
    (progn
      (command "-insert" "stb125" pt1 "" "" "" num);insert hex symbol
      (command "text" "ml" pt2 "3" "0.0" atxt atxt-e);insert text
  ));end progn, if
  (if (or pb_no2 pb_no1)
    (setq num (+ num 1);reset number
	py1  (- py1 10);adjust for next line
	pt1 (strcat (rtos px) "," (rtos py1));reset insert point
	pt2 (strcat (rtos px1) "," (rtos py1));reset insert point
    );end setq
  );end if  
(setq pb-e nil);close selection set
(setq pb-p nil);close selection set
);end pedb
;--------------------------------------------------------------------------------------------
;audible ped heads
(defun aph ()
  (setq aph-e (ssget "x" (list (cons 2 "stb405"))));get list of exist a poles
  (setq aph-p (ssget "x" (list (cons 2 "stb404"))));get list of prop a poles
  (setq aphtxt (strcat "audible ped head" " " "-" " " ));make text string
  (if aph-e
    (progn
      (setq aph_no1 (sslength aph-e));get number of a poles
      (setq aphtxt-e (strcat "  "(itoa aph_no1)" " "exist"));txt str no of poles
  ));end progn, end if
  (if aph-p
    (progn			 
      (setq aph_no2 (sslength aph-p));get number of a poles
      (setq aphtxt-p (strcat "  "(itoa aph_no2) " " "new"));txt str no of poles	 
  ));end progn, end if
  (if (and aph_no2 aph_no1);if prop & existing
    (progn
      (setq txt (strcat aphtxt aphtxt-p aphtxt-e));combine txt
      (command "-insert" "stb128" pt1 "" "" "" num);insert hex symbol
      (command "text" "ml" pt2 "3" "0.0" txt);insert text
  ));end progn, if
  (if (and aph_no2 (not aph_no1));if prop & not existing
    (progn
      (command "-insert" "stb128" pt1 "" "" "" num);insert hex symbol
      (command "text" "ml" pt2 "3" "0.0" atxt atxp-p);insert text
  ));end progn, if
  (if (and aph_no1 (not aph_no2));if exist & not prop
    (progn
      (command "-insert" "stb125" pt1 "" "" "" num);insert hex symbol
      (command "text" "ml" pt2 "3" "0.0" atxt atxt-e);insert text
  ));end progn, if
  (if (or aph_no2 aph_no1)
    (setq num (+ num 1);reset number
	py1  (- py1 10);adjust for next line
	pt1 (strcat (rtos px) "," (rtos py1));reset insert point
	pt2 (strcat (rtos px1) "," (rtos py1));reset insert point
    );end setq
  );end if  
(setq aph-e nil);close selection set
(setq aph-p nil);close selection set
);end aph
;--------------------------------------------------------------------------------------------
;luminaires
(defun lum ()
  (setq lum-e (ssget "x" (list (cons 2 "stb140"))));get list of exist a poles
  (setq lum-p (ssget "x" (list (cons 2 "stb039"))));get list of prop a poles
  (setq lumtxt (strcat "h.p.s. luminaire" " " "-" " " ));make text string
  (if lum-e
    (progn
      (setq lum_no1 (sslength lum-e));get number of a poles
      (setq lumtxt-e (strcat "  "(itoa lum_no1)" " "exist"));txt str no of poles
  ));end progn, end if
  (if lum-p
    (progn			 
      (setq lum_no2 (sslength lum-p));get number of a poles
      (setq lumtxt-p (strcat "  "(itoa lum_no2) " " "new"));txt str no of poles	 
  ));end progn, end if
  (if (and lum_no2 lum_no1);if prop & existing
    (progn
      (setq txt (strcat lumtxt lumtxt-p lumtxt-e));combine txt
      (command "-insert" "stb128" pt1 "" "" "" num);insert hex symbol
      (command "text" "ml" pt2 "3" "0.0" txt);insert text
  ));end progn, if
  (if (and lum_no2 (not lum_no1));if prop & not existing
    (progn
      (command "-insert" "stb128" pt1 "" "" "" num);insert hex symbol
      (command "text" "ml" pt2 "3" "0.0" atxt atxp-p);insert text
  ));end progn, if
  (if (and lum_no1 (not lum_no2));if exist & not prop
    (progn
      (command "-insert" "stb125" pt1 "" "" "" num);insert hex symbol
      (command "text" "ml" pt2 "3" "0.0" atxt atxt-e);insert text
  ));end progn, if
  (if (or lum_no2 lum_no1)
    (setq num (+ num 1);reset number
	py1  (- py1 10);adjust for next line
	pt1 (strcat (rtos px) "," (rtos py1));reset insert point
	pt2 (strcat (rtos px1) "," (rtos py1));reset insert point
    );end setq
  );end if  
(setq lum-e nil);close selection set
(setq lum-p nil);close selection set
);end lum
;--------------------------------------------------------------------------------------------
;illuminated street signs
(defun lss ()
  (setq lss-e (ssget "x" (list (cons 2 "stb403"))));get list of exist a poles
  (setq lss-p (ssget "x" (list (cons 2 "stb402"))));get list of prop a poles
  (setq lsstxt (strcat "illuminated street sign" " " "-" " " ));make text string
  (if lss-e
    (progn
      (setq lss_no1 (sslength lss-e));get number of a poles
      (setq lsstxt-e (strcat "  "(itoa lss_no1)" " "exist"));txt str no of poles
  ));end progn, end if
  (if lss-p
    (progn			 
      (setq lss_no2 (sslength lss-p));get number of a poles
      (setq lsstxt-p (strcat "  "(itoa lss_no2) " " "new"));txt str no of poles	 
  ));end progn, end if
  (if (and lss_no2 lss_no1);if prop & existing
    (progn
      (setq txt (strcat lsstxt lsstxt-p lsstxt-e));combine txt
      (command "-insert" "stb128" pt1 "" "" "" num);insert hex symbol
      (command "text" "ml" pt2 "3" "0.0" txt);insert text
  ));end progn, if
  (if (and lss_no2 (not lss_no1));if prop & not existing
    (progn
      (command "-insert" "stb128" pt1 "" "" "" num);insert hex symbol
      (command "text" "ml" pt2 "3" "0.0" atxt atxp-p);insert text
  ));end progn, if
  (if (and lss_no1 (not lss_no2));if exist & not prop
    (progn
      (command "-insert" "stb125" pt1 "" "" "" num);insert hex symbol
      (command "text" "ml" pt2 "3" "0.0" atxt atxt-e);insert text
  ));end progn, if
  (if (or lss_no2 lss_no1)
    (setq num (+ num 1);reset number
	py1  (- py1 10);adjust for next line
	pt1 (strcat (rtos px) "," (rtos py1));reset insert point
	pt2 (strcat (rtos px1) "," (rtos py1));reset insert point
    );end setq
  );end if  
(setq lss-e nil);close selection set
(setq lss-p nil);close selection set
);end lss
;--------------------------------------------------------------------------------------------
(defun c:eqpt ()
  (setq xblk (ssget "x" (list (cons 2 "mon")));find blk "mon"
        xblk1 (entget (ssname xblk 0));get blk data
        pta (cdr (assoc 10 xblk1));get coord
 	ptx   (car pta)	;get x coord
  	pty   (cadr pta);get y coord
  	px    (+ ptx 260);add 260 to x coord for blk
  	px1   (+ px 20);add 20 to x coord for text
  	py1    (+ pty 60);add 60 to y coord
  	pt1   (strcat (rtos px) "," (rtos py1));make blk insert point
  	pt2   (strcat (rtos px1) "," (rtos py1));make text insert point
  	num   1	;set number
  );end setq
  (eq2)
  (setq lay-x (getvar "clayer"))
  (command "clayer" "0") ;"c-traf-eqpt-text")
  ;run subroutines for poles
  (a10pol)(spol)(rpol)(mupol)(mpol)(apol)
  ;run subroutines for mast arms
  (55ma) (50ma)(45ma)(40ma)(35ma)(30ma)(25ma)(20ma)(15ma)
  ;run subroutines for the rest
  (8sh)(12sh)(5sltsh)(5srtsh)(cont)(20loop)(40loop)(pedh)(pedb)(aph)(lum)(lss)
  (command "clayer" lay-x "")
  (princ)
);end eqpt
;
;--------------------------------------------------------------------------------------------
;eq2.lsp
 (defun eq2 ()
   (setvar "cmdecho" 0)
   (command "layer" "s" "0"
                    "t" "*"
	  	    "f" "c-swr"
		    "f" "c-swr-exst"
		    "f" "c-strm-undr"
		    "f" "c-strm-undr-exst"
                    "f" "c-traf-fndn-cond"
                    "f" "c-traf-fndn-cond-exst"
                    "f" "c-traf-fndn-jb"
                    "f" "c-traf-fndn-jb-exst"
                    "f" "c-util-cabl-undr"
                    "f" "c-util-cabl-undr-exst"
                    "f" "c-util-fibr-undr"
                    "f" "c-util-fibr-undr-exst"
		    "f" "c-util-ngas-undr"
                    "f" "c-util-ngas-undr-exst"
		    "f" "c-util-powr-undr"
		    "f" "c-util-powr-undr-exst"
		    "f" "c-wtr-undr"
		    "f" "c-wtr-undr-exst"
                    "f" "c-traf-fndn-text"
		    "f" "c-traf-fndn-misc"
		    "f" "c-traf-pole-exist-removal" ""
   )  ;end command
   (princ)
 ) ;end eq2
 ;
