或者,作为对先前代码的改进:
- (defun c:e45 ( / *error* p1 p2 cmd )
- (defun *error* ( msg )
- (if cmd (setvar 'CMDECHO cmd))
- (or (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*")
- (princ (strcat "\n** Error: " msg " **")))
- (princ)
- )
- (setq cmd (getvar 'CMDECHO))
- (setvar 'CMDECHO 0)
- (if
- (progn
- (initget "Center")
- (setq p1 (getpoint "\nSpecify Axis Endpoint [Center]: "))
- )
- (cond
- (
- (eq "Center" p1)
- (if
- (and
- (setq p1 (getpoint "\nSpecify Center of Ellipse: "))
- (setq p2 (getpoint "\nSpecify Endpoint of Axis: " p1))
- )
- (command "_.ellipse" "_C" "_non" p1 "_non" p2 "_R" 45.0)
- )
- )
- ( (setq p2 (getpoint "\nSpecify Other Endpoint of Axis: " p1))
- (command "_.ellipse" "_non" p1 "_non" p2 "_R" 45.0)
- )
- )
- )
- (setvar 'CMDECHO cmd)
- (princ)
- )
|