home *** CD-ROM | disk | FTP | other *** search
- ;;; DDUCSP.LSP
- ;;; ¬⌐┼v (C) 1992 Autodesk ñ╜Ñq
- ;;;
- ;;; Ñ╗│n┼ΘºK╢O¿╤▒z╢iªµÑ⌠ª≤Ñ╬│~╗▌¿D¬║½■¿⌐íB¡╫º∩ñ╬╡oªµ, ª²¼O░╚╜╨┐φ┤`ñU¡z
- ;;; ¡∞½h :
- ;;;
- ;;; 1) ñWªC¬║¬⌐┼v│qºi░╚╗▌ÑX▓{ªb¿Cñ@Ñ≈½■¿⌐∙╪íC
- ;;; 2) ¼█├÷¬║╗í⌐·ñσÑ≤ñ]Ñ▓╢╖⌐·╕ⁿ¬⌐┼v│qºiñ╬Ñ╗╢╡│\Ñi│qºiíC
- ;;;
- ;;; Ñ╗│n┼Θ╢╚┤ú¿╤º@¼░└│Ñ╬ñW¬║░╤ª╥, ª╙Ñ╝┴n⌐·⌐╬┴⌠ºtÑ⌠ª≤½O├╥; ╣∩⌐≤Ñ⌠ª≤»S«φ
- ;;; Ñ╬│~ñº╛A║┘⌐╩, ÑHñ╬░╙╖~╛P░Γ⌐╥┴⌠ºtÑX¿π¬║½O├╥, ªbª╣ñ@╖ºñ⌐ÑHº_╗{íC
- ;;;
- ;;;
- ;;; C:DDUCSP - User Coordinate System presets dialogue for use
- ;;; with the AutoCAD Release 12 Standard Menu.
- ;;;
- ;;; Uses DDUCSP.DCL for the dialogue definition. The
- ;;; slide images are in ACAD.SLB.
- ;;;
- ;;; ===========================================================================
- ;;; ===================== load-time error checking ============================
- ;;;
-
- (defun ai_abort (app msg)
- (defun *error* (s)
- (if old_error (setq *error* old_error))
- (princ)
- )
- (if msg
- (alert (strcat " └│Ñ╬╡{ªí┐∙╗~: "
- app
- " \n\n "
- msg
- " \n"
- )
- )
- )
- (exit)
- )
-
- ;;; Check to see if AI_UTILS is loaded, If not, try to find it,
- ;;; and then try to load it.
- ;;;
- ;;; If it can't be found or it can't be loaded, then abort the
- ;;; loading of this file immediately, preserving the (autoload)
- ;;; stub function.
-
- (cond
- ( (and ai_dcl (listp ai_dcl))) ; it's already loaded.
-
- ( (not (findfile "ai_utils.lsp")) ; find it
- (ai_abort "DDUCSP"
- (strcat "ºΣñú¿∞íuAI_UTILS.LSPív└╔«╫;"
- "\n └╦¼díusupportívÑ╪┐²íC")))
-
- ( (eq "failed" (load "ai_utils" "failed")) ; load it
- (ai_abort "DDUCSP" "╡L¬k╕ⁿñJíuAI_UTILS.LSPív└╔«╫"))
- )
-
- (if (not (ai_acadapp)) ; defined in AI_UTILS.LSP
- (ai_abort "DDUCSP" nil) ; a Nil <msg> supresses
- ) ; ai_abort's alert box dialog.
-
- ;;; ==================== end load-time operations ===========================
-
- (defun ai_ucsp_start ()
- (foreach v0 '("world" "left" "cview" "top" "front"
- "bottom" "back" "right" "prev")
- (start_image (strcat "ucsp_" v0))
- (slide_image
- 0 0
- (- (dimx_tile (strcat "ucsp_" v0)) 1) (- (dimy_tile (strcat "ucsp_" v0)) 1)
- (strcat "acad(u-" v0 ")")
- )
- (end_image)
- )
- )
-
- (defun ai_ucsp_set ()
- (if ai_ucsp_sv
- (command "_.UCS" "_V")
- (if ai_ucsp_prevs
- (command "_.UCS" "_P")
- (if ai_ucsp_chg
- (progn
- (if (/= ai_ucsp_a "*")
- (setvar "LASTPOINT" (trans (getvar "UCSORG") 0 1))
- )
- (if (< ai_ucsp_pick 6)
- (setq ai_ucsp_set0 "@")
- (setq ai_ucsp_set0 "*0,0,0" ai_ucsp_a "*")
- )
- (cond ((= ai_ucsp_pick 0)
- (setq ai_ucsp_set1 "0,-1,0"
- ai_ucsp_set2 "0,0,1"
- )
- )
- ((= ai_ucsp_pick 2)
- (setq ai_ucsp_set1 "1,0,0"
- ai_ucsp_set2 "0,0,1"
- )
- )
- ((= ai_ucsp_pick 3)
- (setq ai_ucsp_set1 "1,0,0"
- ai_ucsp_set2 "0,-1,0"
- )
- )
- ((= ai_ucsp_pick 4)
- (setq ai_ucsp_set1 "-1,0,0"
- ai_ucsp_set2 "0,0,1"
- )
- )
- ((= ai_ucsp_pick 5)
- (setq ai_ucsp_set1 "0,1,0"
- ai_ucsp_set2 "0,0,1"
- )
- )
- (T
- (setq ai_ucsp_set1 "1,0,0"
- ai_ucsp_set2 "0,1,0"
- )
- )
- )
- (command "_.UCS" "_3P" ai_ucsp_set0
- (strcat ai_ucsp_a ai_ucsp_set1)
- (strcat ai_ucsp_a ai_ucsp_set2)
- )
- )
- )
- )
- )
- )
-
- (defun ai_ucsp_p (val currtile)
- (mode_tile ai_ucsp_currtile 4)
- (setq ai_ucsp_pick val
- ai_ucsp_sv nil
- ai_ucsp_currtile currtile
- )
- (if (/= val 1)
- (setq ai_ucsp_chg T)
- )
- (mode_tile ai_ucsp_currtile 4)
- )
-
- (defun ai_ucsp_swcs ()
- (mode_tile ai_ucsp_currtile 4)
- (set_tile "ucsp_a_wcs" "1")
- (setq ai_ucsp_pick 6
- ai_ucsp_sv nil
- ai_ucsp_currtile "ucsp_world"
- )
- (if (/= 1 (getvar "WORLDUCS"))
- (setq ai_ucsp_chg T)
- (setq ai_ucsp_chg nil)
- )
- (mode_tile ai_ucsp_currtile 4)
- )
-
- (defun ai_ucsp_cview ()
- (mode_tile ai_ucsp_currtile 4)
- (setq ai_ucsp_sv T
- ai_ucsp_chg nil
- ai_ucsp_currtile "ucsp_cview"
- )
- (set_tile "ucsp_a_wcs" "1")
- (mode_tile ai_ucsp_currtile 4)
- )
-
- (defun ai_ucsp_rucs (typ)
- (setq ai_ucsp_a typ)
- (mode_tile ai_ucsp_currtile 2)
- )
-
- (defun ai_ucsp_prev ()
- (mode_tile ai_ucsp_currtile 4)
- (setq ai_ucsp_prevs T
- ai_ucsp_currtile "ucsp_prev"
- )
- (mode_tile ai_ucsp_currtile 4)
- )
-
- (defun do_help (cmd)
- (if (= (type acad_helpdlg) 'EXSUBR)
- (acad_helpdlg "acad.hlp" cmd)
- (alert "ºΣñú¿∞íu¿DºU╣∩╕▄ív - xload acadapp íC")
- )
- (princ)
- )
-
- (defun ai_ucsp_main ( / ai_ucsp_pick ai_ucsp_sv globals)
- (if (not (new_dialog "dducsp" dcl_id))
- (exit)
- )
-
- (ai_ucsp_start)
- (setq ai_ucsp_a "@"
- ai_ucsp_pick 2
- ai_ucsp_currtile "ucsp_top"
- )
- (if (= 1 (getvar "WORLDUCS"))
- (progn
- (set_tile "ucsp_a_wcs" "1")
- (setq ai_ucsp_currtile "ucsp_world")
- )
- (set_tile "ucsp_r_ucs" "1")
- )
- (mode_tile ai_ucsp_currtile 2)
- (mode_tile ai_ucsp_currtile 4)
- (action_tile "ucsp_world" "(ai_ucsp_swcs)")
- (action_tile "ucsp_cview" "(ai_ucsp_cview)")
- (action_tile "ucsp_left" "(ai_ucsp_p 0 $key)")
- (action_tile "ucsp_top" "(ai_ucsp_p 1 $key)")
- (action_tile "ucsp_front" "(ai_ucsp_p 2 $key)")
- (action_tile "ucsp_bottom" "(ai_ucsp_p 3 $key)")
- (action_tile "ucsp_back" "(ai_ucsp_p 4 $key)")
- (action_tile "ucsp_right" "(ai_ucsp_p 5 $key)")
- (action_tile "ucsp_prev" "(ai_ucsp_prev)")
- (action_tile "ucsp_r_ucs" "(ai_ucsp_rucs \"@\")")
- (action_tile "ucsp_a_wcs" "(ai_ucsp_rucs \"*\")")
- (action_tile "accept" "(done_dialog 1)")
- (action_tile "cancel" "(done_dialog 0)")
- (action_tile "help" "(do_help \"DDUCSP\")")
- (if (= (start_dialog) 1)
- (ai_ucsp_set)
- )
- )
-
- (defun c:dducsp ( / app dcl_id old_cmd old_osmode ai_ucsp_prevs
- ai_ucsp_sw undo_init)
-
- ;; Set up error function.
- (setq old_cmd (getvar "CMDECHO") ; save current setting of cmdecho
- old_error *error* ; save current error function
- *error* ai_error ; new error function
- old_osmode (getvar "OSMODE") ; disable OSNAP for duration
- )
-
- (setvar "CMDECHO" 0)
- (setvar "OSMODE" 0)
-
- (cond
- ( (not (ai_notrans))) ; transparent not OK
- ( (not (ai_acadapp))) ; ACADAPP.EXP xloaded?
- ( (not (setq dcl_id (ai_dcl "dducsp")))) ; is .DCL file loaded?
- (T (ai_undo_push)
- (ai_ucsp_main)
- (ai_undo_pop)
- )
- )
-
- (setvar "OSMODE" old_osmode)
- (setq *error* old_error)
- (setvar "cmdecho" old_cmd)
-
- (princ)
- )
-
- (princ " DDUCSP ñw╕ⁿñJíC ")
- (princ)