这应该有效:
- (defun C:exd (/ *error* vl ov ss) ;; Localise Variables!
- ;; Error Handler to Reset Sys Vars in case User hits Esc!
-
- (defun *error* (msg)
- (and ov (mapcar 'setvar vl ov))
- (or (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*")
- (princ (strcat "\n** Error: " msg " **")))
- (princ))
- ;; Get Sysvars and store them
- (setq vl '("CMDECHO" "PEDITACCEPT") ov (mapcar 'getvar vl))
- ;; Set sys vars to what we want
-
- (mapcar 'setvar vl '(0 1))
- ;; Include IF statment to allow for a null SelectionSet
- (if (setq ss (ssget "_X" '((0 . "*POLYLINE"))))
- (command "_.pedit" "_M" ss "" "_L" "ON" ""))
- ;; Reset Sys Vars
-
- (mapcar 'setvar vl ov)
- (princ))
请阅读评论,如果你有问题,尽管问
李 |