(setq mai_cehui_gcd_dianhao (list "ZDH" "1")) ;测绘点号所在图层及颜色
(setq mai_cehui_gcd_bianma (list "ZBM" "3"))  ;测绘点文字所在图层及颜色
(setq mai_cehui_gcd_blk (list "GCD" "1"))     ;测绘高程块所在图层及颜色
(setq mai_cehui_style (list "正等线体" 3))    ;测绘文字所在字形及字高
(setq mai_cehui_tin (list "SJW" "3"))         ;三角网所在图层及颜色
(setq mai_cehui_dgx (list "DGX" "2"))         ;等高线所在图层及颜色


;[功能] pline,lwpline点坐标表  By 无痕;;示例(vxs (car (entsel))),返回三维点坐标
(defun mai_get_face_points ( e / i v lst)
  (if (= (mai_dxf 0 (setq lst (entget e))) "3DFACE")
      (mai_remove_same (list (mai_dxf 10 lst)(mai_dxf 11 lst)(mai_dxf 12 lst)(mai_dxf 13 lst)))
      (progn
          (setq i 0)
          (while (setq v (vlax-curve-getpointatparam e (setq i (1+ i))))
                 (setq lst (cons v lst))
          )
          (reverse lst)
      )
  )
)

(defun mai_tri_zhongxin (p1 p2 p3)
    (inters p3 (mai_divide_point p1 p2 0.5) p1 (mai_divide_point p3 p2 0.5))
)



;;;创建 Cass 高程点 (gxl_cs:gcd 插入点 高程 图块比例 小数位数 图层)
;(setq inspt (getpoint)) (setq scale 0.5) (setq height "AAAA")(setq height 12.25)
(defun gxl_cs:gcd (inspt height scale xsws la / pt blkdef obj)
  (setq height (if height (rtos height 2 xsws) ""))
  (regapp "SOUTH")
  (setq blockname "GC200")
    ;;;检查是否存在高程点图块定义
  (or (tblobjname "block" blockname)
    (progn
            ;创建块
            ;;;==========
            ;;;做块头
      (entmake (list '(0 . "BLOCK") '(100 . "AcDbEntity") '(100 . "AcDbBlockBegin")
                    (cons 2 blockname) '(70 . 2) '(10 0 0 0)
                )
      )
      (entmake
                (list
                    '(0 . "HATCH")
                    '(100 . "AcDbEntity")
                    '(100 . "AcDbHatch")
                    '(10 0.0 0.0 0.0)
                    '(210 0.0 0.0 1.0)
                    '(2 . "SOLID")
                    '(8 . "0")
                    '(62 . 256) '(70 . 1) '(71 . 0) '(91 . 1)    '(92 . 7) '(72 . 1)
                    '(73 . 1)    '(93 . 2) '(10 -0.4 0.0 0.0) '(42 . 1.0) '(10 0.4 0.0 0.0)
                    '(42 . 1.0) '(97 . 0) '(75 . 0) '(76 . 1)    '(47 . 0.0) '(98 . 1)
                    '(10 0.0 0.0 0.0)
                )
      )
            ;;;做块尾
      (entmake (list '(0 . "ENDBLK") '(100 . "AcDbEntity") '(100 . "AcDbBlockEnd")))
    )
  )
    ;;;插入块
  (entmake
        (list
            '(0 . "INSERT")
            '(100 . "AcDbEntity")
            '(100 . "AcDbBlockReference")
            '(66 . 1)
            ;;;属性跟随标志,1跟随，0不跟随
            (cons 2 blockname)
            (cons 8 la)
            (cons 10 inspt)
            (cons 41 scale)
            (cons 42 scale)
            (cons 43 scale)
            (list -3 '("SOUTH" (1000 . "202101")))
        )
  )
    ;;;插入属性
  (entmake
        (list
            '(0 . "ATTRIB")
            '(100 . "AcDbEntity")
            '(100 . "AcDbText")
            (cons 8 la)
            (cons 10 (setq pt (polar inspt 0 (* 1.2 scale))))
            (cons 40 (* 2.0 scale))
            (cons 50 0)
            (cons 41 0.8)
            (cons 51 0)
            (cons 1 height)
            (cons 7 (car mai_cehui_style))
            (cons 72 0)
            (cons 11 pt)
            '(100 . "AcDbAttribute")
            (cons 2 "height")
            (cons 70 0)
            (cons 74 2)
        )
  )
    ;;;结束标志
  (entmake '((0 . "SEQEND")))
  (princ)
)
