home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 13 / 13.iso / p / p024 / 6.img / SUPPORT4.LIB / DDUCSP.LSP < prev    next >
Encoding:
Text File  |  1992-08-27  |  7.3 KB  |  261 lines

  1. ;;;   DDUCSP.LSP
  2. ;;;   ¬⌐┼v (C) 1992  Autodesk ñ╜Ñq
  3. ;;;
  4. ;;;   Ñ╗│n┼ΘºK╢O¿╤▒z╢iªµÑ⌠ª≤Ñ╬│~╗▌¿D¬║½■¿⌐íB¡╫º∩ñ╬╡oªµ, ª²¼O░╚╜╨┐φ┤`ñU¡z
  5. ;;;   ¡∞½h :
  6. ;;;
  7. ;;;   1)  ñWªC¬║¬⌐┼v│qºi░╚╗▌ÑX▓{ªb¿Cñ@Ñ≈½■¿⌐∙╪íC
  8. ;;;   2)  ¼█├÷¬║╗í⌐·ñσÑ≤ñ]Ñ▓╢╖⌐·╕ⁿ¬⌐┼v│qºiñ╬Ñ╗╢╡│\Ñi│qºiíC
  9. ;;;
  10. ;;;   Ñ╗│n┼Θ╢╚┤ú¿╤º@¼░└│Ñ╬ñW¬║░╤ª╥, ª╙Ñ╝┴n⌐·⌐╬┴⌠ºtÑ⌠ª≤½O├╥; ╣∩⌐≤Ñ⌠ª≤»S«φ
  11. ;;;   Ñ╬│~ñº╛A║┘⌐╩, ÑHñ╬░╙╖~╛P░Γ⌐╥┴⌠ºtÑX¿π¬║½O├╥, ªbª╣ñ@╖ºñ⌐ÑHº_╗{íC
  12. ;;;
  13. ;;;
  14. ;;;   C:DDUCSP - User Coordinate System presets dialogue for use
  15. ;;;              with the AutoCAD Release 12 Standard Menu.
  16. ;;;
  17. ;;;              Uses DDUCSP.DCL for the dialogue definition.  The
  18. ;;;              slide images are in ACAD.SLB.
  19. ;;;
  20. ;;; ===========================================================================
  21. ;;; ===================== load-time error checking ============================
  22. ;;;
  23.  
  24.   (defun ai_abort (app msg)
  25.      (defun *error* (s)
  26.         (if old_error (setq *error* old_error))
  27.         (princ)
  28.      )
  29.      (if msg
  30.        (alert (strcat " └│Ñ╬╡{ªí┐∙╗~: "
  31.                       app
  32.                       " \n\n  "
  33.                       msg
  34.                       "  \n"
  35.               )
  36.        )
  37.      )
  38.      (exit)
  39.   )
  40.  
  41. ;;; Check to see if AI_UTILS is loaded, If not, try to find it,
  42. ;;; and then try to load it.
  43. ;;;
  44. ;;; If it can't be found or it can't be loaded, then abort the
  45. ;;; loading of this file immediately, preserving the (autoload)
  46. ;;; stub function.
  47.  
  48.   (cond
  49.      (  (and ai_dcl (listp ai_dcl)))          ; it's already loaded.
  50.  
  51.      (  (not (findfile "ai_utils.lsp"))                     ; find it
  52.         (ai_abort "DDUCSP"
  53.                   (strcat "ºΣñú¿∞íuAI_UTILS.LSPív└╔«╫;"
  54.                           "\n └╦¼díusupportívÑ╪┐²íC")))
  55.  
  56.      (  (eq "failed" (load "ai_utils" "failed"))            ; load it
  57.         (ai_abort "DDUCSP" "╡L¬k╕ⁿñJíuAI_UTILS.LSPív└╔«╫"))
  58.   )
  59.  
  60.   (if (not (ai_acadapp))               ; defined in AI_UTILS.LSP
  61.       (ai_abort "DDUCSP" nil)         ; a Nil <msg> supresses
  62.   )                                    ; ai_abort's alert box dialog.
  63.  
  64. ;;; ==================== end load-time operations ===========================
  65.  
  66. (defun ai_ucsp_start ()
  67.   (foreach v0 '("world" "left" "cview" "top" "front"
  68.                 "bottom" "back" "right" "prev")
  69.     (start_image (strcat "ucsp_" v0))
  70.     (slide_image
  71.       0 0
  72.       (- (dimx_tile (strcat "ucsp_" v0)) 1) (- (dimy_tile (strcat "ucsp_" v0)) 1)
  73.       (strcat "acad(u-" v0 ")")
  74.     )
  75.     (end_image)
  76.   )
  77. )
  78.  
  79. (defun ai_ucsp_set ()
  80.   (if ai_ucsp_sv
  81.     (command "_.UCS" "_V")
  82.     (if ai_ucsp_prevs
  83.       (command "_.UCS" "_P")
  84.       (if ai_ucsp_chg
  85.         (progn
  86.           (if (/= ai_ucsp_a "*")
  87.             (setvar "LASTPOINT" (trans (getvar "UCSORG") 0 1))
  88.           )
  89.           (if (< ai_ucsp_pick 6)
  90.             (setq ai_ucsp_set0 "@")
  91.             (setq ai_ucsp_set0 "*0,0,0" ai_ucsp_a "*")
  92.           )
  93.           (cond ((= ai_ucsp_pick 0)
  94.                  (setq ai_ucsp_set1 "0,-1,0"
  95.                        ai_ucsp_set2 "0,0,1"
  96.                  )
  97.                 )
  98.                 ((= ai_ucsp_pick 2)
  99.                  (setq ai_ucsp_set1 "1,0,0"
  100.                        ai_ucsp_set2 "0,0,1"
  101.                  )
  102.                 )
  103.                 ((= ai_ucsp_pick 3)
  104.                  (setq ai_ucsp_set1 "1,0,0"
  105.                        ai_ucsp_set2 "0,-1,0"
  106.                  )
  107.                 )
  108.                 ((= ai_ucsp_pick 4)
  109.                  (setq ai_ucsp_set1 "-1,0,0"
  110.                        ai_ucsp_set2 "0,0,1"
  111.                  )
  112.                 )
  113.                 ((= ai_ucsp_pick 5)
  114.                  (setq ai_ucsp_set1 "0,1,0"
  115.                        ai_ucsp_set2 "0,0,1"
  116.                  )
  117.                 )
  118.                 (T
  119.                  (setq ai_ucsp_set1 "1,0,0"
  120.                        ai_ucsp_set2 "0,1,0"
  121.                  )
  122.                 )
  123.           )
  124.           (command "_.UCS" "_3P" ai_ucsp_set0
  125.                    (strcat ai_ucsp_a ai_ucsp_set1)
  126.                    (strcat ai_ucsp_a ai_ucsp_set2)
  127.           )
  128.         )
  129.       )
  130.     )
  131.   )
  132. )
  133.  
  134. (defun ai_ucsp_p (val currtile)
  135.   (mode_tile ai_ucsp_currtile 4)
  136.   (setq ai_ucsp_pick val
  137.         ai_ucsp_sv nil
  138.         ai_ucsp_currtile currtile
  139.   )
  140.   (if (/= val 1)
  141.     (setq ai_ucsp_chg T)
  142.   )
  143.   (mode_tile ai_ucsp_currtile 4)
  144. )
  145.  
  146. (defun ai_ucsp_swcs ()
  147.   (mode_tile ai_ucsp_currtile 4)
  148.   (set_tile "ucsp_a_wcs" "1")
  149.   (setq ai_ucsp_pick 6
  150.         ai_ucsp_sv nil
  151.         ai_ucsp_currtile "ucsp_world"
  152.   )
  153.   (if (/= 1 (getvar "WORLDUCS"))
  154.     (setq ai_ucsp_chg T)
  155.     (setq ai_ucsp_chg nil)
  156.   )
  157.   (mode_tile ai_ucsp_currtile 4)
  158. )
  159.  
  160. (defun ai_ucsp_cview ()
  161.   (mode_tile ai_ucsp_currtile 4)
  162.   (setq ai_ucsp_sv T
  163.         ai_ucsp_chg nil
  164.         ai_ucsp_currtile "ucsp_cview"
  165.   )
  166.   (set_tile "ucsp_a_wcs" "1")
  167.   (mode_tile ai_ucsp_currtile 4)
  168. )
  169.  
  170. (defun ai_ucsp_rucs (typ)
  171.   (setq ai_ucsp_a typ)
  172.   (mode_tile ai_ucsp_currtile 2)
  173. )
  174.  
  175. (defun ai_ucsp_prev ()
  176.   (mode_tile ai_ucsp_currtile 4)
  177.   (setq ai_ucsp_prevs T
  178.         ai_ucsp_currtile "ucsp_prev"
  179.   )
  180.   (mode_tile ai_ucsp_currtile 4)
  181. )
  182.  
  183. (defun do_help (cmd)
  184.   (if (= (type acad_helpdlg) 'EXSUBR)
  185.     (acad_helpdlg "acad.hlp" cmd)
  186.     (alert "ºΣñú¿∞íu¿DºU╣∩╕▄ív - xload acadapp íC")
  187.   )
  188.   (princ)
  189. )
  190.  
  191. (defun ai_ucsp_main ( / ai_ucsp_pick ai_ucsp_sv globals)
  192.   (if (not (new_dialog "dducsp" dcl_id))
  193.     (exit)
  194.   )
  195.  
  196.   (ai_ucsp_start)
  197.   (setq ai_ucsp_a "@"
  198.         ai_ucsp_pick 2
  199.         ai_ucsp_currtile "ucsp_top"
  200.   )
  201.   (if (= 1 (getvar "WORLDUCS"))
  202.     (progn
  203.       (set_tile "ucsp_a_wcs" "1")
  204.       (setq ai_ucsp_currtile "ucsp_world")
  205.     )
  206.     (set_tile "ucsp_r_ucs" "1")
  207.   )
  208.   (mode_tile ai_ucsp_currtile 2)
  209.   (mode_tile ai_ucsp_currtile 4)
  210.   (action_tile "ucsp_world" "(ai_ucsp_swcs)")
  211.   (action_tile "ucsp_cview" "(ai_ucsp_cview)")
  212.   (action_tile "ucsp_left" "(ai_ucsp_p 0 $key)")
  213.   (action_tile "ucsp_top" "(ai_ucsp_p 1 $key)")
  214.   (action_tile "ucsp_front" "(ai_ucsp_p 2 $key)")
  215.   (action_tile "ucsp_bottom" "(ai_ucsp_p 3 $key)")
  216.   (action_tile "ucsp_back" "(ai_ucsp_p 4 $key)")
  217.   (action_tile "ucsp_right" "(ai_ucsp_p 5 $key)")
  218.   (action_tile "ucsp_prev" "(ai_ucsp_prev)")
  219.   (action_tile "ucsp_r_ucs" "(ai_ucsp_rucs \"@\")")
  220.   (action_tile "ucsp_a_wcs" "(ai_ucsp_rucs \"*\")")
  221.   (action_tile "accept" "(done_dialog 1)")
  222.   (action_tile "cancel" "(done_dialog 0)")
  223.   (action_tile "help" "(do_help \"DDUCSP\")")
  224.   (if (= (start_dialog) 1)
  225.     (ai_ucsp_set)
  226.   )
  227. )
  228.  
  229. (defun c:dducsp ( / app dcl_id old_cmd old_osmode ai_ucsp_prevs
  230.                     ai_ucsp_sw undo_init)
  231.  
  232.   ;; Set up error function.
  233.   (setq old_cmd (getvar "CMDECHO")    ; save current setting of cmdecho
  234.         old_error  *error*            ; save current error function
  235.         *error* ai_error              ; new error function
  236.         old_osmode (getvar "OSMODE")  ; disable OSNAP for duration
  237.   )
  238.  
  239.   (setvar "CMDECHO" 0)
  240.   (setvar "OSMODE" 0)
  241.  
  242.   (cond
  243.      (  (not (ai_notrans)))                     ; transparent not OK
  244.      (  (not (ai_acadapp)))                     ; ACADAPP.EXP xloaded?
  245.      (  (not (setq dcl_id (ai_dcl "dducsp"))))  ; is .DCL file loaded?
  246.      (T (ai_undo_push)
  247.         (ai_ucsp_main)
  248.         (ai_undo_pop)
  249.      )
  250.   )
  251.  
  252.   (setvar "OSMODE" old_osmode)
  253.   (setq *error* old_error)
  254.   (setvar "cmdecho" old_cmd)
  255.  
  256.   (princ)
  257. )
  258.  
  259. (princ "  DDUCSP ñw╕ⁿñJíC  ")
  260. (princ)
  261.