tangweinbs 发表于 2020-8-19 18:57:13

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

[属性描述]
坐标系=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
以上是导出的格式,求大神帮忙 ,编程小白真无助啊

start4444 发表于 2020-8-19 19:16:59

把代码里面全部strcat "J"改为strcat

start4444 发表于 2020-8-20 10:47:06

tangweinbs 发表于 2020-8-20 07:54
谢谢您,已经修改了变更过来了,编程我是一点也不懂啊,这方面有什么书籍适合自学的吗?再次感谢您!!!

如果不是学专业编程的不要看什么书了,你手上收集这几个东西就行:1,《AutoLISP 葵花宝典》;2,《dxf参考手册》;3,系统变量全集。1是查函数的,2是查组码的,3就按需求来了。至于代码写法格式那些看书比较繁琐,建议你自己从简单的开始不断的写,不懂的这里基本能找到资料,这样会学的快,但可能不专业,这个我觉得没所谓,代码自己能用就行了

tangweinbs 发表于 2020-8-19 18:58:25

站内大神费心编写的程序
(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)
)

tangweinbs 发表于 2020-8-19 18:59:28

自家捣鼓了半天也没改成只能求助了

tangweinbs 发表于 2020-8-20 07:47:44

本帖最后由 tangweinbs 于 2024-12-16 16:03 编辑

start4444 发表于 2020-8-19 19:16
把代码里面全部strcat "J"改为strcat
我试试,谢谢您的 解答

tangweinbs 发表于 2020-8-20 07:54:15

start4444 发表于 2020-8-19 19:16
把代码里面全部strcat "J"改为strcat

谢谢您,已经修改了变更过来了,编程我是一点也不懂啊,这方面有什么书籍适合自学的吗?再次感谢您!!!

烟盒迷唇 发表于 2020-8-20 10:05:30

看点视频教程,事半功倍

tangweinbs 发表于 2020-8-22 21:35:27

谢谢 ,这几天加班累的要死 ,一定抽时间看看 这些!

tangweinbs 发表于 2020-8-22 21:55:23

start4444 发表于 2020-8-20 10:47
如果不是学专业编程的不要看什么书了,你手上收集这几个东西就行:1,《AutoLISP 葵花宝典》;2,《dxf参 ...

大神 有这几本书的链接吗?葵花宝典我找到了本AutoLisp葵花宝典A.chm 其余的没找到 啊
或者您直接发我邮箱 77247155@QQ.com
页: [1] 2
查看完整版本: 求大神帮忙在站内有朋友编了但是点号前面有J