乐筑天下

搜索
欢迎各位开发者和用户入驻本平台 尊重版权,从我做起,拒绝盗版,拒绝倒卖 签到、发布资源、邀请好友注册,可以获得银币 请注意保管好自己的密码,避免账户资金被盗
查看: 26|回复: 0

[编程交流] Coordinates and line ID (hyper

[复制链接]

1

主题

1

帖子

0

银币

初来乍到

Rank: 1

铜币
5
发表于 2022-7-5 15:43:51 | 显示全部楼层 |阅读模式
Hello,
I have a found a lisp routine (dotsoft) wich exports coordinates off all selected polylines to an txt or csv file. See code below. But in the generated list you can not see wich coordinates belong to wich line it just becomes one long list of all coordinates.
I give my polylines an "ID" by filling in the hyperlink field at the properties.
Is it possible to upgrade the lisp and add the hyperlink information?
Output now in cvs:
        85790.80773261,-1617.56967007,0.00000000       87907.16139717,-1476.60439300,0.00000000       86419.30065153,-823.03783397,0.00000000       87612.15468495,-2027.65058909,0.00000000       89728.50834951,-1886.68531202,0.00000000       88240.64760388,-1233.11875299,0.00000000    Wanted output in cvs:
        Line_01
85790.80773261,-1617.56967007,0.00000000
       87907.16139717,-1476.60439300,0.00000000       86419.30065153,-823.03783397,0.00000000
Line_02
       87612.15468495,-2027.65058909,0.00000000       89728.50834951,-1886.68531202,0.00000000       88240.64760388,-1233.11875299,0.00000000
The name af the line (Line_01) I have stored in the hyperlink field at the properties of the line.
LISP CODE:
----------------------------------------------------------------------
  1. ;             (Export LWPOLYLINE Vertices & Points to File);            Copyright (C) 2000 DotSoft, All Rights Reserved;                   Website: [url]http://www.dotsoft.com[/url]; ----------------------------------------------------------------------; DISCLAIMER:  DotSoft Disclaims any and all liability for any damages; arising out of the use or operation, or inability to use the software.; FURTHERMORE, User agrees to hold DotSoft harmless from such claims.; DotSoft makes no warranty, either expressed or implied, as to the; fitness of this product for a particular purpose.  All materials are; to be considered ‘as-is’, and use of this software should be; considered as AT YOUR OWN RISK.; ----------------------------------------------------------------------;;Revised 8/23/07 CAB to report coordinates in current UCS(defun c:ptexport () (setq sset (ssget '((-4 . "")))) (if sset   (progn     (setq itm 0 num (sslength sset))     (setq fn (getfiled "Point Export File" "" "csv" 1))     (if (/= fn nil)       (progn         (setq fh (open fn "w"))         (while (< itm num)           (setq hnd (ssname sset itm))           (setq ent (entget hnd))           (setq obj (cdr (assoc 0 ent)))           (cond             ((= obj "POINT")               (setq pnt (cdr (assoc 10 ent)))               (setq pnt (trans pnt 0 1));;**CAB               (princ (strcat (rtos (car pnt) 2  ","                              (rtos (cadr pnt) 2  ","                              (rtos (caddr pnt) 2 ) fh)               (princ "\n" fh)             )             ((= obj "LWPOLYLINE")               (if (= (cdr (assoc 38 ent)) nil)                 (setq elv 0.0)                 (setq elv (cdr (assoc 38 ent)))               )               (foreach rec ent                 (if (= (car rec) 10)                   (progn                     (setq pnt (cdr rec))                     (setq pnt (trans pnt 0 1));;**CAB                     (princ (strcat (rtos (car pnt) 2  ","                                    (rtos (cadr pnt) 2  ","                                    (rtos elv 2 ) fh)                     (princ "\n" fh)                   )                 )               )             )             (t nil)           )           (setq itm (1+ itm))         )         (close fh)       )     )   ) ) (princ))[/size][/font][font=Calibri][size=3](princ "\nPoint Export loaded, type PTEXPORT to run.")(princ)
Thanks a lot
回复

使用道具 举报

发表回复

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

QQ|关于我们|小黑屋|乐筑天下 繁体中文

GMT+8, 2025-7-6 05:09 , Processed in 0.658927 second(s), 54 queries .

© 2020-2025 乐筑天下

联系客服 关注微信 帮助中心 下载APP 返回顶部 返回列表