明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1261|回复: 2

[源码] cass 提取宗地信息

[复制链接]
发表于 2019-6-7 09:53:47 | 显示全部楼层 |阅读模式
(defun c:tt ()

(setq en1_data(cdr (assoc -3 (entget (car (entsel)) '("*")))));获取宗地扩展属性





提取宗地编号

(defun c:tt ()
(setq en1_data(cdr (assoc -3 (entget (car (entsel)) '("*")))))
  (setq g (assoc "SOUTH" en1_data))
  (cdr (nth 2 g));提取宗地编号
)




本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

x
 楼主| 发表于 2019-6-9 00:04:29 | 显示全部楼层
批量导出宗地信息
  1. (defun c:tt ()
  2.   (setq dat_file (getfiled "写文件" "c:\lsptools\numtest1" "num" 1))
  3.   (setq ff (open dat_file "w"))
  4. (setq ss (ssget))
  5. (setq n 0)
  6. (repeat (sslength ss)
  7. (setq en (ssname ss n))
  8.    (setq en1_data(cdr (assoc -3 (entget en '("*")))))
  9.    (setq en1_zdbh(cdr (nth 2 (assoc "SOUTH" en1_data))));提取宗地编号
  10.    (setq en1_qlr(cdr (nth 3 (assoc "SOUTH" en1_data))));提取权利人
  11.    (setq en1_zl(cdr (nth 1 (assoc "TXDZ" en1_data))));坐落
  12.    (setq en1_sfz(cdr (nth 1 (assoc "FRDBZMS" en1_data))));坐落
  13.    (setq en1_fwzh(cdr (nth 1 (assoc "TDZH" en1_data))));房屋证号
  14.    (setq kg "        ")
  15.   ; (strcat en1_zdbh kg en1_qlr)
  16. (write-line  (strcat en1_zdbh kg en1_qlr kg en1_zl kg en1_sfz kg en1_fwzh) ff)
  17. (prin1 en1_zdbh)
  18. (setq n (1+ n))
  19. )
  20.   (close ff)

  21. )
发表于 2019-10-27 22:41:09 | 显示全部楼层
执行tt后显示为  参数类型错误: consp nil,怎么修改啊
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2025-5-18 14:27 , Processed in 0.159695 second(s), 26 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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