;;;global variable:   rxhd::dist11
;;;道路交通设施----标线
;;;人行横道线
;;;wri yft 00.01.21

(defun ?dljtss_bx_rxhdx	( /	   p1	     p2	       p3
			 p4	   angle1    angle2    angle4
			 angle22   angle21   el	       ell
			 n	   dist1     dist2     pfirst
			 psencond  jlength   jlength2  jxlength
			 str	   osn	     plwid     drawbx
			 uctr	   loop	     olddrawbx ptem
			 oldplinewid	     rxhd_sx_wid
			 rxhd_kx_wid		
			)
  (HY_Set0)
  
  (setq	;;;;;osn	    (getvar "osmode")
	oldplinewid (getvar "plinewid")
  )
;;;	人行横道线的线宽(实、空)
  (setq	rxhd_sx_wid 0.4
	rxhd_kx_wid (+ 0.6 rxhd_sx_wid)
  )
  (setq plwid rxhd_sx_wid)
  (initget "J B")
  (setq	drawbx (getkword
		 "\n选择: 绘预告标识J /绘两侧边线B /<不绘两侧边线>:"
	       )
  )
  (if (/= drawbx "J")
    (progn
      (setq loop t
	    uctr (HY_ClearUNDO)
      )
      (while loop
	(setq angle4 nil
	      jlength2 nil
	)
	(sa_osmode)
	(setvar "osmode" 640)
	(initget "U")
	(setq p1 (getpoint "\n回车退出 /回退U /输入人行横道线起点:"))
	(re_osmode)
	(cond
	  ((null p1) (setq loop nil))
	  ((= p1 "U")
	   ($undob uctr)
	  )
	  (t
	   (sa_osmode)
	   (setvar "osmode" 640)
	   (initget 1)
	   (setq p2 (getpoint p1 "\n输入人行横道线终点:"))
	   (re_osmode)
	   (if (< (pmdist p1 p2) 1.0)
	     (prompt "\n起点与终点距离太短!")
	     (progn
	       (initget 6)
	       (if (null rxhd::dist11)
		 (setq rxhd::dist11 5.0)
	       )
	       (setq dist1
		      (getdist (strcat "\n输入人行横道线宽度<"
				       (rtos rxhd::dist11 2 2)
				       ">:"
			       )
		      )
	       )
	       (if (= dist1 nil)
		 (setq dist1 rxhd::dist11)
		 (setq rxhd::dist11 dist1)
	       )
	       (setq angle2 (angle p1 p2))
	       (initget 7 "X")
	       (setq
		 ptem
		  (getpoint
		    p1
		    "\n请指定人行道宽度方向:"
		  )
	       )
	       (setq angle1 (angle p1 ptem))

	       (setq dist2   (pmdist p1 p2)
		     jlength rxhd_kx_wid
	       )
	       (setq pa	(polar p1 angle1 (* dist1 0.5))
		     pb	(polar p1 angle1 (* dist1 -0.5))
	       )
	       (setq p1	pa
		     p2	pb
		     p3	(polar p1 angle2 dist2)
		     p4	(polar p2 angle2 dist2)
	       )


	       ;;(DL_MakeLayer "PP-DL-RXHD")
;;;2002-11-25 15:48由王志宇修改
	       (if (null (tblsearch "LAYER" "PP-DL-RXHD"))
		 (command "layer" "m" "PP-DL-RXHD" "")
		 (command "layer" "s" "PP-DL-RXHD" "")
	       )

	       (HY_UndoM)
	       (HY_SV)
	       (if (= drawbx "B")
		 (progn
		   (command "pline" p1 p3 "")
		   (command ".pedit" (entlast) "w" rxhd_sx_wid "")
		   (command "pline" p4 p2 "")
		   (command ".pedit" (entlast) "w" rxhd_sx_wid "")
		 )
		 (progn
		   (setq angle21  (- angle2 angle1)
			 jxlength (/ jlength (abs (sin angle21)))
			 pfirst	  (polar p1 angle2 jxlength)
			 psencond (polar p2 angle2 jxlength)
			 dist2	  (- (pmdist p1 p3) 0.02)
		   )
		   (setq n 0)
		   (while (< (pmdist p1 pfirst) dist2)
		     (setq n (+ n 1))
		     (if (zerop (rem n 5))
		       (progn
			 (command "pline" pfirst "w" plwid "" psencond
				  "")
			 (setq el (entlast))
		       )
		       (command "pline" pfirst "w" plwid "" psencond "")
		     )
		     (setq pfirst (polar pfirst angle2 jxlength))
		     (setq psencond (polar psencond angle2 jxlength))
		   )
		 )
	       )
	       (HY_RV)
	     )
	   )
	  )
	)
      )
    )
;;;预告标识
    (progn
      (setq pfirst (getpoint "\n回车退出 / 请点取预告标识放置点:"))
      (if pfirst
	(progn
;;;					(setq	p1 (polar pfirst 0 1.048)
;;;								p2 (polar pfirst (* 0.5 pi) 0.419)
;;;								p3 (polar pfirst pi 1.048)
;;;								p4 (polar pfirst (* 1.5 pi) 0.419)
;;;					)

	  ;;(DL_MakeLayer "PP-DL-RXHD")
;;;2002-11-25 15:48由王志宇修改
	  (if (null (tblsearch "LAYER" "PP-DL-RXHD"))
	    (command "layer" "m" "PP-DL-RXHD" "")
	    (command "layer" "s" "PP-DL-RXHD" "")
	  )

;;;					(HY_SV)
;;;					(setvar "plinewid" 0.15)
;;;					(command ".pline" p1 p2 p3 p4 "c")

	  (command ".insert"
		   (strcat (HY_GetInstallDir) "Commres\\block\\jt_rxdbz")
		   pfirst
		   1
		   1.3
		   0
	  )
	  (setq e1 (entlast))
	  (setq angle1 (#setangpt pfirst "请确定预告标识"))
	  (command ".rotate" e1 "" pfirst (rtod angle1))
	  (setvar "snapang" 0)
	  (setvar "orthomode" 0)
	  (HY_RV)
	)
      )
    )
  )
;;;;  (setvar "osmode" osn)
  (setvar "plinewid" oldplinewid)
  (HY_Set1)
  (princ)
)



;;;道路交通设施----标线
;;;停车位标线
;;;wri yft 00.01.21
(defun ?dljtss_bx_tcwbx
			(/	    tcw_sty    tcw_sty1	  oldplinewid
			 loop	    start_pt   tcw_num	  tcw_angle
			 tcw_long   tcw_width  tcw_distance
			 p1	    p2	       p3	  p4
			 ent	    ent1       pline_wid  ang1
			 loop	    loop1	ent3	
			)
 ;;; (setq w_osmode (getvar "osmode"))
  (HY_Set0)

  (setq	pline_wid 0.1
	tcw_distance
	 4.0
  )
  (setq	oldplinewid
	 (getvar "plinewid")
	flag1 nil
  )
  (initget 6 "X Z E")
  (setq tcw_sty (getkword "\n退出E / 倾斜式X /垂直式Z /<回车平行式>:"))
  (if (/= tcw_sty "E")
    (progn
      (initget 6 "D")
      (setq tcw_sty1 (getkword "选择车位尺寸: 大中型D / <回车小型>:"))
      (if (null #getpt)
	(#ppls "pppp")
      )
      (if (null pub_arrow_wmk)
	(#ppls "wwpublic")
      )
      (setq loop t)
      (while loop
	(menucmd "s=gline1")
	(initget "D R P X")
	(setq start_pt
	       (#getpt
		 nil
		 "\n回车退出 / <请点取标线的左上角>:"
	       )
	)
	(menucmd "s=")
	(if (null start_pt)
	  (setq loop nil)
	  (progn
	    (if	tcw_sty1
;;;大中型
	      (setq tcw_long 15.6
		    tcw_width 3.25
	      )
;;;小型
	      (setq tcw_long 6.0
		    tcw_width 2.5
	      )
	    )
	    (setq loop1 t)
	    (while loop1
	      (initget 7 "X")
	      (setq
		tcw_angle (getpoint start_pt
				    "\n选平行线X /<请点取标线的方向>:"
			  )
	      )
	      (if (= tcw_angle "X")
		(progn
		  (setq
		    ent	(gpsseld '((0 . "LINE")) "\n请选择直线:" nil)
		  )
		  (if (and ent (listp ent))
		    (progn
		      (setq ent (car ent))
		      (setq p1	      (entget ent)
			    p2	      (cdr (assoc 10 p1))
			    p3	      (cdr (assoc 11 p1))
			    tcw_angle (angle p2 p3)
		      )
		      (zm2pt p2 p3)
		      (pub_arrow_wmk p2 tcw_angle)
		      (initget "Y N")
		      (setq p1
			     (getkword "\n该方向是否为停车线方向(Y or N):<Y>")
		      )
		      (if (= p1 "N")
			(setq tcw_angle (angle p3 p2))
		      )
		      (entdel (entlast))
		      (setq loop1 nil)
		    )
		  )
		)
		(setq tcw_angle	(angle start_pt tcw_angle)
		      loop1	nil
		)
	      )
	    )
	    (initget 7)
	    (setq tcw_num (getint "\n请输入停车位的数目:"))
	    (HY_SV)
	    (cond
;;;倾斜式
	      ((= tcw_sty "X")
	       (initget 3)
	       (setq ang1 (getreal "\n请输入车辆与通道的夹角:"))



;;;2002-11-25 15:48由王志宇修改
;;;(DL_MakeLayer "PP-DL-TCC")
	       (if (null (tblsearch "LAYER" "PP-DL-TCC"))
		 (command "layer" "m" "PP-DL-TCC" "")
		 (command "layer" "s" "PP-DL-TCC" "")
	       )
	       (setq p1	(polar start_pt 0 tcw_width)
		     p2	(polar p1 (- 0.0 (dtor ang1)) tcw_long)
		     p3	(polar start_pt (- 0.0 (dtor ang1)) tcw_long)
	       )
	       (command ".pline" start_pt p1 p2 p3 "c")
	       (command ".pedit" (entlast) "w" pline_wid "")
	       (setq ent (entlast))
	       (command ".rotate" ent "" start_pt (rtod tcw_angle))
	       (setq p1 (polar start_pt tcw_angle tcw_width))
	       (setq tcw_num (1- tcw_num))
	       (repeat tcw_num
		 (command ".copy" ent "" start_pt p1)
		 (setq p1 (polar p1 tcw_angle tcw_width))
	       )
	      )
;;;垂直式
	      ((= tcw_sty "Z")



;;;; (DL_MakeLayer "pp-dl-tcc")
;;;2002-11-25 15:48由王志宇修改
;;;(DL_MakeLayer "PP-DL-TCC")
	       (if (null (tblsearch "LAYER" "PP-DL-TCC"))
		 (command "layer" "m" "PP-DL-TCC" "")
		 (command "layer" "s" "PP-DL-TCC" "")
	       )
	       (setq p1	(polar start_pt 0 tcw_width)
		     p2	(polar p1 (/ pi -2.0) tcw_long)
	       )
	       (command ".rectang" "w" pline_wid start_pt p2)
	       (setq ent (entlast))
	       (command ".rotate" ent "" start_pt (rtod tcw_angle))
	       (setq p1 (polar start_pt tcw_angle tcw_width))
	       (setq tcw_num (1- tcw_num))
	       (repeat tcw_num
		 (command ".copy" ent "" start_pt p1)
		 (setq p1 (polar p1 tcw_angle tcw_width))
	       )
	      )
;;;平行式
	      ((null tcw_sty)
;;;(DL_MakeLayer "pp-dl-tcc")

;;;2002-11-25 15:48由王志宇修改

	       (if (null (tblsearch "LAYER" "PP-DL-TCC"))
		 (command "layer" "m" "PP-DL-TCC" "")
		 (command "layer" "s" "PP-DL-TCC" "")
	       )


	       (setq p1	(polar start_pt 0 tcw_long)
		     p2	(polar p1 (/ pi -2.0) tcw_width)
	       )
	       (command ".rectang" "w" pline_wid start_pt p2)
	       (setq ent (entlast))
	       (command ".rotate" ent "" start_pt (rtod tcw_angle))
	       (setq p1 (polar start_pt tcw_angle tcw_long))
	       (if (> tcw_num 1)
		 (progn
		   (command ".copy"
			    ent
			    ""
			    start_pt
			    p1
		   )
		   (setq ent1 (entlast))
		 )
	       )
	       (setq p1 (polar p1 tcw_angle tcw_long))
	       (if (> tcw_num 2)
		 (progn
		   (while (>= (setq tcw_num (- tcw_num 2)) 2)
		     (setq p1 (polar p1 tcw_angle tcw_distance))
		     (command ".copy" ent ent1 "" start_pt p1)
		     (setq p1 (polar p1 tcw_angle (* 2 tcw_long)))
		   )
		   (if (= tcw_num 1)
		     (progn
		       (setq p1 (polar p1 tcw_angle tcw_distance))
		       (command ".copy" ent "" start_pt p1)
		     )
		   )
		 )
	       )
	      )
	    )
	    (HY_RV)
	  )
	)
      )
    )
  )

  (setvar "plinewid" oldplinewid)
  (HY_Set1)
  (princ)
)
;;;路面文字标记
;;;rwq修改2003-1-25 16:19
(defun ?dljtbx_lmwzbj( /	 wz_scale )
  (HY_set0)
(setq wz_scale 0.4)
(#ppas "hyzkgl")
(if (= (tblsearch "style" "dlwz1") nil)
	     (progn
	       (command	"-style"   "dlwz1"    "simhei.ttf"
			"0.0"	   wz_scale   ""	 ""
			""
		       )
	       (if (= (logand (getvar "cmdactive") 1) 1)
		 (command "")
	       )
	     )
	   )
(hy_zkgl  1)
(#ppuas "hyzkgl")
  (HY_set1)
  (princ)
)


;|

;;;道路交通设施----指示标线
;;;路面文字标记
;;;wri yft 00.01.25
(defun ?dljtbx_lmwzbj
		      (/	wz_high	 wz_scale wz_text  loop
		       str_len	i	 k	  wz_pt	   wz_angle
		       pt	dis_1	 dis_2	  wz_num   ang
		       ss	ent	error
		      )
  (HY_Set0)
  (defun my_error(msg)
    (setq *error* error)
    (HY_Set1)
    )
  (if (null wzedit)
    (#ppls "wzedit")
  )
  (setq wz_scale 0.4)
  (if (= (tblsearch "style" "DLWZ1") nil)
    (progn
      (command "-style"	"dlwz1"	"simhei.ttf" "0.0" wz_scale "" "" "")
      (if (= (logand (getvar "cmdactive") 1) 1)
	(command "")
      )
    )
  )
  (if (null (tblsearch "layer" "PP-DL-WZ"))
    (command ".layer" "new" "PP-DL-WZ" "")
    (command ".layer" "s" "PP-DL-WZ" "")
  )
  (setq error *error*)
  (setq *error* my_error)
  (initget 6)
  (setq wz_high (getreal "\n请输入文字的高度(m):<2.5>"))
  (if (null wz_high)
    (setq wz_high 2.5)
  )
  (setq loop t)

  (while loop
    (setq wz_text (strtrim (wzedit "dcl")))

    (if	(/= "" wz_text)
      (progn
	(HY_SV)
	(initget 7)
	(setq wz_pt (getpoint "\n请点取文字的放置点:")
	      pt    wz_pt
	)
	(setq wz_angle (/ pi -2.0))
	(setq str_len (strlen wz_text)
	      i	      1
	      dis_1   0.0
	      dis_2   0.0
	      ss      nil
	      ss      (ssadd)
	)
	(while (<= i str_len)
	  (setq k (substr wz_text i 1))
	  (if (and (>= (ascii k) 48) (<= (ascii k) 57))
	    (progn
	      (command "text" "s" "dlwz1" "J" "tc" pt wz_high 0 k)
	      (setq i	  (1+ i)
		    dis_1 (+ dis_1 (* wz_scale wz_high))
		    pt	  (polar wz_pt (+ (/ pi 2.0) wz_angle) dis_1)
		    ss	  (ssadd (entlast) ss)
	      )
	    )
	    (progn
	      (setq k (substr wz_text i 2))
	      (command "text"
		       "s"
		       "DLWZ1"
		       "J"
		       "tc"
		       pt
		       (* 0.78 wz_high)
		       0
		       k
	      )
	      (setq i	  (+ 2 i)
		    dis_2 (+ dis_2 0.5 wz_high)
		    pt	  (polar wz_pt wz_angle dis_2)
		    ss	  (ssadd (entlast) ss)
	      )
	    )
	  )
	)

	;;;;2002-11-29 15:54 由王志宇修改
	(setvar "orthomode" 0)
	(if (> (sslength ss) 0)
	  (progn
	    (command "-group" "c" "*" "a" ss "")
	    (setq ent (entlast))
	    (princ "\n请确定文字角度<0>:")
	    ;;(setq ang (#setangpt wz_pt "请确定文字旋转"))
	    (command ".rotate" ent "" wz_pt pause)
	  )
	)
	(setvar "orthomode" 1)


	(HY_RV)
      )
      (setq loop nil)
    )
  )
  (setq *error* error)
  (HY_Set1)
  (princ)
)
|;


;;;道路交通设施----禁止标线
;;;左弯待转区 -------1
;;;wri yft 00.03.06
(defun ?jt_bx_jzbhcd (sty     /	      ent     line_wid	      old_osmod
		      pt      pt1     pt2     pt3     xx      ang
		      wz_scale	      wz_high	;;w_osmode
		     )
 ;;;; (setq w_osmode (getvar "osmode"))
  (HY_Set0)
;;;;  (setq old_osmod (getvar "osmode"))
  (if (null ?jtssbx_draw_pline)
    (#ppls "dljtbx")
  )
  (setq	line_wid 0.15
	wz_scale 0.4
	wz_high	1.5
  )
;;;(DL_MakeLayer "pp-dl-jtbx")
;;;2002-11-25 由王志宇修改

  (if (null (tblsearch "LAYER" "PP-DL-JTBX"))
    (command "layer" "m" "PP-DL-JTBX" "")
    (command "layer" "s" "PP-DL-JTBX" "")
  )

  (sa_osmode)
  (setvar "osmode" 545)
  (if (setq ent (?jtssbx_draw_pline))
    (cond
;;;			((= sty 0)
;;;			 (HY_Set0)
;;;			 (HY_KZSJXZ ent nil 43 line_wid 8 "pp-dl-jtbx")
;;;			)
      ((= sty 1)
       (HY_Set0)
       (if (null (tblsearch "ltype" "JTSS02"))
	 (command ".linetype" "l" "JTSS02" "DLJTXX" "")
       )
       (HY_KZSJXZ ent nil 43 line_wid 8 "PP-DL-JTBX" 6 "JTSS02" 62 7)
       (command ".chprop" ent "" "s" 0.5 "")
       (setq pt (last (bg-ypp ent)))
       (setq pt1 (getpoint pt "\n请点取另一条线的位置:"))
       (re_osmode)
       (if pt1
	 (progn
	   (command ".offset" "t" ent pt1 "")
	   (setq pt2 (car (bg-ypp ent))
		 pt3 (car (bg-ypp (entlast)))
	   )
	   (command ".pline" pt2 pt3 "")
	   (HY_KZSJXZ (entlast)
		   nil
		   43
		   line_wid
		   8
		   "PP-DL-JTBX"
		   6
		   "CONTINUOUS"
		   62
		   7
	   )
	   (setq ang (angle pt pt1)
		 pt  (midpt pt pt1)
		 pt  (polar pt (+ ang (* 0.5 pi)) 0.5)
	   )
	   (if (= (tblsearch "style" "dlwz1") nil)
	     (progn
	       (command	"-style"   "dlwz1"    "simhei.ttf"
			"0.0"	   wz_scale   ""	 ""
			""
		       )
	       (if (= (logand (getvar "cmdactive") 1) 1)
		 (command "")
	       )
	     )
	   )
	   (foreach xx '("区" "转" "待" "弯" "左")
	     (command "text"
		      "s"
		      "dlwz1"
		      "J"
		      "bc"
		      pt
		      (* 0.78 wz_high)
		      (rtod ang)
		      xx
	     )
	     (HY_KZSJXZ (entlast) nil 41 0.667 8 "PP-DL-WZ")
	     (setq pt (polar pt (+ ang (* 0.5 pi)) (+ 0.5 wz_high)))
	   )
	   (princ "\n如字的位置不合适,请移动!")
	 )
       )
      )
    )
  )
;;;  (setvar "osmode" old_osmod)
  (HY_Set1)
;;;  (setvar "osmode" w_osmode)
  (princ)
)

;;;禁止路边停放线---0
;;;非机动车禁驶线---1
;;;网状线-----------2
(defun ?jt_bx_jzlbtf (sty	  /	      ent	  line_wid
		      old_osmod	  line_sty    ptb	  pt1
		      pt2	  ang	      dist	  ent1
		      ?dljtss_bx_hatch_sub11	  ;;;  w_osmode
		     )
					;;;把hatch炸开并加粗
;;;  (setq w_osmode (getvar "osmode"))					
  (defun ?dljtss_bx_hatch_sub11	(ent wid color / s_ent s_ss s_len s_n)
    (setq s_ent (ent_last))
    (HY_KZSJXZ ent nil 62 color)
    (command "explode" ent)
    (setq s_ss	(get_last s_ent)
	  s_len	(sslength s_ss)
	  s_n	0
    )
    (while (< s_n s_len)
      (setq s_ent (ssname s_ss s_n))
      (command ".pedit" s_ent "y" "w" wid "")
      (HY_KZSJXZ (entlast) nil 8 "PP-DL-JTBX")
      (setq s_n (1+ s_n))
    )
  )

  (HY_Set0)
  ;;;;(setq old_osmod (getvar "osmode"))
  (if (null (tblsearch "ltype" "JTSS02"))
    (command ".linetype" "l" "JTSS02" "DLJTXX" "")
  )
  (if (null ?jtssbx_draw_pline)
    (#ppls "dljtbx")
  )
;;;(DL_MakeLayer "pp-dl-jtbx")
;;;2002-11-25 由王志宇修
  (if (null (tblsearch "LAYER" "PP-DL-JTBX"))
    (command "layer" "m" "PP-DL-JTBX" "")
    (command "layer" "s" "PP-DL-JTBX" "")
  )

  (cond
    ((= sty 0)
     (setq line_wid 0.15)
 ;;;;    (setvar "osmode" 545)
     (initget "A")
     (setq line_sty (getkword "\n虚线A /<实线>:"))
    )
    ((= sty 1)
     (setq line_sty "A"
	   line_wid 0.2
     )
    )
    ((= sty 2)
     (setq line_sty nil
	   line_wid 0.2
     )
    )
  )

  (while (and (setq ent (?jtssbx_draw_pline)) (/= sty 2))
    (HY_Set0)
    (if	(= line_sty "A")
      (progn
	(HY_KZSJXZ ent nil 43 line_wid 8 "PP-DL-JTBX" 6 "JTSS02" 62 2)
	(command ".chprop" ent "" "s" 1 "")
      )
      (progn
	(HY_KZSJXZ ent nil 43 line_wid 8 "PP-DL-JTBX" 62 2)
      )
    )
  )


;;;网状线
  (if (and ent (= sty 2))
    (progn
      (HY_Set0)
      (setq ptb (bg-ypp ent))
      (if (> (length ptb) 2)
	(progn
	  (HY_KZSJXZ ent nil 43 line_wid 8 "PP-DL-JTBX" 62 2 70 1)
	  (setq	pt1 (car ptb)
		pt2 (cadr ptb)
		ang (rtod (angle pt1 pt2))
	  )
	  (initget 6 "A")
	  (setq dist (getreal "\n简化网状线A /请输入斜线间隔<2>:"))
	  (if (null dist)
	    (setq dist 2.0)
	  )
	  (if (/= "A" dist)
	    (progn
	      (setq dist (* dist 0.314961))
	      (setq ent1 (entlast))
	      (HY_SV)
	      (command ".hatch" "NET" dist (+ ang 45) ent "")
	      (HY_RV)
	      (setq ent (entlast))
	      (if (equal ent ent1)
		(print "\n填充不成功!")
		(?dljtss_bx_hatch_sub11 ent 0.1 2)
	      )
	    )
	    (progn
	      (HY_SV)
	      (HY_KZSJXZ ent nil 43 0.4)
	      (command ".pline" pt1 (nth 2 ptb) "")
	      (HY_KZSJXZ (entlast) nil 43 0.4 8 "PP-DL-JTBX" 62 2)
	      (command ".pline" pt2 (nth 3 ptb) "")
	      (HY_KZSJXZ (entlast) nil 43 0.4 8 "PP-DL-JTBX" 62 2)
	      (HY_RV)
	    )
	  )
	)
	(progn
	  (princ "\n网状线不闭合!")
	  (entdel ent)
	)
      )
    )
  )

 ;;; (setvar "osmode" old_osmod)
  (HY_Set1)
 ;;;; (setvar "osmode" w_osmode)
  (princ)
)

;;;停车让行线-----1
;;;减速让行线-----2
;;;禁止掉头标记---3
(defun ?jt_bx_rxx (sty	     /	       dcl_id	 what	   xx
		   blk_scale pt	       line_wid	 old_plinewid
		   ang	     dis       ent	 loop	   pt1
		   jd_pt     path	
		  )

  (HY_Set0)
  (if (null pub_arrow_wmk)
    (#ppls "wwpublic")
  )
  (if (null ?jtssbx_select_pline)
    (#ppls "dljtbx1")
  )
  (setq	old_plinewid
	(getvar "plinewid")
	line_wid 0.2
  )

;;;;2002-11-25 16:00由王志宇修改
;;;(DL_MakeLayer "pp-dl-jtbx")
  (if (null (tblsearch "LAYER" "PP-DL-JTBX"))
    (command "layer" "m" "PP-DL-JTBX" "")
    (command "layer" "s" "PP-DL-JTBX" "")
  )




  (setvar "plinewid" line_wid)

  (cond
    ((= sty 3)
     (setq what "H")
    )
    (t
     (initget "H")
     (setq what (getkword "\n绘标志H /<回车绘线>:"))
    )
  )

  (cond
    ((null what)
;;;绘制
     (HY_SV)
     (sa_osmode)
     (setvar "osmode" 544)
     (setq
       jd_pt
	(getpoint "\n回车退出 /请点取计算停止线位置的基点:")
     )
     (re_osmode)
     (if jd_pt
       (progn
	 (initget 1)
	 (setq
	   ang (getangle jd_pt "\n请点取计算停止线位置的方向:")
	 )
	 (pub_arrow_wmk jd_pt ang)
	 (initget 1)
	 (setq dis (getdist "\n请输入停止线距基点的距离(m):"))
	 (entdel (entlast))
	 (setq pt (polar jd_pt ang dis))
	 (pan2v pt)
	;;;;; (setvar "osmode" 0)
	 (setvar "snapang" ang)
	 (setvar "orthomode" 1)
	 (initget 1)
	 (setq pt1 (getpoint pt "\n请点取停止线的终点"))
	 (setvar "snapang" 0)
	 (setvar "orthomode" 0)
	 (command ".pline" pt pt1 "")
	 (cond
	   ((= sty 1)
	    (command ".copy" (entlast) "" pt (polar pt ang 0.4))
	   )
	   ((= sty 2)
	    (setq ent (entlast))
	    (if	(null (tblsearch "ltype" "JTSS03"))
	      (command ".linetype" "l" "JTSS03" "DLJTXX" "")
	    )
	    (HY_KZSJXZ ent nil 8 "PP-DL-JTBX" 6 "JTSS03")
	    (command ".chprop" ent "" "s" 0.2 "")
	    (command ".copy" ent "" pt (polar pt ang 0.4))
	   )
	 )
       )
     )
     (HY_RV)
    )
    ((= "H" what)
     (cond
       ((= sty 1)
	(if (= (tblsearch "style" "DLWZ1") nil)
	  (progn
	    (command "-style" "DLWZ1" "simhei.ttf" "0.0" 0.4 "" "" "")
	    (if	(= (logand (getvar "cmdactive") 1) 1)
	      (command "")
	    )
	  )
	)

	(setq pt (getpoint "\n回车退出 /请点取文字放置点:"))
	(if pt
	  (progn
	    (command "text" "s" "DLWZ1" "J" "mc" pt 2.5 0 "停")
	    (HY_KZSJXZ (entlast) nil 8 "PP-DL-WZ")
	    (setq ang (#setangpt pt "请确定文字"))
	    (command ".rotate" (entlast) "" pt (- (rtod ang) 90))
	  )
	)
	(setvar "snapang" 0)
	(setvar "orthomode" 0)
       )
       ((= sty 2)
	(setq pt (getpoint "\n回车退出 /请点取减速让行标志放置点:"))
	(if pt
	  (progn
	    (command ".insert"
		     (strcat (HY_GetInstallDir) "Commres\\block\\bx_jsrx");;;2002年11月由王志宇修改
		     pt
		     1
		     1.3
		     0
	    )
	    (setq ang (#setangpt pt "请确定减速让行标志"))
	    (command ".rotate" (entlast) "" pt (+ 90 (rtod ang)))
	  )
	)
	(setvar "snapang" 0)
	(setvar "orthomode" 0)
       )


;;;;;;;;;以下2002年11月由王志宇修改
       ((= sty 3)
	(setq pt (getpoint "\n回车退出 /请点取禁止掉头标记放置点:"))
	(setq path (strcat (HY_GetInstallDir) "Commres\\block\\bx_jzdt"))
	(if pt
	  (progn
	    (setvar "orthomode" 0)
	    (princ "\n请输入角度<0>:")
	    (command ".insert"
		     path
		     pt
		     1
		     1
		     pause
	    )
	    (setvar "orthomode" 1)
;;	    (command ".insert"
;;		     (strcat (HY_GetInstallDir) "sys\\bx_jzdt")
;;		     pt
;;		     1
;;		     1
;;		     0
;;	    )
;;	    (setq ang (#setangpt pt "请确定禁止掉头标记"))
;;	    (command ".rotate" (entlast) "" pt (rtod ang))
	  )
	)
	(setvar "snapang" 0)
	(setvar "orthomode" 0)
       )

;;;以上2002年11月由王志宇修改

     )
    )
  )

  (setvar "plinewid" old_plinewid)
  (HY_Set1)

  (princ)
)

;;;港湾式停靠站标线
(defun ?jt_bx_tkzbx (/ spt ept pt1 pt2 fent ent line_wid  w_osmode)
  (HY_Set0)
  (setq spt (getpoint "\n回车退出 /请点取港湾式停靠站标线起点:"))
  (if spt
    (progn
      (setq
	ept (getpoint spt "\n回车退出 /请点取港湾式停靠站标线终点:")
      )
      (if ept
	(progn
;;;(DL_MakeLayer "PP-DL-JTBX")

;;;;2002-11-25 16:00由王志宇修改
;;;(DL_MakeLayer "PP-DL-JTBX")
	  (if (null (tblsearch "LAYER" "PP-DL-JTBX"))
	    (command "layer" "m" "PP-DL-JTBX" "")
	    (command "layer" "s" "PP-DL-JTBX" "")
	  )
	  (setq line_wid 0.45)
	  (HY_SV)
	  (command ".line" spt ept "")
	  (setq fent (entlast))
	  (sa_osmode)
	  (setvar "osmode" 545)
	  (setq pt1 (getpoint spt "\n请点取标线该端虚线段:"))
	  (if (null pt1)
	    (setq pt1 spt)
	  )
	  (setq pt2 (getpoint ept "\n请点取标线该端虚线段:"))
	  (if (null pt2)
	    (setq pt2 ept)
	  )
	  (re_osmode)
	 ;;;; (setvar "osmode" 0)
	  (if (not (equal spt pt1 0.1))
	    (progn
	      (command ".pline" spt pt1 "")
	      (setq ent (entlast))
	      (if (null (tblsearch "LTYPE" "JTSS02"))
		(command ".linetype" "l" "JTSS02" "DLJTXX" "")
	      )
	      (HY_KZSJXZ ent      nil	43	 line_wid 8
		      "PP-DL-JTBX"	6	 "JTSS02" 62
		      7
		     )
	      (command ".chprop" ent "" "s" 1 "")
	    )
	  )
	  (if (not (equal pt1 pt2 0.1))
	    (progn
	      (command ".pline" pt2 pt1 "")
	      (setq ent (entlast))
	      (HY_KZSJXZ ent	nil	  43	    line_wid  8
		      "PP-DL-JTBX"	  6	    "CONTINUOUS"
		      62	7
		     )
	    )
	  )
	  (if (not (equal ept pt2 0.1))
	    (progn
	      (command ".pline" ept pt2 "")
	      (setq ent (entlast))
	      (if (null (tblsearch "ltype" "JTSS02"))
		(command ".linetype" "l" "JTSS02" "DLJTXX" "")
	      )
	      (HY_KZSJXZ ent      nil	43	 line_wid 8
		      "PP-DL-JTBX"	6	 "JTSS02" 62
		      7
		     )
	      (command ".chprop" ent "" "s" 1 "")
	    )
	  )
	  (HY_RV)
	  (entdel fent)
	)
      )
    )
  )
  (HY_Set1)
;;;  (setvar "osmode" w_osmode)
  (princ)
)

;;;左转弯导向线
(defun ?jt_bx_zzwdxx (/ spt ept line_wid old_osmod)
  (HY_Set0)
  (sa_osmode)
  (setvar "osmode" 545)
  (setq spt (getpoint "\n回车退出 /请点取左转弯导向线起点:"))
  (if spt
    (progn
      (setq ept (getpoint "\n回车退出 /请点取左转弯导向线终点:"))
      (re_osmode)
      (if ept
	(progn
	  (setq line_wid 0.15)


;;;;2002-11-25 16:00由王志宇修改
;;;(DL_MakeLayer "PP-DL-JTBX")
	  (if (null (tblsearch "LAYER" "PP-DL-JTBX"))
	    (command "layer" "m" "PP-DL-JTBX" "")
	    (command "layer" "s" "PP-DL-JTBX" "")
	  )
	  (if (null (tblsearch "ltype" "JTSS02"))
	    (command ".linetype" "l" "JTSS02" "DLJTXX" "")
	  )
	;;;;;  (setvar "osmode" 0)
	  (command ".pline" spt "a" ept "")
	  (HY_KZSJXZ (entlast)
		  nil
		  43
		  line_wid
		  8
		  "PP-DL-JTBX"
		  6
		  "JTSS02"
		  62
		  7
	  )
	  (command ".chprop" (entlast) "" "s" 2 "")
	  (princ "\n如该标线的形状有误,可直接拉伸修改!")
	)
      )
    )
  )
 ;;;(setvar "osmode" old_osmod)
  (HY_Set1)
  
)

;;;中心圈
(defun ?jt_bx_zxq (/		  pt		 wid
		   old_osmod	  ent		 hatch_scale
		   ?dljtss_bx_hatch_sub12	 hatch_wid)
  (defun ?dljtss_bx_hatch_sub12	(ent wid color / s_ent s_ss s_len s_n)
    (setq s_ent (ent_last))
    (HY_KZSJXZ ent nil 62 color)
    (command "explode" ent)
    (setq s_ss	(get_last s_ent)
	  s_len	(sslength s_ss)
	  s_n	0
    )
    (while (< s_n s_len)
      (setq s_ent (ssname s_ss s_n))
      (command ".pedit" s_ent "y" "w" wid "")
      (HY_KZSJXZ (entlast) nil 8 "PP-DL-JTBX")
      (setq s_n (1+ s_n))
    )
  )

  (HY_Set0)
  (setq	;;;old_osmod   (getvar "osmode")
	hatch_scale 0.141732
	hatch_wid   0.15
  )
  (setq pt (getpoint "\n回车退出 /请点取中心圈放置点:"))
  (if pt
    (progn
      (setq wid (getdist pt "\n请输入中心圈的半径:<2>"))
      (if (null wid)
	(setq wid 2.0)
      )
   ;;;;   (setvar "osmode" 0)
      (command ".circle" pt wid)
      (setq ent (entlast))
      (command ".hatch"
	       "ANSI31"
	       hatch_scale
	       90
	       ent
	       ""
      )
      (if (equal ent (entlast))
	(prompt "\n填充没有成功.")
	(progn
	  (?dljtss_bx_hatch_sub12 (entlast) hatch_wid 7)
	  (entdel ent)
	  (command ".arc" "c" pt (polar pt 0 wid) "a" -359.9)
	  (setq ent (entlast))
	  (command ".pedit" ent "y" "w" hatch_wid "")
;;;;(DL_MakeLayer "pp-dl-jtbx")

;;;;2002-11-25 16:00由王志宇修改
;;;(DL_MakeLayer "PP-DL-JTBX")
	  (if (null (tblsearch "LAYER" "PP-DL-JTBX"))
	    (command "layer" "m" "PP-DL-JTBX" "")
	    (command "layer" "s" "PP-DL-JTBX" "")
	  )


	  (HY_KZSJXZ (entlast) nil 8 "PP-DL-JTBX")
	)
      )
    )
  )
 ;;;; (setvar "osmode" old_osmod)
  (HY_Set1)
  (princ)
)
