Author Topic: pedit join lines slow  (Read 852 times)

0 Members and 1 Guest are viewing this topic.

masao

  • Newt
  • Posts: 97
pedit join lines slow
« on: July 22, 2023, 01:47:38 PM »
Hi,
I want use pedit to join lines ,some lines is ok.
But lines too many lisp is slowly,how can i set function?

My thinking :

If pedit join lines select some once,but I don’t know how much lines have not cad alert to show.
Select too much lines cad have to show alert.

Have else function  to quick lisp?

i use this code:
Code: [Select]
(defun c:jn (/ lines lines2 cnt)
(setvar "cmdecho" 0)
(setq lines (ssget (list (cons 0 "LINE,ARC,LWPOLYLINE,POLYLINE")))) ;POLYLINE added 300910 - will crash with 3D POLYLINES
(if lines
 (progn
  (while (> (sslength lines) 0)
   (if (= (cdr (assoc 0 (entget (ssname lines 0)))) "LWPOLYLINE")
    (progn
     (command "pedit" (ssname lines 0) "j" lines "" "X")
     (ssdel (ssname lines 0) lines)
    )
    (command "pedit" (ssname lines 0) "y" "j" lines "" "X")
   )
   (setq lines2 (ssadd))
   (setq cnt 0 len (sslength lines))
   (while (< cnt len)
    (if (entget (ssname lines cnt))
     (setq lines2 (ssadd (ssname lines cnt) lines2))
    )
    (setq cnt (1+ cnt))
   )
   (setq lines lines2)

  )
  (princ "\n......Tada!!")
 )
 (princ "\n....Doh!!")
)
(setvar "cmdecho" 1)
(princ)
)
« Last Edit: July 23, 2023, 07:56:53 AM by masao »