youyou3810 发表于 2019-5-4 17:24:16

(修改边长)程序不会做了水平还是差的很远

本帖最后由 youyou3810 于 2019-5-4 21:01 编辑

(defun c:tt1 ()

(setq i 0)
    (setq pline (car (entsel)))
    (setq ent (entget pline))
    (setq pts nil)
    (repeat (length ent)
    (if (= (car (nth i ent)) 10)
      (setq pts (append pts (list (cdr (nth i ent)))))
    )
    (setq i (1+ i))
    )
    (print pts)
(nth 0 pts)

(setq pt1 (getpoint "点1:"))
(setq pt2 (getpoint pt1 "点2:"))
(setq pt3 (getpoint pt2 "点3:"))
(setq ag0 (angle pt1 pt2))    ;p1p2角度
(setqlen (distance pt1 pt3)
ag(angle pt1 pt3)
)
(setq pt2 (polar pt1 ag0 (* len (cos (- ag ag0)))))
(setq pt4 (polar pt1 (+ (/ pi 2.) ag0) (* len (sin (- ag ag0)))))

; (command "pline" pt1 pt2 pt3 pt4 "c" "")
(setq ent(subst(cons 10 pt1)(assoc 10 ent)ent))
(entmod ent);
)

youyou3810 发表于 2019-5-4 20:49:35

本帖最后由 youyou3810 于 2019-5-4 21:13 编辑

(defun c:tt1 ()

(setq i 0)
    (setq pline (car (entsel)))
    (setq ent (entget pline))
    (setq pts nil)
    (repeat (length ent)
    (if (= (car (nth i ent)) 10)
      (setq pts (append pts (list (cdr (nth i ent)))))
    )
    (setq i (1+ i))
    )
    (print pts)
(nth 0 pts)

(setq pt1 (getpoint "点1:"))
(setq pt2 (getpoint pt1 "点2:"))

    (setq ent(subst(cons 10 pt1)(assoc 10 ent)ent))
(entmod ent);重生成更新图元,显示到鼠标 位置
)

1291500406 发表于 2019-5-5 23:28:00

youyou3810 发表于 2019-5-5 23:25
取得图元名后 起点 端点坐标怎么取出来

https://wenku.baidu.com/view/5802400c76232f60ddccda38376baf1ffc4fe398.html

taoyi0727 发表于 2019-5-4 21:52:24

你想要的效果都没有表达清楚
搞不了 我的水平也不高

修改2点的位置 和修改边长是不一样的
修改位置就用夹点拖动就行了噻

youyou3810 发表于 2019-5-4 17:25:16

(setq ent0 (subst (nth 0 pts) (pt1) ent))
(entmod ent0);重生成更新图元
就这两句了

youyou3810 发表于 2019-5-4 18:07:50

(setq ent(subst(cons 10 pt1)(assoc 10 ent)ent))

youyou3810 发表于 2019-5-4 18:21:52

(setq ent(subst(cons 10 pt1)(assoc 10 ent)ent)) 如何取到其他坐标

taoyi0727 发表于 2019-5-4 18:58:26

看不懂你这个程序是干什么的
(setq ssdata (subst new_rr old_rr ssdata))这句完全没用

youyou3810 发表于 2019-5-4 20:50:35

本帖最后由 youyou3810 于 2019-5-4 21:02 编辑

修改封闭多段线的一条边的边长,代码我写不下去了,现在只想修改一个边的边长,发现这也很难

youyou3810 发表于 2019-5-4 21:27:02

本帖最后由 youyou3810 于 2019-5-4 21:32 编辑


这是目前效果
1 本意修改点2位置
2 可以修改任意边长就好了

youyou3810 发表于 2019-5-5 00:33:18

(setq ent(subst(cons 10 pt2)(assoc 10 (nth 1 pts))ent)) 选中pt2点 调整(assoc 10 (nth 1 pts))这个点位没有作用
页: [1] 2
查看完整版本: (修改边长)程序不会做了水平还是差的很远