yuping913 发表于 2019-4-10 14:19:33

求直线或者多段线定距缩短的lisp


由于工作需要,要批量缩短多段线(直线)两端的长度,
LENGTHEN命令只能单向增量而不能缩短,好鸡肋,有人有好的思路吗,谢谢

1291500406 发表于 2019-4-10 16:17:13

本帖最后由 1291500406 于 2019-4-13 14:51 编辑

(defun c:bb ()(initget 7)(setq d (-(getreal "\n缩短的距离:")))(while(setq e (car(entsel "\n选择线:")))(command "_lengthen" "de" d)
(command (list e (trans (vlax-curve-getStartPoint e) 0 1)) (list e (trans (vlax-curve-getEndPoint e) 0 1)) ""))(princ))

1291500406 发表于 2019-4-10 17:13:32

本帖最后由 1291500406 于 2019-4-13 14:50 编辑

这么简单的,自己写写就是了

szx025 发表于 2019-4-11 08:03:49

选择直线或多段线,让最靠近选择点的线段端点延长一个指定长度,有人有好的思路吗,谢谢

ll_j 发表于 2019-4-11 09:05:07

lengthen命令的距离输入负值就是缩短啊

ketxu 发表于 2019-4-12 01:07:56

I have code this lisp, with dialog to choice to change length from start, end, or both direction. How can i transfer it for you ? Sorry for my bad language, i'm a newbie and i'm Vietnamese.

satan421 发表于 2019-4-12 09:24:42

ketxu 发表于 2019-4-12 01:07
I have code this lisp, with dialog to choice to change length from start, end, or both direction. Ho ...

You can paste codes here directly or upload as an attachment.
Sorry for my english.

satan421 发表于 2019-4-12 11:27:04

本帖最后由 satan421 于 2019-4-12 11:42 编辑

;;简单写了个,需要在WCS下
;;仅考虑直线及2个节点的pl线,未考虑三维多段线等

satan421 发表于 2019-4-12 11:55:34

@yuping913

你评论我貌似没办法直接回复你

可以用原对象的属性,改几个语句就行了

yuping913 发表于 2019-4-15 08:48:37

satan421 发表于 2019-4-12 11:55
@yuping913

你评论我貌似没办法直接回复你


大神能帮忙改一下吗?我初学好多地方看不明白
页: [1] 2
查看完整版本: 求直线或者多段线定距缩短的lisp