(if (or	(not ZX:mlnfile->data)
	(not ZX:addmlstyle)
	(not ZX:Mlinestyle-Get)
	(not ZX:getpath-XX)
	(not ZX:jzxx)
	(not ZX:jzdxys)
	(not INSERTBLK-XX)
    )
  (or (and (findfile (STRCAT (getvar "mydocumentsprefix")
			     "\\中线CAD用户配置\\loadmline.LSP"
		     )
	   )
	   (load (findfile (STRCAT (getvar "mydocumentsprefix")
				   "\\中线CAD用户配置\\loadmline.LSP"
			   )
		 )
	   )
      )
      (and (findfile (STRCAT (getvar "mydocumentsprefix")
			     "\\中线CAD用户配置\\"
			     (getvar "CPROFILE")
			     "\\loadmline.LSP"
		     )
	   )
	   (load (findfile (STRCAT (getvar "mydocumentsprefix")
				   "\\中线CAD用户配置\\"
				   (getvar "CPROFILE")
				   "\\loadmline.LSP"
			   )
		 )
	   )
      )
      (and (findfile "loadmline.LSP") (load "loadmline.LSP"))
  )
)					;加载依赖的程序

(defun getmidpointofdismax
       (pts dis / dislst pos p1 p2 midpt ang pt1 pt2)
  ;(setq a(getpoints 360))(getmidpointofdismax a 10)
  (if (> (length pts) 1)
    (progn (setq dislst	(mapcar	'(lambda (a b)
				   (distance a b)
				 )
				pts
				(cdr pts)
			)
	   )
	   (setq pos (vl-position (apply 'max dislst) dislst))
	   (setq midpt (mapcar '(lambda	(a b)
				  (* 0.5 (+ a b))
				)
			       (setq p1 (nth pos pts))
			       (setq p2 (nth (1+ pos) pts))
		       )
	   )
	   (setq ang (angle p1 p2))
	   (setq pt1 (polar midpt (+ ang (* 0.5 pi)) dis))
	   (setq pt2 (polar midpt (- ang (* 0.5 pi)) dis))
	   (if (= (cadr pt1) (cadr pt2))
	     (setq pt (car (vl-sort (list pt1 pt2)
				    (function (lambda (e1 e2)
						(> (car e1) (car e2))
					      )
				    )
			   )
		      )
	     )
	     (setq pt
		    (car
		      (vl-sort (vl-sort	(list pt1 pt2)
					(function (lambda (e1 e2)
						    (> (car e1) (car e2))
						  )
					)
			       )
			       (function (lambda (e1 e2)
					   (> (cadr e1) (cadr e2))
					 )
			       )
		      )
		    )
	     )
	   )
;;;	   (command "line" pt)
;;;	   pt
    )
  )
)

(defun getpoints (n / pt pts ang dis pt0 pts0 ang0 diss0 ptsshow)
					;(getpoints 360)将360平分成8段，这里传入参数如果是数字4，将是正交模式
  (if (and n (> n 0) (= (type n) 'int))
    (progn
      (setq ang (/ (* pi 2.0) (* 1.0 n)))
      (setq pt (getpoint))
      (while pt
	(setq pts (cons pt pts))
	(setq pt (getpoint (car pts)))
	(if pt
	  (progn
	    (setq dis (distance pt (car pts)))
	    (setq ang0 0)
	    (repeat n
	      (setq pt0 (polar (car pts) ang0 dis))
	      (setq pts0 (cons pt0 pts0))
	      (setq ang0 (+ ang0 ang))
	    )
	    (setq diss0	(mapcar	'(lambda (x)
				   (distance x pt)
				 )
				pts0
			)
	    )
	    (setq pt (nth (vl-position (apply 'min diss0) diss0) pts0))
	    (setq
	      ptsshow (append ptsshow
			      (list 7)
			      (list (car pts))
			      (list pt)
		      )
	    )
	    (grvecs ptsshow)
	  )
	)
      )
    )
  )
  pts
)
(DEFUN POINTLST	(/ pt ptlst)
  (while (if ptlst
	   (setq pt (getpoint (car ptlst) "\n指定下一个点: "))
	   (setq pt (getpoint "指定第一点: "))
	 )
    (setq ptlst (cons pt ptlst))
    (if	(> (length ptlst) 1)
      (grvecs (apply 'append
		     (mapcar '(lambda (x y)
				(list 7 y x)
			      )
			     (reverse ptlst)
			     (cdr (reverse ptlst))
		     )
	      )
      )
    )
  )
  ptlst
)
;;;;;;;;;;;;;;;;;;;;  ;选择集转为图元list列表
(defun ssToentlst (ss / entlst n)
  (IF (AND (/= SS NIL)
	   (= (TYPE SS) 'PICKSET)
      )
    (PROGN
      (setq n -1)
      (repeat (sslength ss)
	(setq entlst (cons (ssname ss (setq n (1+ n))) entlst))
      )
      (reverse entlst)
    )
    SS
  )
)
(defun Get_all_attribValue-xx (ent_or_obj
			       /
			       obj
			      )
;;;  示例：(Get_all_attribValue-xx (car (entsel)))
;;;  结果：(("属性标签1" . "属性值1")("属性标签2" . "属性值2")...);_属性标签和属性值的关联表
  (if (or (= 'ENAME (type ent_or_obj))
	  (= 'VLA-OBJECT (type ent_or_obj))
      )
    (progn
      (vl-load-com)
      (if (= 'ENAME (type ent_or_obj))
	(setq obj (vlax-ename->vla-object ent_or_obj))
	(setq obj ent_or_obj)
      )
      (mapcar '(lambda (x)
		 (cons
		   (vla-get-tagstring
		     x
		   )
		   (vla-get-textstring
		     x
		   )
		 )
	       )
	      (vlax-safearray->list
		(vlax-variant-value
		  (vla-GetAttributes obj)
		)
	      )
      )
    )
    nil ;_参数不正确返回nil
  )
)
(defun Put_attribValue-xx (ent_or_obj taglst textlst / obj n)
;;;;;;;;/*{{{*/
  (if (and taglst
	   textlst
	   (listp taglst)
	   (listp textlst)
	   (or (= 'ENAME (type ent_or_obj))
	       (= 'VLA-OBJECT (type ent_or_obj))
	   )
	   (apply 'and
		  (mapcar '(lambda (e)
			     (= 'STR (type e))
			   )
			  (append taglst textlst)
		  )
	   )
      )
    (progn
      (vl-load-com)
      (if (= 'ENAME (type ent_or_obj))
	(setq obj (vlax-ename->vla-object ent_or_obj))
	(setq obj ent_or_obj)
      )
      (mapcar '(lambda (x)
		 (if (setq n (vl-position (vla-Get-tagstring x) taglst))
		   (if (nth n textlst)
		     (vla-put-textstring
		       x
		       (nth n textlst)
		     )
		   )
		 )
	       )
	      (vlax-safearray->list
		(vlax-variant-value
		  (vla-GetAttributes obj)
		)
	      )
      )
    )
    (PRINT "Put_attribValue-xx 参数不正确") ;_参数不正确返回nil
  )
)
(defun insert-blk-fw-XX	(pt	   blkname   tag-name  range
			 /	   objnew    ss	       entlst
			 data-ss   i	     ii	       weizhi_value
			 valuelist wzstr
			)
					;注意，这个函数和其他同名 函数有区别，这个 函数有范围检测
					;PT 插入点
					;blkname 块名
					;tag-name 标签
					;range 范围（最主要的作用用来递增；修改以下可以用来判断pt插入点是否还有相同的属性块）
;;;  (insert-blk-fw-XX (getpoint)  "管口符号" "符号"  4.5)
  (setq	ss (ssget "X"
		  (list (cons 0 "INSERT") (cons 2 blkname))
	   )
  )
  (if ss
    (progn
      (setq ii 0)
      (repeat (sslength ss)
	(and
	  (= (vlax-get (vlax-ename->vla-object (ssname ss ii))
		       'name
	     )
	     blkname
	  )
	  (setq	weizhi_value
		 (cdr
		   (assoc tag-name (Get_all_attribValue-xx (ssname ss ii)))
		 )
	  )
	  (setq weizhi_value (atoi (substr weizhi_value 2)))
	  (setq valuelist (append valuelist (list weizhi_value)))
	)
	(setq ii (+ ii 1))
      )
      (if valuelist
	(setq i (+ 1 (apply 'max valuelist)))
	(setq i 1)
      )
      (setq entlst  (ssToentlst ss)
	    data-ss
		    (mapcar '(lambda (x)
			       (if
				 (> (distance
				      pt
				      (cdr (assoc 10 (entget x)))
				    )
				    range
				 )
				  T
				  nil
			       )
			     )
			    entlst
		    )
      )
      (if (apply 'and data-ss)
	(progn (setq objnew
		      (vla-InsertBlock
			(vlax-get-property
			  (vla-get-activedocument (vlax-get-acad-object))
			  (if (= 1 (getvar 'CVPORT))
			    'Paperspace
			    'Modelspace
			  )
			)
			(vlax-3d-point pt)
			blkname
			1
			1
			1
			0
		      )
	       )
	       (if (< i 10)
		 (progn
		   (Put_attribValue-xx
		     objnew
		     (list tag-name)
		     (list (setq wzstr(strcat "J0" (rtos i 2 0))))
		   ) ;_写属性
		 )
		 (progn
		   (Put_attribValue-xx
		     objnew
		     (list tag-name)
		     (list (setq wzstr(strcat "J" (rtos i 2 0))))
		   ) ;_写属性
		 )
	       )
	)
	(if (< i 10)
		 (list (setq wzstr(strcat "J0" (rtos (- i 1) 2 0))))
		 (list (setq wzstr(strcat "J" (rtos (- i 1) 2 0))))
	       )
      )
    )
    (progn (SETQ I 1)
	   (setq objnew
		  (vla-InsertBlock
		    (vlax-get-property
		      (vla-get-activedocument (vlax-get-acad-object))
		      (if (= 1 (getvar 'CVPORT))
			'Paperspace
			'Modelspace
		      )
		    )
		    (vlax-3d-point pt)
		    blkname
		    1
		    1
		    1
		    0
		  )
	   )
	   (if (< i 10)
	     (progn
	       (Put_attribValue-xx
		 objnew
		 (list tag-name)
		 (list (setq wzstr(strcat "J0" (rtos i 2 0))))
	       ) ;_写属性
	     )
	     (progn
	       (Put_attribValue-xx
		 objnew
		 (list tag-name)
		 (list (setq wzstr(strcat "J" (rtos i 2 0))))
	       ) ;_写属性
	     )
	   )
    )
  )
  wzstr
)
(defun ZX-MAKELINE (ptlst	 para	      /		   i
		    s-data	 e-data	      line-data	   pt-s
		    pt-e	 ang	      ang-s	   ang-e
		    blkname-s	 blkname-e    scale-s	   scale-e
		    line-pt-s	 line-pt-e    line-pt-x	   line-pt-lst
		    offset-s	 offset-e     line-type	   hatch-a
		    hatch-n	 hatch-s      hatch-w	   hatch-l
		    line-s	 hatch-a-s    hatch-offset-0
		    hatch-offset-1	      hatch-offset-2
		    ptlst-1	 ptlst-2      ptlst-1-1	   ptlst-2-2
		    ml-obj	 offset-blk-s offset-blk-e pt-blk-s
		    pt-blk-e	 ent	      obj-s	   obj-e
		    blk-name	 tag-name MEASUREMENT-old
		   )
  (SETVAR 'LTSCALE 2)			;设定全局比例因子
  (setvar 'CMLJUST 1)			;居中
  (setvar 'cmlscale 1)			;宽度默认值
  (setvar 'CELTSCALE 1)			;设置当前线型比例
  (setq	s-data	  (car para)
	e-data	  (cadr para)
	line-data (last para)
  )
  (setq	pt-s	     (car ptlst)
	pt-e	     (last ptlst)
	blkname-s    (cdr (assoc "起点块名" s-data))
	blkname-e    (cdr (assoc "终点块名" e-data))
	scale-s	     (cdr (assoc "起点块比例" s-data))
	scale-e	     (cdr (assoc "终点块比例" e-data))
	offset-s     (cdr (assoc "起点偏移量" s-data))
	offset-e     (cdr (assoc "终点偏移量" e-data))
	offset-blk-s (cdr (assoc "起点块偏移量" s-data))
	offset-blk-e (cdr (assoc "终点块偏移量" e-data))
	line-type    (strcase (cdr (assoc "线型" line-data)))
	blk-name     (cdr (assoc "端点块名-属性块" s-data))
	tag-name     (cdr (assoc "端点块名-属性标签" s-data))
  )
  (mapcar '(lambda (a)
	     (if (AND a
		      (/= a "")
		      (not (tblsearch "block" a))
		 )
	       (progn (Insertblk-xx a '(0 0 0) 1 1 1 0)
		      (entdel (entlast))
	       )
	     )
	   )
	  (list blk-name blkname-s blkname-e)
  )
  (setq	ang-s (angle pt-s (cadr ptlst))
	ang-e (angle pt-e (nth (- (length ptlst) 2) ptlst))
  )
  (setq	pt-blk-s (polar pt-s ang-s offset-blk-s)
	pt-blk-e (polar pt-e ang-e offset-blk-e)
  )
  (setq	line-pt-s (polar pt-blk-s ang-s offset-s)
	line-pt-e (polar pt-blk-e ang-e offset-e)
  )
  (setq ptlst (subst line-pt-s pt-s ptlst))
  (setq ptlst (subst line-pt-e pt-e ptlst))
  (cond
    ((= line-type "LINE")
     (setq line-s (cdr (assoc "线型比例" line-data)))
     (mapcar '(lambda (pt1 pt2)
		(setq ent (entmakex
			    (vl-remove nil
				       (list
					 (cons 0 "LINE")
					 (cons 100 "AcDbEntity")
					 (cons 100 "AcDbLine")
					 (cons 10 pt1)
					 (cons 11 pt2)
					 (cons 48 line-s)
					 (cons 8 (getvar 'clayer))
				       )
			    )
			  )
		)
	      )
	     ptlst
	     (cdr ptlst)
     )
    )
    ((= line-type "PLINE")
     (setq line-s (cdr (assoc "线型比例" line-data)))
     (setq ent (entmakex
		 (append
		   (list
		     (cons 0 "LWPOLYLINE")
		     (cons 100 "AcDbEntity")
		     (cons 100 "AcDbPolyline")
		     (cons 90 (length ptlst))
		     (cons 48 line-s)
		     (cons 8 (getvar 'clayer))
		   )
		   (mapcar
		     '(lambda (x) (cons 10 x))
		     ptlst
		   )
		 )
	       )
     )
    )
    ((= line-type "MLINE")
					;(alert "未实现此功能")
     (setq line-s (cdr (assoc "线型比例" line-data)))
     (if ZX:jzdxys
       (ZX:jzdxys (cdr (assoc "样式名" line-data)))
       (alert "loadmline.lsp  缺失！")
     )					;加载mln多线     
					;(setvar 'CMLSTYLE (cdr (assoc "样式名" line-data)))
     (setq ent (vla-addmline
		 (vlax-get-property
		   (vla-get-activedocument (vlax-get-acad-object))
		   (if (= 1 (getvar 'CVPORT))
		     'Paperspace
		     'Modelspace
		   )
		 )
		 (vlax-make-variant
		   (vlax-safearray-fill
		     (vlax-make-safearray
		       vlax-vbDouble
		       (cons 1 (* 3 (length ptlst)))
		     )
		     (apply 'append ptlst)
		   )
		 )
	       )
     )
     (vla-put-LinetypeScale ent line-s)
     (vla-put-MLineScale
       ent
       (cdr (assoc "多线比例" line-data))
     )
    )
    ((= line-type "HATCH")
     (SETQ MEASUREMENT-OLD(GETVAR 'MEASUREMENT));这个值会影响填充比例的最终效果，也就是会显得密和疏松
     (if(/= MEASUREMENT-OLD 0)(sETVAR 'MEASUREMENT 0))
     (setq hatch-a (cdr (assoc "填充角度" line-data))
	   hatch-n (strcase (cdr (assoc "填充名称" line-data)))
	   hatch-s (cdr (assoc "填充比例" line-data))
	   hatch-w (* 0.5 (cdr (assoc "填充宽度" line-data)))
     )
     (setq hatch-offset-0
	    (vlax-ename->vla-object
	      (entmakex
		(append
		  (list
		    (cons 0 "LWPOLYLINE")
		    (cons 100 "AcDbEntity")
		    (cons 100 "AcDbPolyline")
		    (cons 90 (length ptlst))
		  )
		  (mapcar
		    '(lambda (x) (cons 10 x))
		    ptlst
		  )
		)
	      )
	    )
     )
     (setq hatch-offset-1
	    (vl-catch-all-apply
	      'vla-offset
	      (list hatch-offset-0 hatch-w)
	    )
     )
     (setq hatch-offset-2
	    (vl-catch-all-apply
	      'vla-offset
	      (list hatch-offset-0 (- 0 hatch-w))
	    )
     )
     (if (or (vl-catch-all-error-p hatch-offset-1)
	     (vl-catch-all-error-p hatch-offset-2)
	     (>	(length	(vlax-safearray->list
			  (vlax-variant-value
			    hatch-offset-1
			  )
			)
		)
		1
	     )
	     (>	(length	(vlax-safearray->list
			  (vlax-variant-value
			    hatch-offset-2
			  )
			)
		)
		1
	     )
	 )
       (progn
	 (vla-delete hatch-offset-0)
	 (if (vl-catch-all-error-p hatch-offset-1)
	   nil
	   (mapcar 'vla-delete
		   (vlax-safearray->list
		     (vlax-variant-value
		       hatch-offset-1
		     )
		   )
	   )
	 )
	 (if (vl-catch-all-error-p hatch-offset-2)
	   nil
	   (mapcar 'vla-delete
		   (vlax-safearray->list
		     (vlax-variant-value
		       hatch-offset-2
		     )
		   )
	   )
	 )
	 (alert "选择的点不能生成剖面线！")
       )
       (progn
	 (setq ptlst-1 (vlax-safearray->list
			 (vlax-variant-value
			   (vlax-get-property
			     (setq hatch-offset-1
				    (car (vlax-safearray->list
					   (vlax-variant-value
					     hatch-offset-1
					   )
					 )
				    )
			     )
			     'Coordinates
			   )
			 )
		       )
	 )
	 (progn	(setq i 0)
		(repeat	(/ (length ptlst-1) 2)
		  (setq
		    ptlst-1-1 (cons (list (nth i ptlst-1)
					  (nth (setq i (1+ i)) ptlst-1)
				    )
				    ptlst-1-1
			      )
		  )
		  (setq i (1+ i))
		)
	 )
	 (setq ptlst-2 (vlax-safearray->list
			 (vlax-variant-value
			   (vlax-get-property
			     (setq hatch-offset-2
				    (car (vlax-safearray->list
					   (vlax-variant-value
					     hatch-offset-2
					   )
					 )
				    )
			     )
			     'Coordinates
			   )
			 )
		       )
	 )
	 (progn	(setq i 0)
		(repeat	(/ (length ptlst-2) 2)
		  (setq
		    ptlst-2-2 (cons (list (nth i ptlst-2)
					  (nth (setq i (1+ i)) ptlst-2)
				    )
				    ptlst-2-2
			      )
		  )
		  (setq i (1+ i))
		)
	 )
	 (vla-delete hatch-offset-0)
	 (vla-delete hatch-offset-1)
	 (vla-delete hatch-offset-2)
	 (setq hatch-l (append (reverse ptlst-1-1) ptlst-2-2))
	 (setq hatch-l (list hatch-l))
	 (setq ent
		(entmakex
		  (apply
		    'append
		    (list
		      (list '(0 . "HATCH")
			    '(100 . "AcDbEntity")
			    '(100 . "AcDbHatch")
			    '(10 0.0 0.0 0.0)
			    '(210 0.0 0.0 1.0)
			    (cons 2 hatch-n)
			    (if	(= hatch-n "SOLID")
			      '(70 . 1)
			      '(70 . 0)
			    )
			    '(71 . 0)
			    (cons 91 (length hatch-l))
		      )
		      (apply
			'append
			(mapcar
			  '(lambda (a)
			     (apply
			       'append
			       (list (list '(92 . 7)
					   '(72 . 0)
					   '(73 . 1)
					   (cons 93 (length a))
				     )
				     (mapcar '(lambda (b) (cons 10 b)) a)
				     '((97 . 0))
			       )
			     )
			   )
			  hatch-l
			)
		      )
		      (list '(75 . 0)
			    '(76 . 1)
			    (cons 52 hatch-a)
			    (cons 41 hatch-s)
			    '(77 . 0)
			    '(78 . 1)
			    (cons 53 hatch-a)
			    '(43 . 0.)
			    '(44 . 0.)
			    '(45 . 1.)
			    '(46 . 1.)
			    '(79 . 0)
			    '(47 . 1.)
			    '(98 . 2)
			    '(10 0. 0. 0.)
			    '(10 0. 0. 0.)
			    '(451 . 0)
			    '(460 . 0.0)
			    '(461 . 0.0)
			    '(452 . 1)
			    '(462 . 1.0)
			    '(453 . 2)
			    '(463 . 0.0)
			    '(463 . 1.0)
			    '(470 . "LINEAR")
		      )
		    )
		  )
		)
	 )
       )
     )
     (sETVAR 'MEASUREMENT MEASUREMENT-old)
    )
    (t nil)
  )
  (if ent
    (progn
      (IF (/= blk-name "")
	(setq obj-s (insert-blk-fw-XX pt-s blk-name tag-name 4.5) ;_起点块
	      obj-e (insert-blk-fw-XX pt-e blk-name tag-name 4.5) ;_终点块
	)
      )
      (if (/= "" blkname-s)
	(vla-InsertBlock
	  (vlax-get-property
	    (vla-get-activedocument (vlax-get-acad-object))
	    (if	(= 1 (getvar 'CVPORT))
	      'Paperspace
	      'Modelspace
	    )
	  )
	  (vlax-3d-point pt-blk-s)
	  blkname-s
	  scale-s
	  scale-s
	  scale-s
	  ang-s
	)
      )
      (if (/= "" blkname-e)
	(vla-InsertBlock
	  (vlax-get-property
	    (vla-get-activedocument (vlax-get-acad-object))
	    (if	(= 1 (getvar 'CVPORT))
	      'Paperspace
	      'Modelspace
	    )
	  )
	  (vlax-3d-point pt-blk-e)
	  blkname-e
	  scale-e
	  scale-e
	  scale-e
	  ang-e
	)
      )
    )
    (progn(alert "未绘制线型！")nil)
  )
  (list obj-s obj-e)
)

(defun ZX-insert-jdcd-xx	(wzlst pianyi / wzlst pt jdcdreal)
					;绘制线型同时插入节点长度
  ;wzlst节点长度的两点位置的值list格式
  ;pianyi节点长度的偏移距离
  (and ptlst
       pianyi
       (progn     (AND (= (LENGTH wzlst) 2)
		   (setq pt (getmidpointofdismax ptlst pianyi))
		   (setq jdcdreal (getreal (strcat "请输入  "
						   (IF (CAR wzlst)
						     (CAR wzlst)
						     ""
						   )
						   "  与  "
						   (IF (CADR wzlst)
						     (CADR wzlst)
						     ""
						   )
						   "  之间的距离长度"
					   )
				  )
		   )
		   (or (Insertblk-xx "节点长度" pt 1 1 1 0) t)
		   (or (Put_attribValue-XX
			 (entlast)
			 (list "E1" "E2" "L")
			 (list (IF (CAR wzlst)
				 (CAR wzlst)
				 ""
			       )
			       (IF (CADR wzlst)
				 (CADR wzlst)
				 ""
			       )
			       (vl-princ-to-string jdcdreal)
			 )
		       )
		       t
		   )
	      )
       )
  )
)





;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(defun c:PVCHC (/ ptlst para code OLDML wzlst) ;PVC胶带花缠
  (SETQ OLDML (Getvar "cmlstyle"))
  (setq	para (list (list
		     (cons "起点块名" "XXQZD-HC")
		     (cons "起点块比例" 1)
		     (cons "起点偏移量" 0) ;_块和线的偏移距离
		     (cons "起点块偏移量" 3) ;_块和选择起点的偏移距离
		     (cons "端点块名-属性块" (if(=(getenv "ZX-XXFZD")"1")"分支点" "")) ;插入分支点
		     (cons "端点块名-属性标签" "位置")
					;分支点的标签(主要是方便自动递增的)
		   )
		   (list
		     (cons "终点块名" "XXQZD-HC")
		     (cons "终点块比例" 1)
		     (cons "终点偏移量" 0) ;_块和线的偏移距离
		     (cons "终点块偏移量" 3) ;_块和选择终点的偏移距离
		   )
;;;		   (list (cons "线型" "HATCH")
;;;			 (cons "填充角度" 0)
;;;			 (cons "填充名称" "ANSI31")
;;;			 (cons "填充比例" 1)
;;;			 (cons "填充宽度" 2)
;;;		   )
		   (list (cons "线型" "PLINE") (cons "线型比例" 1))
;;;		   (list (cons "线型" "MLINE")
;;;			 (cons "样式名" "DR-LX")
;;;			 (cons "线型比例" 1)
;;;			 (cons "多线比例" 10)
;;;		   )
	     )
  )
  (or (setq ptlst (reverse (POINTLST)))(and getpoints (setq ptlst (reverse (getpoints 8)))))
  (if (> (length ptlst) 1)
    (progn (setq wzlst (ZX-MAKELINE ptlst para))
	   (and(=(getenv "ZX-XXFZD")"1")(=(getenv "ZX-XXJDCD")"1")(or(ZX-insert-jdcd-xx wzlst 4))t)
    )
  )
  (Setvar "cmlstyle" OLDML)
  (princ)
)






(defun c:PVCQC (/ ptlst para code OLDML wzlst) ;PVC胶带满缠
  (SETQ OLDML (Getvar "cmlstyle"))
  (setq	para (list (list
		     (cons "起点块名" "XXQZD-QC")
		     (cons "起点块比例" 1)
		     (cons "起点偏移量" 0) ;_块和线的偏移距离
		     (cons "起点块偏移量" 3) ;_块和选择起点的偏移距离
		     (cons "端点块名-属性块" (if(=(getenv "ZX-XXFZD")"1")"分支点" "")) ;插入分支点
		     (cons "端点块名-属性标签" "位置")
					;分支点的标签(主要是方便自动递增的)
		   )
		   (list
		     (cons "终点块名" "XXQZD-QC")
		     (cons "终点块比例" 1)
		     (cons "终点偏移量" 0) ;_块和线的偏移距离
		     (cons "终点块偏移量" 3) ;_块和选择终点的偏移距离
		   )
;;;		   (list (cons "线型" "HATCH")
;;;			 (cons "填充角度" 0)
;;;			 (cons "填充名称" "ANSI31")
;;;			 (cons "填充比例" 1)
;;;			 (cons "填充宽度" 2)
;;;		   )
		   (list (cons "线型" "PLINE") (cons "线型比例" 1))
;;;		   (list (cons "线型" "MLINE")
;;;			 (cons "样式名" "DR-LX")
;;;			 (cons "线型比例" 1)
;;;			 (cons "多线比例" 10)
;;;		   )
	     )
  )
  (or(setq ptlst (reverse (POINTLST)))(and getpoints(setq ptlst(reverse (getpoints 8)))))
  (if (> (length ptlst) 1)
    (progn (setq wzlst (ZX-MAKELINE ptlst para))
	   (and(=(getenv "ZX-XXFZD")"1")(=(getenv "ZX-XXJDCD")"1")(or(ZX-insert-jdcd-xx wzlst 4))t))
    )
  (Setvar "cmlstyle" OLDML)
  (princ)
)


(defun c:BPVCD (/ ptlst para code OLDML wzlst) ;闭口PVC管两端点缠
  (SETQ OLDML (Getvar "cmlstyle"))
  (setq	para (list (list
		     (cons "起点块名" "XXQZD-DC")
		     (cons "起点块比例" 1)
		     (cons "起点偏移量" 0) ;_块和线的偏移距离
		     (cons "起点块偏移量" 3) ;_块和选择起点的偏移距离
		     (cons "端点块名-属性块" (if(=(getenv "ZX-XXFZD")"1")"分支点" "")) ;插入分支点
		     (cons "端点块名-属性标签" "位置")
					;分支点的标签(主要是方便自动递增的)
		   )
		   (list
		     (cons "终点块名" "XXQZD-DC")
		     (cons "终点块比例" 1)
		     (cons "终点偏移量" 0) ;_块和线的偏移距离
		     (cons "终点块偏移量" 3) ;_块和选择终点的偏移距离
		   )
;;;		   (list (cons "线型" "HATCH")
;;;			 (cons "填充角度" 0)
;;;			 (cons "填充名称" "ANSI31")
;;;			 (cons "填充比例" 1)
;;;			 (cons "填充宽度" 2)
;;;		   )
;;;		   (list (cons "线型" "PLINE") (cons "线型比例" 1))
		   (list (cons "线型" "MLINE")
			 (cons "样式名" "CCTH-BPVC")
			 (cons "线型比例" 1)
			 (cons "多线比例" 3)
		   )
	     )
  )
  (or(setq ptlst (reverse (POINTLST)))(and getpoints(setq ptlst(reverse (getpoints 8)))))
  (if (> (length ptlst) 1)
    (progn (setq wzlst (ZX-MAKELINE ptlst para))
	   (and(=(getenv "ZX-XXFZD")"1")(=(getenv "ZX-XXJDCD")"1")(or(ZX-insert-jdcd-xx wzlst 4))t))
    )
  (Setvar "cmlstyle" OLDML)
  (princ)
)


(defun c:BPVCH (/ ptlst para code OLDML wzlst) ;闭口PVC管花缠
  (SETQ OLDML (Getvar "cmlstyle"))
  (setq	para (list (list
		     (cons "起点块名" "XXQZD-HC")
		     (cons "起点块比例" 1.5)
		     (cons "起点偏移量" 3) ;_块和线的偏移距离
		     (cons "起点块偏移量" 4.5) ;_块和选择起点的偏移距离
		     (cons "端点块名-属性块" (if(=(getenv "ZX-XXFZD")"1")"分支点" "")) ;插入分支点
		     (cons "端点块名-属性标签" "位置")
					;分支点的标签(主要是方便自动递增的)
		   )
		   (list
		     (cons "终点块名" "XXQZD-HC")
		     (cons "终点块比例" 1.5)
		     (cons "终点偏移量" 3) ;_块和线的偏移距离
		     (cons "终点块偏移量" 4.5) ;_块和选择终点的偏移距离
		   )
;;;		   (list (cons "线型" "HATCH")
;;;			 (cons "填充角度" 0)
;;;			 (cons "填充名称" "ANSI31")
;;;			 (cons "填充比例" 1)
;;;			 (cons "填充宽度" 2)
;;;		   )
;;;		   (list (cons "线型" "PLINE") (cons "线型比例" 1))
		   (list (cons "线型" "MLINE")
			 (cons "样式名" "CCTH-BPVC")
			 (cons "线型比例" 1)
			 (cons "多线比例" 3)
		   )
	     )
  )
  (or(setq ptlst (reverse (POINTLST)))(and getpoints(setq ptlst(reverse (getpoints 8)))))
  (if (> (length ptlst) 1)
    (progn (setq wzlst (ZX-MAKELINE ptlst para))
	   (and(=(getenv "ZX-XXFZD")"1")(=(getenv "ZX-XXJDCD")"1")(or(ZX-insert-jdcd-xx wzlst 4))t))
    )
  (Setvar "cmlstyle" OLDML)
  (princ)
)


(defun c:BPVCQ (/ ptlst para code OLDML wzlst) ;闭口PVC管全缠
  (SETQ OLDML (Getvar "cmlstyle"))
  (setq	para (list (list
		     (cons "起点块名" "XXQZD-QC")
		     (cons "起点块比例" 1.5)
		     (cons "起点偏移量" 1) ;_块和线的偏移距离
		     (cons "起点块偏移量" 4.5) ;_块和选择起点的偏移距离
		     (cons "端点块名-属性块" (if(=(getenv "ZX-XXFZD")"1")"分支点" "")) ;插入分支点
		     (cons "端点块名-属性标签" "位置")
					;分支点的标签(主要是方便自动递增的)
		   )
		   (list
		     (cons "终点块名" "XXQZD-QC")
		     (cons "终点块比例" 1.5)
		     (cons "终点偏移量" 1) ;_块和线的偏移距离
		     (cons "终点块偏移量" 4.5) ;_块和选择终点的偏移距离
		   )
;;;		   (list (cons "线型" "HATCH")
;;;			 (cons "填充角度" 0)
;;;			 (cons "填充名称" "ANSI31")
;;;			 (cons "填充比例" 1)
;;;			 (cons "填充宽度" 2)
;;;		   )
;;;		   (list (cons "线型" "PLINE") (cons "线型比例" 1))
		   (list (cons "线型" "MLINE")
			 (cons "样式名" "CCTH-BPVC")
			 (cons "线型比例" 1)
			 (cons "多线比例" 3)
		   )
	     )
  )
  (or(setq ptlst (reverse (POINTLST)))(and getpoints(setq ptlst(reverse (getpoints 8)))))
  (if (> (length ptlst) 1)
    (progn (setq wzlst (ZX-MAKELINE ptlst para))
	   (and(=(getenv "ZX-XXFZD")"1")(=(getenv "ZX-XXJDCD")"1")(or(ZX-insert-jdcd-xx wzlst 4))t))
    )
  (Setvar "cmlstyle" OLDML)
  (princ)
)


(defun c:BWPD (/ ptlst para1 para2 code OLDML wzlst1 wzlst2) ;波纹管外PVC点缠
  (SETQ OLDML (Getvar "cmlstyle"))
  (setq	para1 (list (list
		      (cons "起点块名" "XXQZD-DC")
		      (cons "起点块比例" 1.5)
		      (cons "起点偏移量" 1) ;_块和线的偏移距离
		      (cons "起点块偏移量" 4.5) ;_块和选择起点的偏移距离
		      (cons "端点块名-属性块" (if(=(getenv "ZX-XXFZD")"1")"分支点" "")) ;插入分支点
		      (cons "端点块名-属性标签" "位置")
					;分支点的标签(主要是方便自动递增的)
		    )
		    (list
		      (cons "终点块名" "XXQZD-DC")
		      (cons "终点块比例" 1.5)
		      (cons "终点偏移量" 1) ;_块和线的偏移距离
		      (cons "终点块偏移量" 4.5) ;_块和选择终点的偏移距离
		    )
;;;		   (list (cons "线型" "HATCH")
;;;			 (cons "填充角度" 0)
;;;			 (cons "填充名称" "ANSI31")
;;;			 (cons "填充比例" 10)
;;;			 (cons "填充宽度" 3)
;;;		   )
;;;		   (list (cons "线型" "PLINE") (cons "线型比例" 1))
		    (list (cons "线型" "MLINE")
			  (cons "样式名" "CCTH-BWGPVC")
			  (cons "线型比例" 1.5)
			  (cons "多线比例" 1.5)
		    )
	      )
  )
  (setq	para2 (list
		(list
		  (cons "起点块名" "")	;块名删除，因为para1里面有块名
		  (cons "起点块比例" 1.5)
		  (cons "起点偏移量" 1) ;_块和线的偏移距离
		  (cons "起点块偏移量" 4.5) ;_块和选择起点的偏移距离
		  (cons "端点块名-属性块" (if(=(getenv "ZX-XXFZD")"1")"分支点" "")) ;插入分支点
		  (cons "端点块名-属性标签" "位置")
					;分支点的标签(主要是方便自动递增的)
		)
		(list
		  (cons "终点块名" "")	;块名删除，因为para1里面有块名
		  (cons "终点块比例" 1.5)
		  (cons "终点偏移量" 1) ;_块和线的偏移距离
		  (cons "终点块偏移量" 4.5) ;_块和选择终点的偏移距离
		)
		(list (cons "线型" "HATCH")
		      (cons "填充角度" 0)
		      (cons "填充名称" "ANSI31")
		      (cons "填充比例" 10)
		      (cons "填充宽度" 3)
		)
;;;		   (list (cons "线型" "PLINE") (cons "线型比例" 1))
;;;		   (list (cons "线型" "MLINE")
;;;			 (cons "样式名" "CCTH-BWGPVC")
;;;			 (cons "线型比例" 1.5)
;;;			 (cons "多线比例" 1.5)
;;;		   )
	      )
  )
  (or(setq ptlst (reverse (POINTLST)))(and getpoints(setq ptlst(reverse (getpoints 8)))))
  (if (> (length ptlst) 1)
    (progn (setq wzlst1 (ZX-MAKELINE ptlst para1))
	   (setq wzlst2 (ZX-MAKELINE ptlst para2))
	   (and	(=(getenv "ZX-XXFZD")"1")(= (getenv "ZX-XXJDCD") "1")
		(or (ZX-insert-jdcd-xx
		      (if wzlst1
			wzlst1
			wzlst2
		      )
		      4
		    )
		)
		t
	   )
    )
  )
  (Setvar "cmlstyle" OLDML)
  (princ)
)


(defun c:BWPQ (/ ptlst para1 para2 code OLDML wzlst1 wzlst2) ;波纹管外PVC全缠
  (SETQ OLDML (Getvar "cmlstyle"))
  (setq	para1 (list (list
		      (cons "起点块名" "XXQZD-QC")
		      (cons "起点块比例" 1)
		      (cons "起点偏移量" 4) ;_块和线的偏移距离
		      (cons "起点块偏移量" 3) ;_块和选择起点的偏移距离
		      (cons "端点块名-属性块" (if(=(getenv "ZX-XXFZD")"1")"分支点" "")) ;插入分支点
		      (cons "端点块名-属性标签" "位置")
					;分支点的标签(主要是方便自动递增的)
		    )
		    (list
		      (cons "终点块名" "XXQZD-QC")
		      (cons "终点块比例" 1)
		      (cons "终点偏移量" 4) ;_块和线的偏移距离
		      (cons "终点块偏移量" 3) ;_块和选择终点的偏移距离
		    )
;;;		   (list (cons "线型" "HATCH")
;;;			 (cons "填充角度" 0)
;;;			 (cons "填充名称" "ANSI31")
;;;			 (cons "填充比例" 10)
;;;			 (cons "填充宽度" 3)
;;;		   )
		   (list (cons "线型" "PLINE") (cons "线型比例" 1))
		    (list (cons "线型" "MLINE")
			  (cons "样式名" "CCTH-BWGPVC")
			  (cons "线型比例" 1.5)
			  (cons "多线比例" 1.5)
		    )
	      )
  )
  (setq	para2 (list (list
		      (cons "起点块名" "")
					;块名删除，因为para1里面有块名
		      (cons "起点块比例" 1)
		      (cons "起点偏移量" 4) ;_块和线的偏移距离
		      (cons "起点块偏移量" 3) ;_块和选择起点的偏移距离
		      (cons "端点块名-属性块" (if(=(getenv "ZX-XXFZD")"1")"分支点" "")) ;插入分支点
		      (cons "端点块名-属性标签" "位置")
					;分支点的标签(主要是方便自动递增的)
		    )
		    (list
		      (cons "终点块名" "")
					;块名删除，因为para1里面有块名
		      (cons "终点块比例" 1)
		      (cons "终点偏移量" 4) ;_块和线的偏移距离
		      (cons "终点块偏移量" 3) ;_块和选择终点的偏移距离
		    )
		    (list (cons "线型" "HATCH")
			  (cons "填充角度" 0)
			  (cons "填充名称" "ANSI31")
			  (cons "填充比例" 10)
			  (cons "填充宽度" 3)
		    )
;;;		   (list (cons "线型" "PLINE") (cons "线型比例" 1))
;;;		   (list (cons "线型" "MLINE")
;;;			 (cons "样式名" "CCTH-BWGPVC")
;;;			 (cons "线型比例" 1.5)
;;;			 (cons "多线比例" 1.5)
;;;		   )
	      )
  )
  (or(setq ptlst (reverse (POINTLST)))(and getpoints(setq ptlst(reverse (getpoints 8)))))
  (if (> (length ptlst) 1)
    (progn (setq wzlst1 (ZX-MAKELINE ptlst para1))
	   (setq wzlst2 (ZX-MAKELINE ptlst para2))
	   (and	(=(getenv "ZX-XXFZD")"1")(= (getenv "ZX-XXJDCD") "1")
		(or (ZX-insert-jdcd-xx
		      (if wzlst1
			wzlst1
			wzlst2
		      )
		      4
		    )
		)
		t
	   )
    )
  )
  (Setvar "cmlstyle" OLDML)
  (princ)
)


(defun c:BWPH (/ ptlst para1 para2 code OLDML wzlst1 wzlst2) ;波纹管外PVC花缠
  (SETQ OLDML (Getvar "cmlstyle"))
  (setq	para1 (list (list
		      (cons "起点块名" "XXQZD-HC")
		      (cons "起点块比例" 1.5)
		      (cons "起点偏移量" 3) ;_块和线的偏移距离
		      (cons "起点块偏移量" 4.5) ;_块和选择起点的偏移距离
		      (cons "端点块名-属性块" (if(=(getenv "ZX-XXFZD")"1")"分支点" "")) ;插入分支点
		      (cons "端点块名-属性标签" "位置")
					;分支点的标签(主要是方便自动递增的)
		    )
		    (list
		      (cons "终点块名" "XXQZD-HC")
		      (cons "终点块比例" 1.5)
		      (cons "终点偏移量" 3) ;_块和线的偏移距离
		      (cons "终点块偏移量" 4.5) ;_块和选择终点的偏移距离
		    )
;;;		   (list (cons "线型" "HATCH")
;;;			 (cons "填充角度" 0)
;;;			 (cons "填充名称" "ANSI31")
;;;			 (cons "填充比例" 10)
;;;			 (cons "填充宽度" 3)
;;;		   )
;;;		   (list (cons "线型" "PLINE") (cons "线型比例" 1))
		    (list (cons "线型" "MLINE")
			  (cons "样式名" "CCTH-BWGPVC")
			  (cons "线型比例" 1.5)
			  (cons "多线比例" 1.5)
		    )
	      )
  )
  (setq	para2 (list (list
		      (cons "起点块名" "")
					;块名删除，因为para1里面有块名
		      (cons "起点块比例" 1.5)
		      (cons "起点偏移量" 3) ;_块和线的偏移距离
		      (cons "起点块偏移量" 4.5) ;_块和选择起点的偏移距离
		      (cons "端点块名-属性块" (if(=(getenv "ZX-XXFZD")"1")"分支点" "")) ;插入分支点
		      (cons "端点块名-属性标签" "位置")
					;分支点的标签(主要是方便自动递增的)
		    )
		    (list
		      (cons "终点块名" "")
					;块名删除，因为para1里面有块名
		      (cons "终点块比例" 1.5)
		      (cons "终点偏移量" 3) ;_块和线的偏移距离
		      (cons "终点块偏移量" 4.5) ;_块和选择终点的偏移距离
		    )
		    (list (cons "线型" "HATCH")
			  (cons "填充角度" 0)
			  (cons "填充名称" "ANSI31")
			  (cons "填充比例" 10)
			  (cons "填充宽度" 3)
		    )
;;;		   (list (cons "线型" "PLINE") (cons "线型比例" 1))
;;;		    (list (cons "线型" "MLINE")
;;;			  (cons "样式名" "CCTH-BWGPVC")
;;;			  (cons "线型比例" 1.5)
;;;			  (cons "多线比例" 1.5)
;;;		    )
	      )
  )
  (or(setq ptlst (reverse (POINTLST)))(and getpoints(setq ptlst(reverse (getpoints 8)))))
  (if (> (length ptlst) 1)
    (progn (setq wzlst1 (ZX-MAKELINE ptlst para1))
	   (setq wzlst2 (ZX-MAKELINE ptlst para2))
	   (and	(=(getenv "ZX-XXFZD")"1")(= (getenv "ZX-XXJDCD") "1")
		(or (ZX-insert-jdcd-xx
		      (if wzlst1
			wzlst1
			wzlst2
		      )
		      4
		    )
		)
		t
	   )
    )
  )
  (Setvar "cmlstyle" OLDML)
  (princ)
)


(defun c:BJQC (/ ptlst para code OLDML wzlst)	;布基胶带全缠
  (SETQ OLDML (Getvar "cmlstyle"))
  (setq	para (list (list
		     (cons "起点块名" "XXQZD-HC-JD")
		     (cons "起点块比例" 1.5)
		     (cons "起点偏移量" 0) ;_块和线的偏移距离
		     (cons "起点块偏移量" 4.5) ;_块和选择起点的偏移距离
		     (cons "端点块名-属性块" (if(=(getenv "ZX-XXFZD")"1")"分支点" "")) ;插入分支点
		     (cons "端点块名-属性标签" "位置")
					;分支点的标签(主要是方便自动递增的)
		   )
		   (list
		     (cons "终点块名" "XXQZD-HC-JD")
		     (cons "终点块比例" 1.5)
		     (cons "终点偏移量" 0) ;_块和线的偏移距离
		     (cons "终点块偏移量" 4.5) ;_块和选择终点的偏移距离
		   )
;;;		   (list (cons "线型" "HATCH")
;;;			 (cons "填充角度" 0)
;;;			 (cons "填充名称" "ANSI31")
;;;			 (cons "填充比例" 10)
;;;			 (cons "填充宽度" 3)
;;;		   )
		   (list (cons "线型" "PLINE") (cons "线型比例" 1))
;;;		   (list (cons "线型" "MLINE")
;;;			 (cons "样式名" "CCTH-BWGPVC")
;;;			 (cons "线型比例" 1.5)
;;;			 (cons "多线比例" 1.5)
;;;		   )
	     )
  )
  (or(setq ptlst (reverse (POINTLST)))(and getpoints(setq ptlst(reverse (getpoints 8)))))
  (if (> (length ptlst) 1)
    (progn (setq wzlst (ZX-MAKELINE ptlst para))
	   (and(=(getenv "ZX-XXFZD")"1")(=(getenv "ZX-XXJDCD")"1")(or(ZX-insert-jdcd-xx wzlst 4))t))
    )
  (Setvar "cmlstyle" OLDML)
  (princ)
)


(defun c:RJQC (/ ptlst para code OLDML wzlst)	;绒布胶带全缠
  (SETQ OLDML (Getvar "cmlstyle"))
  (setq	para (list (list
		     (cons "起点块名" "XXQZD-QC")
		     (cons "起点块比例" 1)
		     (cons "起点偏移量" 4) ;_块和线的偏移距离
		     (cons "起点块偏移量" 3) ;_块和选择起点的偏移距离
		     (cons "端点块名-属性块" (if(=(getenv "ZX-XXFZD")"1")"分支点" "")) ;插入分支点
		     (cons "端点块名-属性标签" "位置")
					;分支点的标签(主要是方便自动递增的)
		   )
		   (list
		     (cons "终点块名" "XXQZD-QC")
		     (cons "终点块比例" 1)
		     (cons "终点偏移量" 4) ;_块和线的偏移距离
		     (cons "终点块偏移量" 3) ;_块和选择终点的偏移距离
		   )
;;;		   (list (cons "线型" "HATCH")
;;;			 (cons "填充角度" 0)
;;;			 (cons "填充名称" "ANSI31")
;;;			 (cons "填充比例" 10)
;;;			 (cons "填充宽度" 3)
;;;		   )
;;;		   (list (cons "线型" "PLINE") (cons "线型比例" 1))
		   (list (cons "线型" "MLINE")
			 (cons "样式名" "CCTH-RJQC")
			 (cons "线型比例" 3)
			 (cons "多线比例" 3)
		   )
	     )
  )
  (or(setq ptlst (reverse (POINTLST)))(and getpoints(setq ptlst(reverse (getpoints 8)))))
  (if (> (length ptlst) 1)
    (progn (setq wzlst (ZX-MAKELINE ptlst para))
	   (and(=(getenv "ZX-XXFZD")"1")(=(getenv "ZX-XXJDCD")"1")(or(ZX-insert-jdcd-xx wzlst 4))t))
    )
  (Setvar "cmlstyle" OLDML)
  (princ)
)

(defun c:RJHC (/ ptlst para code OLDML wzlst)	;绒布胶带花缠
  (SETQ OLDML (Getvar "cmlstyle"))
  (setq	para (list (list
		     (cons "起点块名" "XXQZD-HC")
		     (cons "起点块比例" 1)
		     (cons "起点偏移量" 4) ;_块和线的偏移距离
		     (cons "起点块偏移量" 3) ;_块和选择起点的偏移距离
		     (cons "端点块名-属性块" (if(=(getenv "ZX-XXFZD")"1")"分支点" "")) ;插入分支点
		     (cons "端点块名-属性标签" "位置")
					;分支点的标签(主要是方便自动递增的)
		   )
		   (list
		     (cons "终点块名" "XXQZD-HC")
		     (cons "终点块比例" 1)
		     (cons "终点偏移量" 4) ;_块和线的偏移距离
		     (cons "终点块偏移量" 3) ;_块和选择终点的偏移距离
		   )
;;;		   (list (cons "线型" "HATCH")
;;;			 (cons "填充角度" 0)
;;;			 (cons "填充名称" "ANSI31")
;;;			 (cons "填充比例" 10)
;;;			 (cons "填充宽度" 3)
;;;		   )
;;;		   (list (cons "线型" "PLINE") (cons "线型比例" 1))
		   (list (cons "线型" "MLINE")
			 (cons "样式名" "CCTH-RJHC")
			 (cons "线型比例" 3.75)
			 (cons "多线比例" 3.75)
		   )
	     )
  )
  (or(setq ptlst (reverse (POINTLST)))(and getpoints(setq ptlst(reverse (getpoints 8)))))
  (if (> (length ptlst) 1)
    (progn (setq wzlst (ZX-MAKELINE ptlst para))
	   (and(=(getenv "ZX-XXFZD")"1")(=(getenv "ZX-XXJDCD")"1")(or(ZX-insert-jdcd-xx wzlst 4))t))
    )
  (Setvar "cmlstyle" OLDML)
  (princ)
)

(defun c:gyslb (/ ptlst para code OLDML wzlst) ;工业塑料布
  (SETQ OLDML (Getvar "cmlstyle"))
  (setq	para (list (list
		     (cons "起点块名" "XXQZD-GYSLB-S")
		     (cons "起点块比例" 1)
		     (cons "起点偏移量" 3) ;_块和线的偏移距离
		     (cons "起点块偏移量" 3) ;_块和选择起点的偏移距离
		     (cons "端点块名-属性块" (if(=(getenv "ZX-XXFZD")"1")"分支点" "")) ;插入分支点
		     (cons "端点块名-属性标签" "位置")
					;分支点的标签(主要是方便自动递增的)
		   )
		   (list
		     (cons "终点块名" "XXQZD-GYSLB-E")
		     (cons "终点块比例" 1)
		     (cons "终点偏移量" 3) ;_块和线的偏移距离
		     (cons "终点块偏移量" 3) ;_块和选择终点的偏移距离
		   )
;;;		   (list (cons "线型" "HATCH")
;;;			 (cons "填充角度" 0)
;;;			 (cons "填充名称" "ANSI31")
;;;			 (cons "填充比例" 10)
;;;			 (cons "填充宽度" 3)
;;;		   )
;;;		   (list (cons "线型" "PLINE") (cons "线型比例" 1))
		   (list (cons "线型" "MLINE")
			 (cons "样式名" "CCTH-GYSLB")
			 (cons "线型比例" 3)
			 (cons "多线比例" 3)
		   )
	     )
  )
  (or(setq ptlst (reverse (POINTLST)))(and getpoints(setq ptlst(reverse (getpoints 8)))))
  (if (> (length ptlst) 1)
    (progn (setq wzlst (ZX-MAKELINE ptlst para))
	   (and(=(getenv "ZX-XXFZD")"1")(=(getenv "ZX-XXJDCD")"1")(or(ZX-insert-jdcd-xx wzlst 4))t))
    )
  (Setvar "cmlstyle" OLDML)
  (princ)
)


(defun c:hm (/ ptlst para1 para2 code OLDML wzlst) ;海绵
  (SETQ OLDML (Getvar "cmlstyle"))
  (setq	para1 (list (list
		      (cons "起点块名" "XXQZD-QC")
		      (cons "起点块比例" 1)
		      (cons "起点偏移量" 0) ;_块和线的偏移距离
		      (cons "起点块偏移量" 3) ;_块和选择起点的偏移距离
		      (cons "端点块名-属性块" (if(=(getenv "ZX-XXFZD")"1")"分支点" "")) ;插入分支点
		      (cons "端点块名-属性标签" "位置")
					;分支点的标签(主要是方便自动递增的)
		    )
		    (list
		      (cons "终点块名" "XXQZD-QC")
		      (cons "终点块比例" 1)
		      (cons "终点偏移量" 0) ;_块和线的偏移距离
		      (cons "终点块偏移量" 3) ;_块和选择终点的偏移距离
		    )
		    (list (cons "线型" "HATCH")
			  (cons "填充角度" 0)
			  (cons "填充名称" "ANSI37")
			  (cons "填充比例" 10)
			  (cons "填充宽度" 3)
		    )
;;;		   (list (cons "线型" "PLINE") (cons "线型比例" 1))
;;;		   (list (cons "线型" "MLINE")
;;;			 (cons "样式名" "CCTH-HAIMIAN")
;;;			 (cons "线型比例" 3)
;;;			 (cons "多线比例" 3)
;;;		   )
	      )
  )
  (setq	para2 (list (list
		      (cons "起点块名" "")
		      (cons "起点块比例" 1)
		      (cons "起点偏移量" 0) ;_块和线的偏移距离
		      (cons "起点块偏移量" 3) ;_块和选择起点的偏移距离
		      (cons "端点块名-属性块" (if(=(getenv "ZX-XXFZD")"1")"分支点" "")) ;插入分支点
		      (cons "端点块名-属性标签" "位置")
					;分支点的标签(主要是方便自动递增的)
		    )
		    (list
		      (cons "终点块名" "")
		      (cons "终点块比例" 1)
		      (cons "终点偏移量" 0) ;_块和线的偏移距离
		      (cons "终点块偏移量" 3) ;_块和选择终点的偏移距离
		    )
;;;		   (list (cons "线型" "HATCH")
;;;			 (cons "填充角度" 0)
;;;			 (cons "填充名称" "ANSI37")
;;;			 (cons "填充比例" 10)
;;;			 (cons "填充宽度" 3)
;;;		   )
;;;		   (list (cons "线型" "PLINE") (cons "线型比例" 1))
		    (list (cons "线型" "MLINE")
			  (cons "样式名" "CCTH-HAIMIAN")
			  (cons "线型比例" 3)
			  (cons "多线比例" 3)
		    )
	      )
  )
  (or(setq ptlst (reverse (POINTLST)))(and getpoints(setq ptlst(reverse (getpoints 8)))))
  (if (> (length ptlst) 1)
    (progn
      (setq wzlst1 (ZX-MAKELINE ptlst para1))
	   (setq wzlst2 (ZX-MAKELINE ptlst para2))      
	   (and(=(getenv "ZX-XXFZD")"1")(=(getenv "ZX-XXJDCD")"1")(or(ZX-insert-jdcd-xx (if wzlst1
			wzlst1
			wzlst2
		      ) 4))t))
    )
  (Setvar "cmlstyle" OLDML)
  (princ)
)



(defun c:phc (/ ptlst para code OLDML wzlst) ;PVC和黄蜡管以及耐磨布的包扎方式
  (SETQ OLDML (Getvar "cmlstyle"))
  (setq	para (list (list
		     (cons "起点块名" "XXQZD-QC")
		     (cons "起点块比例" 1)
		     (cons "起点偏移量" 0) ;_块和线的偏移距离
		     (cons "起点块偏移量" 3) ;_块和选择起点的偏移距离
		     (cons "端点块名-属性块" (if(=(getenv "ZX-XXFZD")"1")"分支点" "")) ;插入分支点
		     (cons "端点块名-属性标签" "位置")
					;分支点的标签(主要是方便自动递增的)
		   )
		   (list
		     (cons "终点块名" "XXQZD-QC")
		     (cons "终点块比例" 1)
		     (cons "终点偏移量" 0) ;_块和线的偏移距离
		     (cons "终点块偏移量" 3) ;_块和选择终点的偏移距离
		   )
;;;		   (list (cons "线型" "HATCH")
;;;			 (cons "填充角度" 0)
;;;			 (cons "填充名称" "ANSI31")
;;;			 (cons "填充比例" 1)
;;;			 (cons "填充宽度" 2)
;;;		   )
;;;		   (list (cons "线型" "PLINE") (cons "线型比例" 1))
		   (list (cons "线型" "MLINE")
			 (cons "样式名" "CCTH-BPVC")
			 (cons "线型比例" 1)
			 (cons "多线比例" 3)
		   )
	     )
  )
  (or(setq ptlst (reverse (POINTLST)))(and getpoints(setq ptlst(reverse (getpoints 8)))))
  (if (> (length ptlst) 1)
    (progn (setq wzlst (ZX-MAKELINE ptlst para))
	   (and(=(getenv "ZX-XXFZD")"1")(=(getenv "ZX-XXJDCD")"1")(or(ZX-insert-jdcd-xx wzlst 4))t))
    )
  (Setvar "cmlstyle" OLDML)
  (princ)
)



(defun c:NMB (/ ptlst para1 para2 code OLDML wzlst) ;NMB
  (SETQ OLDML (Getvar "cmlstyle"))
  (setq	para1 (list (list
		      (cons "起点块名" "XXQZD-QC")
		      (cons "起点块比例" 1)
		      (cons "起点偏移量" 0) ;_块和线的偏移距离
		      (cons "起点块偏移量" 3) ;_块和选择起点的偏移距离
		      (cons "端点块名-属性块" (if(=(getenv "ZX-XXFZD")"1")"分支点" "")) ;插入分支点
		      (cons "端点块名-属性标签" "位置")
					;分支点的标签(主要是方便自动递增的)
		    )
		    (list
		      (cons "终点块名" "XXQZD-QC")
		      (cons "终点块比例" 1)
		      (cons "终点偏移量" 0) ;_块和线的偏移距离
		      (cons "终点块偏移量" 3) ;_块和选择终点的偏移距离
		    )
		    (list (cons "线型" "HATCH")
			  (cons "填充角度" 0)
			  (cons "填充名称" "SQUARE")
			  (cons "填充比例" 5)
			  (cons "填充宽度" 3)
		    )
;;;		   (list (cons "线型" "PLINE") (cons "线型比例" 1))
;;;		   (list (cons "线型" "MLINE")
;;;			 (cons "样式名" "CCTH-HAIMIAN")
;;;			 (cons "线型比例" 3)
;;;			 (cons "多线比例" 3)
;;;		   )
	      )
  )
  (setq	para2 (list (list
		      (cons "起点块名" "")
		      (cons "起点块比例" 1)
		      (cons "起点偏移量" 0) ;_块和线的偏移距离
		      (cons "起点块偏移量" 3) ;_块和选择起点的偏移距离
		      (cons "端点块名-属性块" (if(=(getenv "ZX-XXFZD")"1")"分支点" "")) ;插入分支点
		      (cons "端点块名-属性标签" "位置")
					;分支点的标签(主要是方便自动递增的)
		    )
		    (list
		      (cons "终点块名" "")
		      (cons "终点块比例" 1)
		      (cons "终点偏移量" 0) ;_块和线的偏移距离
		      (cons "终点块偏移量" 3) ;_块和选择终点的偏移距离
		    )
;;;		   (list (cons "线型" "HATCH")
;;;			 (cons "填充角度" 0)
;;;			 (cons "填充名称" "SQUARE")
;;;			 (cons "填充比例" 5)
;;;			 (cons "填充宽度" 3)
;;;		   )
;;;		   (list (cons "线型" "PLINE") (cons "线型比例" 1))
		    (list (cons "线型" "MLINE")
			  (cons "样式名" "CCTH-HAIMIAN")
			  (cons "线型比例" 3)
			  (cons "多线比例" 3)
		    )
	      )
  )
  (or(setq ptlst (reverse (POINTLST)))(and getpoints(setq ptlst(reverse (getpoints 8)))))
  (if (> (length ptlst) 1)
    (progn
      (setq wzlst1 (ZX-MAKELINE ptlst para1))
	   (setq wzlst2 (ZX-MAKELINE ptlst para2))      
	   (and(=(getenv "ZX-XXFZD")"1")(=(getenv "ZX-XXJDCD")"1")(or(ZX-insert-jdcd-xx (if wzlst1
			wzlst1
			wzlst2
		      ) 4))t))
    )
  (Setvar "cmlstyle" OLDML)
  (princ)
)
