明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 3093|回复: 0

南方CASS宗地号检查程序 (明镜亦非台)

  [复制链接]
发表于 2011-9-18 01:31:49 | 显示全部楼层 |阅读模式
本帖最后由 yanshengjiang 于 2011-9-18 01:33 编辑

   南方CASS宗地号检查程序
效果展示:
已有的宗地号:
(1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56  58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104  )

漏掉的宗地号:
(57)

共有 103 个宗地号        最大宗地号为: 104
望高手能给我加段检查重复的功能,当时写的时候有人给我说过,基础太薄没搞懂
(defun c:jc();;;;得到jzd层数字的最大一个。
  (if
(setq ss  (ssget "x" '((0 . "TEXT")(8 . "JZD") ) ))
(progn
        (setq s1 (sslength ss))
        (setq i 0)
     (setq str "")
     (while (< i s1)
        (setq s2 (ssname ss i))
        (setq s3 (entget s2  '("*")))
        (setq s4 (assoc 1 s3))
       (setq ya (assoc '-3 s3))
       (if (/= ya nil)
       (setq yan(read(cdr(cadr(cadr ya)))))
  );if
       (if (= yan 302002)
  (progn
       (setq s5 (cdr s4));宗地号
        (if;;;;;
  (= (numberp (read s5)) T)
(progn;;;;;
         (setq s7 (atoi s5))
(setq str (strcat str " " s5))
  );;;;;
);;;;;
      ))
       (setq ya nil)
(setq i (1+ i))
  
);while
);progn
(alert "没有找到宗地号")
);if
(if (/= str nil)
  (progn
  (setq yan (strcat "(" str ")"))
  (setq yan (read yan))
  (setq yan (reverse yan));按画的顺序排列
  (setq yy (apply 'max yan))
  (setq yyyyy (vl-sort yan '<));按小到大的顺序排列
  (setq geshu (length yyyyy))
  (setq lst yyyyy)
  (setq i 1 key t)
  (setq nlist '())
  (while key
    (if (not(member i lst))
        (setq nlist (append nlist (list i))))
    (setq i (+ i 1))
    (if (eq i (last lst))(setq key nil))
    );while
  nlist
    (setq file (open "c:/C盘 宗地号信息.dat" "w"))
  (princ "已有的宗地号:" file)(princ "\n" file)
  (princ yyyyy file)
  (princ "\n" file)
  (princ "\n" file)
  (princ "漏掉的宗地号:" file)(princ "\n" file)
(if (= nlist nil)(setq nlist "无"));;;;;
  (princ nlist file)
  (princ "\n" file)(princ "\n" file)
(princ (strcat "共有 " (itoa geshu) " 个宗地号        最大宗地号为: " (itoa yy))file)
  (close File)
  (princ (strcat "共有" (itoa geshu) "个宗地号       最大宗地号为:" (itoa yy)))
  (startapp "NOTEPAD.EXE" "c:/C盘 宗地号信息.dat")
))
  (princ)
  )

(defun c:cz();查找宗地号
  (setvar "cmdecho" 0)
  (if
(setq ss  (ssget "x" '((0 . "TEXT")(8 . "JZD") ) ))
(progn
  (setq qqq (fix(getreal "\n 查找宗地号=>")))
        (setq s1 (sslength ss))
        (setq i 0)
     (while (< i s1)
        (setq s2 (ssname ss i))
        (setq s3 (entget s2  '("*")))
        (setq s4 (assoc 1 s3))
       (setq ya (assoc '-3 s3))
       (if (/= ya nil)
       (setq yan(read(cdr(cadr(cadr ya)))))
  );if
       (if (= yan 302002)
  (progn
       (setq s5 (cdr s4));宗地号
        (if;;;;;
  (= (numberp (read s5)) T)
(progn;;;;;
         (setq s7 (atoi s5))
  (if (= qqq s7)
    (progn
      (setq i s1)
      (setq x (cadr(assoc '10 s3)))
      (setq y (caddr(assoc '10 s3)))
      (setq zb(list x y))
      (command "zoom" "c" zb "20")
      ))

  ))
      ))
       (setq ya nil)
(setq i (1+ i))

);while
  
);progn

);if
(princ)
  )


评分

参与人数 1明经币 +1 金钱 +12 收起 理由
caoyin + 1 + 12 深夜发帖辛苦了

查看全部评分

"觉得好,就打赏"
还没有人打赏,支持一下
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2025-9-24 09:09 , Processed in 0.147579 second(s), 26 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表