乐筑天下

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

[编程交流] Change to get result of text t

[复制链接]

7

主题

22

帖子

15

银币

初来乍到

Rank: 1

铜币
35
发表于 2022-7-19 18:48:41 | 显示全部楼层 |阅读模式
Hai, i need a help.
        I have a working lisp routine which gives me distance(chainage) of polyline when clicked on the pline i selected. It will add a text there showing chainage.
        Only thing i want is i need the chainage also in an external Excel Workbook cell. Like when i click and get the chainage there i want to get that chainage in excel workbook cell which is open (like Click to Xls lisp).
         
        Pls reply if its possible... thanks
         
        Attaching the lisp file and also adding same lisp code below.
  1. ;-- PIPE CHAINAGE abhi- CAA --(defun c:CAA (/ s p c tp sch f)(setvar "cmdecho" 0) (setq sch (getstring "\nSpecify start chainage : "))                        ;"0" is set as the default value  (if (= sch "")(setq sch "0"))  (if    (and (setq s (car (entsel "\nPick a polyline :")))         (or (= (cdr (assoc 0 (entget s))) "LWPOLYLINE")             (alert "Invalid object! Please pick a polyline only.")         )    )     (while       (and         (setq           p (getpoint "\nSpecify point :")         )         (setq c (vlax-curve-getclosestpointto s p))                  (setq tp (getpoint "\nSpecify Point for Text : "))       )          (setq di (vlax-curve-getdistatpoint s c))          (setq f (fix (/ di 1000.0)))          (setq di (- di (*  f 1000.0)))                (command "_.LEADER" c tp ""                                 (strcat "FF-LINE 01" )                                (strcat "CH=" (itoa (+ (atoi sch) f)) "+" (rtos di 2 3))                                ""                )                (vlax-put-property (vlax-ename->vla-object (entlast)) 'height 3.50);;; Text Height 3.50     )  )  (setvar "cmdecho" 1)  (princ))(vl-load-com)
 
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-1-31 12:43 , Processed in 0.269026 second(s), 54 queries .

© 2020-2025 乐筑天下

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