明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 966|回复: 2

[经验] 这个问题该怎么解决呢?

[复制链接]
发表于 2013-12-29 12:49 | 显示全部楼层 |阅读模式
本帖最后由 275437962 于 2013-12-29 12:52 编辑

  1. (defun myss (minl maxl / e len n obj ss)
  2.   (if (setq ss (ssget '((0 . "LINE"))))
  3.     (repeat (setq n (sslength ss))
  4.       (setq e (ssname ss (setq n (1- n))))
  5.       (setq obj (vlax-ename->vla-object e))
  6.       (setq len (vlax-get obj 'length))
  7.       (if (or
  8.             (< len minl)
  9.             (> len maxl)
  10.           )
  11.         (ssdel e ss)
  12.       )
  13.     )
  14.   )
  15.   ss
  16. )

  17. (defun c:sss (/ a b ss)
  18.   (if (not (setq a (getdist "\n请指定最小长度<0.01>:")))
  19.     (setq a 0.5)
  20.   )
  21.   (if (not (setq b (getdist "\n请指定最大长度<0.08>:")))
  22.     (setq b 2.5)
  23.   )
  24.   (if (and
  25.         a
  26.         b
  27.       )
  28.     (if (setq ss (myss a b))
  29.       (command "._select" ss "" "._pselect" ss "")
  30.     )
  31.   )
  32.   (princ)
  33. )


如何提高这个程序快速选择的精度,如我要选择的直线是0.0798,那么按上面程序的最小长度和最大长度,这条线不能被选中!!能否让这个选择的精度,精确到小数点后四位!!




 楼主| 发表于 2013-12-29 16:59 | 显示全部楼层
怎么回事!!
发表于 2013-12-30 00:20 | 显示全部楼层
不明白楼主说的什么情况.
最小长度输入0.0001不就可以了吗,或者输入0
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-5-17 19:07 , Processed in 0.143646 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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