乐筑天下

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

[编程交流] Alert script no round-up line

[复制链接]

2

主题

2

帖子

0

银币

初来乍到

Rank: 1

铜币
10
发表于 2022-7-5 16:25:03 | 显示全部楼层 |阅读模式
I use autocad for architectural projects, and all the time I draw lines with round length (except of course diagonal lines or arcs), with a precision of centimeter so no smaller than 0.01. Sometimes when I snap to a point, for mistake autocad snaps to something very close, so close and small that I don't realise soon this mismatch. The problem is that usually I discover the wrong length much later, when I have already spread this mistake across the drawing. So, can you suggest me a script which gives me an allert when a line with a length smaller that 0.01 has been drawn?
 
Thanks
回复

使用道具 举报

106

主题

1万

帖子

101

银币

顶梁支柱

Rank: 50Rank: 50

铜币
1299
发表于 2022-7-5 17:13:01 | 显示全部楼层
Take a bit more care with your osnap settings and turn off stuff like GRID.
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-5 17:46:08 | 显示全部楼层
The following will select all lines shorter than a given length:
  1. (defun c:shortlines ( / ent enx idx mnl sel )      (setq mnl 0.01) ;; Minimum allowable line length   (if (setq sel (ssget "_X" (list '(0 . "LINE") (if (= 1 (getvar 'cvport)) (cons 410 (getvar 'ctab)) '(410 . "Model")))))       (repeat (setq idx (sslength sel))           (setq ent (ssname sel (setq idx (1- idx)))                 enx (entget ent)           )           (if (< mnl (distance (cdr (assoc 10 enx)) (cdr (assoc 11 enx))))               (ssdel ent sel)           )       )   )   (sssetfirst nil sel)   (princ))
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-3-14 13:09 , Processed in 0.436335 second(s), 58 queries .

© 2020-2025 乐筑天下

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