chenqiang26 发表于 2019-4-1 08:09:44

刚开始学有没给写个这个的。。

批量选择直线后,两端缩短一个可输入的值,然后以2个端点,绘制两条可输入值得线段.....只有一个币了

start4444 发表于 2019-4-1 08:09:45

(defun c:tt (/ d1 d2 en ent ang i)
        (setq d1 (getreal "\n输入缩短长度:") d2 (getreal "\n输入新画长度:") ss (ssget '((0 . "LINE"))) i -1)
        (while (setq en (ssname ss (setq i (1+ i))))
                (setq ent (entget en) p1 (cdr (assoc 10 ent)) p2 (cdr (assoc 11 ent)) ang (angle p1 p2))
                (command "line" "non" (polar p1 ang d1) "non" (polar p1 ang (+ d1 d2)) "" "line" "non" (polar p2 (+ ang pi) d1) "non" (polar p2 (+ ang pi) (+ d1 d2)) "" "ERASE" en "")
        )
)

纵横八方 发表于 2019-4-1 13:40:04

没币了,刷点币

chenqiang26 发表于 2019-4-2 05:11:29

start4444 发表于 2019-4-1 08:09
(defun c:tt (/ d1 d2 en ent ang i)
        (setq d1 (getreal "\n输入缩短长度:") d2 (getreal "\n输入新画长 ...

很好用,。
(setq d1 (getreal "\n输入缩短长度<1>:") d2 (getreal "\n输入新画长度<10>:") ss (ssget '((0 . "LINE"))) i -1)
如果不输入默认110 ,还需要加什么进去啊

start4444 发表于 2019-4-2 10:35:14

chenqiang26 发表于 2019-4-2 05:11
很好用,。
(setq d1 (getreal "\n输入缩短长度:") d2 (getreal "\n输入新画长度:") ss (ssget '((0...

后面加这句
(if (= d1 nil) (setq d1 1)) (if (= d2 nil) (setq d2 10))

chenqiang26 发表于 2019-4-3 14:58:34

start4444 发表于 2019-4-2 10:35
后面加这句
(if (= d1 nil) (setq d1 1)) (if (= d2 nil) (setq d2 10))

今天使用时候发现一个问题,在批量处理的时候,我经常是FI筛选出来的,,能不能帮我改成先选择后输入命令
页: [1]
查看完整版本: 刚开始学有没给写个这个的。。