明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 663|回复: 10

[测绘] 求大神帮忙在站内有朋友编了但是点号前面有J

[复制链接]
发表于 2020-8-19 18:57 | 显示全部楼层 |阅读模式
[属性描述]
坐标系=2000国家大地坐标系
几度分带=3
投影类型=高斯克吕格
计量单位=米
带号=42
精度=0.01
转换参数=,,,,,,
[地块坐标]
00,0.123,2019-03,000项目,,1,00用地,,@
1,1,5272000.00,42430000.000
2,1,5272111.00,42431000.0010
3,1,5272210.742,4243200.000
4,1,5272222.00,42432223.981
1,1,5272000.00,42430000.000
  以上是导出的格式,求大神帮忙 ,编程小白真无助啊

 楼主| 发表于 2020-8-19 18:58 | 显示全部楼层
站内大神费心编写的程序
(defun c:tt( / biao cunzai dingdianbiao en ent feidihao file geshu huidian huidianxx huidianxxx huidianyy huidianyyy i ii j jj mingzi name neibiao neihuidian path ss waiwei xx xxx yy yyy)
  (setq i 0)
  (setq geshu 0)
  (setq waiwei 0)
  (setq huidian 0)
  (setq feidihao 1)
  (command "CONVERT" "" "")
  (setq ss (ssget '((0 . "LWPOLYLINE"))))
  (setq path (getfiled "保存" "" "TXT" 1))
  (setq file (open path "W"))
  (write-line "[属性描述]" file)
  (write-line "坐标系=80国家大地坐标系" file)
  (write-line "几度分带=3" file)
  (write-line "投影类型=高斯克吕格" file)
  (write-line "计量单位=米" file)
  (write-line "带号=36" file)
  (write-line "精度=0.01" file)
  (write-line "转换参数=,,,,,," file)
  (write-line "[地块坐标]" file)
  (repeat (sslength ss)
    (setq name (ssname ss i))
    (setq en (entget name))
    (setq j 0)
    (setq waiwei (1+ waiwei))
    (setq huidian (1+ geshu))
    (setq dingdianbiao nil)
    (write-line (strcat ",," "1" "," "外围" (itoa waiwei) "," "面" "," "H48G041086" "," "综合用地,,@") file)
    (repeat (length en)
      (setq biao (nth j en))
      (if (= 10 (car biao))
       (progn  
        (setq xx (caddr biao))
  (setq yy (cadr biao))
  (setq geshu (1+ geshu))
  (write-line (strcat "J" (itoa geshu) "," "1" "," (rtos xx 2 3) "," (rtos yy 2 3)) file)
  (setq dingdianbiao (append dingdianbiao (list (cdr biao))))
  (princ)
       )  
      )
      (setq j (1+ j))
    )
      (setq huidianxx (caddr (assoc 10 en)))
      (setq huidianyy (cadr (assoc 10 en)))
      (write-line (strcat "J" (itoa huidian) "," "1" "," (rtos huidianxx 2 3) "," (rtos huidianyy 2 3)) file)

      (entdel name)
      (setq cunzai (ssget "_CP" dingdianbiao '((0 . "LWPOLYLINE"))))
      (setq ii 0)
      (if cunzai
       (progn  
        (repeat (sslength cunzai)
          (setq mingzi (ssname cunzai ii))
    (setq ent (entget mingzi))
    (setq jj 0)
    (setq feidihao (1+ feidihao))
    (setq neihuidian (1+ geshu))
    (repeat (length ent)
            (setq neibiao (nth jj ent))
      (if (= 10 (car neibiao))
       (progn
              (setq xxx (caddr neibiao))
        (setq yyy (cadr neibiao))
        (setq geshu (+ geshu 1))
        (write-line (strcat "J" (itoa geshu) "," (itoa feidihao) "," (rtos xxx 2 3) "," (rtos yyy 2 3)) file)
        (princ)
       )
      )
      (setq jj (1+ jj))
    )
    (setq huidianxxx (caddr (assoc 10 ent)))
    (setq huidianyyy (cadr (assoc 10 ent)))
    (write-line (strcat "J" (itoa neihuidian) "," (itoa feidihao) "," (rtos huidianxxx 2 3) "," (rtos huidianyyy 2 3)) file)
    (princ)
    (setq ii (1+ ii))
  )
       )  
      )
      (entmake en)
      (setq i (1+ i))
  )
  (close file)
)
 楼主| 发表于 2020-8-19 18:59 | 显示全部楼层
自家捣鼓了半天也没改成只能求助了
发表于 2020-8-19 19:16 | 显示全部楼层
把代码里面全部  strcat "J"  改为  strcat
 楼主| 发表于 2020-8-20 07:47 | 显示全部楼层
start4444 发表于 2020-8-19 19:16
把代码里面全部  strcat "J"  改为  strcat

我试试,谢谢您的执教
 楼主| 发表于 2020-8-20 07:54 | 显示全部楼层
start4444 发表于 2020-8-19 19:16
把代码里面全部  strcat "J"  改为  strcat

谢谢您,已经修改了变更过来了,编程我是一点也不懂啊,这方面有什么书籍适合自学的吗?再次感谢您!!!
发表于 2020-8-20 10:05 | 显示全部楼层
看点视频教程,事半功倍
发表于 2020-8-20 10:47 | 显示全部楼层
tangweinbs 发表于 2020-8-20 07:54
谢谢您,已经修改了变更过来了,编程我是一点也不懂啊,这方面有什么书籍适合自学的吗?再次感谢您!!!

如果不是学专业编程的不要看什么书了,你手上收集这几个东西就行:1,《AutoLISP 葵花宝典》;2,《dxf参考手册》;3,系统变量全集。1是查函数的,2是查组码的,3就按需求来了。至于代码写法格式那些看书比较繁琐,建议你自己从简单的开始不断的写,不懂的这里基本能找到资料,这样会学的快,但可能不专业,这个我觉得没所谓,代码自己能用就行了
 楼主| 发表于 2020-8-22 21:35 | 显示全部楼层
谢谢 ,这几天加班累的要死 ,一定抽时间看看 这些!
 楼主| 发表于 2020-8-22 21:55 | 显示全部楼层
start4444 发表于 2020-8-20 10:47
如果不是学专业编程的不要看什么书了,你手上收集这几个东西就行:1,《AutoLISP 葵花宝典》;2,《dxf参 ...

大神 有这几本书的链接吗?葵花宝典我找到了本AutoLisp葵花宝典A.chm 其余的没找到 啊
或者您直接发我邮箱 77247155@QQ.com
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-5-4 20:11 , Processed in 0.188514 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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