diff --git a/at-curve/at-curve.lsp b/at-curve/at-curve.lsp index 690bd257bcf85170c4311e880000e2b803c3149b..a75764859d49acdb66ebc47220330dc58509a747 100644 --- a/at-curve/at-curve.lsp +++ b/at-curve/at-curve.lsp @@ -23,6 +23,7 @@ '("曲线工具2" ("检查闭合" (at-curve:noclosed-endpt)) ("清闭合标志" (at-curve:rm-flagpts)) + ("按序号连点" (at-curve:join-by-number)) )) (@:define-config '@curve:types diff --git a/at-curve/join-by-number.lsp b/at-curve/join-by-number.lsp new file mode 100644 index 0000000000000000000000000000000000000000..1c1fe9eeef04075ec582c92059655adfd89fe27d --- /dev/null +++ b/at-curve/join-by-number.lsp @@ -0,0 +1,26 @@ +(defun at-curve:join-by-number (/ dist) + (setq dist 10) + (setq pts (pickset:to-list (ssget '((0 . "point"))))) + (setq pts + (vl-sort pts + '(lambda(x y) + (if (and + (setq nox + (car (pickset:to-list + (ssget + "c" + (entity:getdxf x 10) + (polar (entity:getdxf x 10) (* 0.25 pi) dist) + '((0 . "text")(1 . "#,##,###")))))) + (setq noy + (car (pickset:to-list + (ssget + "c" + (entity:getdxf y 10) + (polar (entity:getdxf y 10) (* 0.25 pi) 10) + '((0 . "text")(1 . "#,##,###"))))))) + (< (atoi (entity:getdxf nox 1)) + (atoi (entity:getdxf noy 1))))))) + (setq pts (mapcar '(lambda(x)(entity:getdxf x 10)) pts)) + (entity:make-lwpolyline pts nil 0 1 0)) + diff --git a/at-curve/pkg.lsp b/at-curve/pkg.lsp index 6f68b1c048e2f00c9081606002fb43fd08d44f87..b103d2b6c34cbaa1949cce84f8feaeb5e1f7d94f 100755 --- a/at-curve/pkg.lsp +++ b/at-curve/pkg.lsp @@ -2,7 +2,7 @@ (:FULL-NAME . "@lisp curve") (:AUTHOR . "VitalGG") (:EMAIL . "vitalgg@gmail.com") - (:VERSION . "0.1.30") + (:VERSION . "0.1.33") (:LOCALE . "chs") (:CATEGORY . "Common") (:REQUIRED . "base") @@ -18,5 +18,6 @@ "link-obj" "unclosed" "sp2pl" + "join-by-number" "lw-to-3d" "stat")))