明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 461|回复: 1

[提问] 想求一个对尺寸与多行单行文字做比值的计算

[复制链接]
发表于 2020-3-23 17:01 | 显示全部楼层 |阅读模式
4明经币
             请求帮助!
附件: 您需要 登录 才可以下载或查看,没有账号?注册

最佳答案

查看完整内容

多行文字没格式应该简单
"觉得好,就打赏"
还没有人打赏,支持一下
发表于 2020-3-23 17:01 | 显示全部楼层
多行文字没格式应该简单
  1. (defun c:testa (/ en1 en2 ent1 ent2 t1 t2)
  2.   (setq        en1  (car (entsel "\n选择对比1:"))
  3.         en2  (car (entsel "\n选择对比2:"))
  4.         ent1 (entget en1)
  5.         ent2 (entget en2)
  6.         t1   (cdr (assoc 1 ent1))
  7.         t2   (cdr (assoc 1 ent2)
  8.              )
  9.   )
  10.   (if (eq t1 "")
  11.     (setq t1 (cdr (assoc 42 ent1)))
  12.   )
  13.   (if (eq t2 "")
  14.     (setq t2 (cdr (assoc 42 ent2)))
  15.   )
  16.   (if (eq (type t1) 'STR)
  17.     (setq t1 (atof t1))
  18.   )
  19.   (if (eq (type t2) 'STR)
  20.     (setq t2 (atof t2))
  21.   )
  22.   (cond        ((> t1 t2) (princ "\n先大于后"))
  23.         ((= t1 t2) (princ "\n先等于后"))
  24.         ((< t1 t2) (princ "\n先小于后"))
  25.   )
  26.   (princ)
  27. )

回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-4-25 21:59 , Processed in 7.467607 second(s), 26 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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