本帖最后由 gaics 于 2020-8-20 10:49 编辑
 - (defun C:J (/ pick vs pc obj nam pcx pcy vs1 pt1 pt2 cir ly lys)
- (setvar "cmdecho" 0)
- ;;获取已关闭、锁定或冻结图层名
- (vl-load-com)
- (vlax-for x (vla-get-layers
- (vla-get-activedocument (vlax-get-acad-object))
- )
- (if (or (= (vla-get-lock x) :vlax-true)
- (= (vla-get-layeron x) :vlax-false)
- (= (vla-get-freeze x) :vlax-true)
- )
- (progn (setq ly (vla-get-name x))
- (if lys
- (setq lys (strcat ly "," lys))
- (setq lys ly)
- )
- )
- )
- )
- ;;获取已关闭、锁定或冻结图层名
- (while (not (or (= nam "LINE") (= nam "LWPOLYLINE") (= nam "ARC")))
- (setq obj (car (entsel "\n选择要编辑的非封闭实体")))
- (while (null obj)
- (setq obj (car (entsel "\n选择要编辑的非封闭实体")))
- )
- (setq nam (cdr (assoc 0 (entget obj))))
- (setq cir (cdr (assoc 70 (entget obj))))
- )
- (if (= cir 1)
- (prompt "\n你选择的是已经编辑好的多义线")
- (progn
- (setq ss (ssget "x"
- (list (cons -4 "<or")
- (cons 0 "LINE")
- (cons 0 "ARC")
- (cons 0 "LWPOLYLINE")
- (cons -4 "or>")
- (cons -4 "<not")
- (cons 8 lys);;过滤已关闭、锁定或冻结图层
- (cons -4 "not>")
- )
- )
- )
- (if (or (= nam "LINE") (= nam "ARC"))
- (command "PEDIT" obj "" "j" SS "" "")
- )
- (if (or (= nam "LWPOLYLINE"))
- (command "PEDIT" obj "j" SS "" "")
- )
- )
- )
- )
|