- ;;; 用模糊距离连接线,弧和多义线
- (defun c:jf () (c:pljoinfuzz)) ; this line can be commented out if there is an existing command called jf
- (defun c:pljoinfuzz (/ ss1 entLine objType oldcmdecho oldpeditaccept fuzz okObjects)
- (setq oldcmdecho (getvar "cmdecho"))
- (setq oldpeditaccept (getvar "PEDITACCEPT"))
- (setvar "cmdecho" 0)
- (setq A2k4 (>= (substr (getvar "ACADVER") 1 2) "16"))
- (if A2k4 (setvar "PEDITACCEPT" 0))
- (setq okObjects '((0 . "LINE,ARC,POLYLINE,LWPOLYLINE")))
- (princ "\nSelect object to join: ")
- (setq ss1 (ssget okObjects))
- (setq fuzz (getdist "\nFuzz distance <0>: "))
- (if (= fuzz nil) (setq fuzz 0))
- (if (/= ss1 nil)
- (progn
- (setq objType (cdr (assoc 0 (entget (setq entLine (ssname ss1 0))))))
- (if (= (sslength ss1) 1) (setq ss1 (ssget "X" okObjects)))
- (if (member objType '("LINE" "ARC"))
- (command "_.pedit" "_M" ss1 "" "_Y" "_J" "_J" "_B" fuzz "")
- (command "_.pedit" "_M" ss1 "" "_J" "_J" "_B" fuzz "")
- )
- )
- )
- (setq ss1 nil)
- (setvar "cmdecho" oldcmdecho)
- (if A2k4 (setvar "PEDITACCEPT" oldpeditaccept))
- (princ)
- )
|