chenry676 发表于 2020-12-5 08:55:21

哪位高手帮我把两点等分改为选择线段(或多义线等分)(已解决)

本帖最后由 chenry676 于 2021-12-30 10:44 编辑

哪位高手帮我把两点等分改为选择线段(或多义线等分)

LYC688 发表于 2021-12-25 23:10:15

没人能改?

htlaser 发表于 2021-12-27 11:55:13

本帖最后由 htlaser 于 2021-12-27 11:58 编辑

(defun c:fz( / len n p1 p2 ang1 p0 m)
    (setq len (entget (car (entsel "\n 选择参照直线对象:")))
    p1(cdr (assoc 10 len))
    p2(cdr (assoc 11 len))
   ang1 (angle p1 p2))
   (setq n (getint "\n输入等分数:"))
   (if (null n)(setq n 2))
   (setq p0 (polar p1 ang1 (/ (distance p1 p2) n)))
   (setq m 0)
   (repeat (- n 1)
   (command "xline" "b" "non" p0 "non" p1 "non" p2 "")
   (setq m (+ m 1))
   (setq p0 (polar p0 ang1 (/ (distance p1 p2) n)))
   )
)

chenry676 发表于 2021-12-27 15:42:00

htlaser 发表于 2021-12-27 11:55
(defun c:fz( / len n p1 p2 ang1 p0 m)
    (setq len (entget (car (entsel "\n 选择参照直线对象:")))
...

我输入fz命令没有反应,能否帮忙检查一下?

yoyoho 发表于 2023-12-10 22:58:11

(defun c:fz( / len n p1 p2 ang1 p0 m)
    (setq lent (car (entsel "\n 选择参照直线对像:")))
    (setq len (entget lent)
    ;p1(cdr (assoc 10 len))
    p1(vlax-curve-getstartpoint lent)
    ;p2(cdr (assoc 11 len))
    p2(vlax-curve-getendpoint lent)
   ang1 (angle p1 p2))
   (setq n (getint "\n输入等分数:"))
   (if (null n)(setq n 2))
   (setq p0 (polar p1 ang1 (/ (distance p1 p2) n)))
   (setq m 0)
   (repeat (- n 1)
   (command "xline" "b" "non" p0 "non" p1 "non" p2 "")
   (setq m (+ m 1))
   (setq p0 (polar p0 ang1 (/ (distance p1 p2) n)))
   )
)
页: [1]
查看完整版本: 哪位高手帮我把两点等分改为选择线段(或多义线等分)(已解决)