明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
12
返回列表 发新帖
楼主: hdlyt11

求点取梁配筋简图提取数字源码

[复制链接]
发表于 2018-4-30 09:40 | 显示全部楼层
(setq zongjin01 (distof (substr midresult 1 (- (findstr midresult "-") 1)) 2))
  (setq midresult (substr midresult (+ (findstr midresult "-") 1)))
  (setq zongjin02 (distof (substr midresult 1 (- (findstr midresult "-") 1)) 2))
  (setq zongjin03 (distof (substr midresult (+ (findstr midresult "-") 1))))
;;;定位子串在源串中第一次出现的开始位置, 子串不出现时返回nil(sour_string表示字符串,sub_string表示子字符串)
(defun FindStr(sour_string sub_string / substrpoint sour_string_length sub_string_length sl si)
  (setq substrpoint nil)
  (setq sour_string_length (strlen sour_string))
  (setq sub_string_length (strlen sub_string))
  (setq sl (+ (- sour_string_length sub_string_length) 1))
  (setq si 1)
  (while (<= si sl)
    (progn
      (if (= sub_string (substr sour_string si sub_string_length))
        (if (= substrpoint nil) (setq substrpoint si))
      )
      (setq si (1+ si))
    ) ;end progn
  ) ;end while
  substrpoint
)
发表于 2021-1-28 11:54 | 显示全部楼层
很好代码,正需要的。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-4-20 18:55 , Processed in 0.246957 second(s), 16 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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