太棒了,李!我稍微调整了一下(为了我的喜好)
- (defun c:breakfirst2 ( / *error* ent pnt stop typ )
- (defun *error* ( msg )
- (if (not (member msg '("Function cancelled" "quit / exit abort")))
- (princ (strcat "\nError: " msg))
- )
- (princ)
- )
- (while (not stop)
- (setvar 'errno 0)
- (setq ent (entsel "\nSelect object to break: "))
- (cond
- ( (= 52 (getvar 'errno))
- (setq stop t)
- )
- ( (null ent)
- (princ "\nYou missed. Try again.")
- )
- ( (not (wcmatch (setq typ (cdr (assoc 0 (entget (car ent))))) "LINE,XLINE,RAY,LWPOLYLINE,ARC,CIRCLE,POLYLINE,AECC_FEATURE_LINE"))
- (princ "\nNot a valid object, try again.")
- )
- ( (not (setq pnt (getpoint "\nSelect break point: ")))
- (setq stop t)
- )
- ( (= typ "AECC_FEATURE_LINE")
- (command "_.aeccbreakfeatures" ent "_f" "_non" pnt "_non" pnt)
- (setq stop t)
- )
- ( t
- (while (command "_.break" ent "_f" "_non" pnt "_non" pnt)
- (setq stop t))
- )
- )
- )
- (princ)
- )
|