home *** CD-ROM | disk | FTP | other *** search
/ Windows 95 v2.4 Fix / W95-v2.4fix.iso / ACADWIN / SUPPORT / DDVPOINT.LSP < prev    next >
Encoding:
Lisp/Scheme  |  1995-02-08  |  15.8 KB  |  550 lines

  1. ; Next available MSG number is    11 
  2. ; MODULE_ID DDVPOINT_LSP_
  3. ;;;
  4. ;;;    ddvpoint.lsp
  5. ;;;
  6. ;;;    Copyright (C) 1992, 1994 by Autodesk, Inc.
  7. ;;;
  8. ;;;    Permission to use, copy, modify, and distribute this software
  9. ;;;    for any purpose and without fee is hereby granted, provided
  10. ;;;    that the above copyright notice appears in all copies and
  11. ;;;    that both that copyright notice and the limited warranty and
  12. ;;;    restricted rights notice below appear in all supporting
  13. ;;;    documentation.
  14. ;;;
  15. ;;;    AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
  16. ;;;    AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
  17. ;;;    MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE.  AUTODESK, INC.
  18. ;;;    DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
  19. ;;;    UNINTERRUPTED OR ERROR FREE.
  20. ;;;
  21. ;;;    Use, duplication, or disclosure by the U.S. Government is subject to
  22. ;;;    restrictions set forth in FAR 52.227-19 (Commercial Computer
  23. ;;;    Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii) 
  24. ;;;    (Rights in Technical Data and Computer Software), as applicable.
  25. ;;;
  26. ;;;.
  27. ;;;    C:DDVPOINT - 3D Viewpoint presets dialog.
  28. ;;;
  29. ;;;                Uses DDVPOINT.DCL for the dialog definition.
  30. ;;;                The slide image is in ACAD.SLB.
  31. ;;;
  32. ;;; ===================== load-time error checking ============================
  33. ;;;
  34.  
  35.   (defun ai_abort (app msg)
  36.      (defun *error* (s)
  37.         (if old_error (setq *error* old_error))
  38.         (princ)
  39.      )
  40.      (if msg
  41.        (alert (strcat " Error en la aplicaci≤n: "
  42.                       app
  43.                       " \n\n  "
  44.                       msg
  45.                       "  \n"
  46.               )
  47.        )
  48.      )
  49.      (exit)
  50.   )
  51.  
  52. ;;; Check to see if AI_UTILS is loaded, If not, try to find it,
  53. ;;; and then try to load it.
  54. ;;;
  55. ;;; If it can't be found or it can't be loaded, then abort the
  56. ;;; loading of this file immediately, preserving the (autoload)
  57. ;;; stub function.
  58.  
  59.   (cond
  60.      (  (and ai_dcl (listp ai_dcl)))          ; it's already loaded.
  61.  
  62.      (  (not (findfile ;|MSG0|;"ai_utils.lsp"))                     ; find it
  63.         (ai_abort "DDVPOINT"
  64.                   (strcat "Imposible localizar el archivo AI_UTILS.LSP."
  65.                           "\n Compruebe el directorio de soporte.")))
  66.  
  67.      (  (eq ;|MSG0|;"failed" (load "ai_utils" ;|MSG0|;"failed"))            ; load it
  68.         (ai_abort "DDVPOINT" "Imposible cargar el archivo AI_UTILS.LSP"))
  69.   )
  70.  
  71.   (if (not (ai_acadapp))               ; defined in AI_UTILS.LSP
  72.       (ai_abort "DDVPOINT" nil)         ; a Nil <msg> supresses
  73.   )                                    ; ai_abort's alert box dialog.
  74.  
  75. ;;; ==================== end load-time operations ===========================
  76.  
  77. (defun ai_ddvp_start ( / image_x image_y image_h slide_x slide_y slide_h)
  78.   (start_image ;|MSG0|;"ddvp_image")
  79.   (slide_image
  80.     0 0
  81.     (- (setq image_x (dimx_tile ;|MSG0|;"ddvp_image")) 1) 
  82.     (- (setq image_y (dimy_tile ;|MSG0|;"ddvp_image")) 1)
  83.     ;|MSG0|;"acad(ddvp3d)"
  84.   )
  85.   (end_image)
  86.   (setq 
  87.         image_x (float image_x)
  88.         image_y (float image_y)
  89.         slide_x 12.4265
  90.         slide_y 9.0
  91.         image_h (/ image_x image_y)
  92.         slide_h (/ slide_x slide_y)
  93.   )
  94.   (if (< slide_h image_h)
  95.     (setq slide_y image_y
  96.           slide_x (* slide_y slide_h)
  97.     )
  98.     (setq slide_x image_x
  99.           slide_y2 (* slide_y (/ image_x 12.4625))
  100.           image_y2 (/ image_y slide_y2)
  101.           slide_y (* slide_y2 image_y2)
  102.  
  103.     )
  104.   )
  105.   (setq ai_ddvp_bx (fix (* 0.295 slide_x))
  106.         ai_ddvp_ax (fix (* 0.65 slide_x))
  107.         ai_ddvp_by (fix (* 0.4875 slide_y))
  108.   )
  109. )
  110.  
  111. (defun ai_rtd (arg)
  112.   (/ (* arg 180.0) pi)
  113. )
  114.  
  115. (defun ai_dtr (arg)
  116.   (* pi (/ arg 180.0))
  117. )
  118.  
  119. (defun ai_ang3dv (v1 v2)
  120.   (if (not (equal v1 v2 1e-12))
  121.     (ai_arccos
  122.       (/ (ai_dotp v1 v2)
  123.          (* (sqrt (ai_dotp v1 v1))
  124.             (sqrt (ai_dotp v2 v2))
  125.          )
  126.       )
  127.     )
  128.     (eval '0.0)
  129.   )
  130. )
  131.  
  132. (defun ai_arccos (ang)
  133.   (if (not (equal ang 1.0 1e-06))
  134.     (if (not (equal ang -1.0 1e-06))
  135.       (atan (sqrt (- 1.0 (expt ang 2.0))) ang)
  136.       (eval pi)
  137.     )
  138.     (eval '0.0)
  139.   )
  140. )
  141.  
  142. (defun ai_dotp (v1 v2)
  143.   (+
  144.     (* (car v1) (car v2))
  145.     (* (cadr v1) (cadr v2))
  146.     (* (caddr v1) (caddr v2))
  147.   )
  148. )
  149.  
  150. (defun ai_ddvp_do ()
  151.   (if (or (>= ai_ddvp_b_curr 360.0)
  152.           (< ai_ddvp_b_curr 0.0)
  153.           (null ai_ddvp_b_curr)
  154.       )
  155.     (progn
  156.       (ai_ddvp_drx ai_ddvp_b_last ai_ddvp_bx 0)
  157.       (ai_ddvp_drx ai_ddvp_b_base ai_ddvp_bx 1)
  158.       (mode_tile ;|MSG0|;"ddvp_val_x" 2)
  159.       (set_tile "error" "Angulo desde el eje X no vßlido.")
  160.     )
  161.     (if (or (> ai_ddvp_a_curr 90.0)
  162.             (< ai_ddvp_a_curr -90.0)
  163.             (null ai_ddvp_a_curr)
  164.         )
  165.       (progn
  166.         (ai_ddvp_drx ai_ddvp_a_last ai_ddvp_ax 0)
  167.         (ai_ddvp_drx ai_ddvp_a_base ai_ddvp_ax 1)
  168.         (mode_tile ;|MSG0|;"ddvp_val_xyp" 2)
  169.         (set_tile "error" "Angulo desde el plano XY no vßlido.")
  170.       )
  171.       (done_dialog 1)
  172.     )
  173.   )
  174. )
  175.  
  176. (defun ai_ddvp_set_a (ang)
  177.   (setq ai_ddvp_a_curr ang)
  178.   (if (or (> ang 90.0)
  179.           (< ang -90.0)
  180.           (null ang)
  181.       )
  182.     (progn
  183.       (ai_ddvp_drx ai_ddvp_a_last ai_ddvp_ax 0)
  184.       (ai_ddvp_drx ai_ddvp_a_base ai_ddvp_ax 1)
  185.       (set_tile "error" "Angulo desde el plano XY no vßlido.")
  186.     )
  187.     (progn
  188.       (set_tile ;|MSG0|;"error" "")
  189.       (ai_ddvp_drx ai_ddvp_a_last ai_ddvp_ax 0)
  190.       (setq ai_ddvp_a_last ai_ddvp_a_curr ai_ddvp_t T)
  191.       (set_tile ;|MSG0|;"ddvp_val_xyp" (rtos ai_ddvp_a_curr 2 1))
  192.       (ai_ddvp_drx ai_ddvp_a_base ai_ddvp_ax 1)
  193.       (ai_ddvp_drx ai_ddvp_a_curr ai_ddvp_ax 7)
  194.     )
  195.   )
  196. )
  197.  
  198. (defun ai_ddvp_set_b (ang)
  199.   (setq ai_ddvp_b_curr ang)
  200.   (if (or (>= ang 360.0)
  201.           (< ang 0.0)
  202.           (null ang)
  203.       )
  204.     (progn
  205.       (ai_ddvp_drx ai_ddvp_b_last ai_ddvp_bx 0)
  206.       (ai_ddvp_drx ai_ddvp_b_base ai_ddvp_bx 1)
  207.       (set_tile "error" "Angulo desde el eje X no vßlido.")
  208.     )
  209.     (progn
  210.       (set_tile ;|MSG0|;"error" "")
  211.       (ai_ddvp_drx ai_ddvp_b_last ai_ddvp_bx 0)
  212.       (if (= ang 360.0)
  213.         (setq ai_ddvp_b_curr 0.0 
  214.               ai_ddvp_a_curr 90.0 
  215.               ai_ddvp_p T
  216.               ai_ddvp_b_last ai_ddvp_b_curr
  217.         )
  218.         (setq ai_ddvp_b_last ai_ddvp_b_curr ai_ddvp_t T)
  219.       )
  220.       (set_tile ;|MSG0|;"ddvp_val_x" (rtos ai_ddvp_b_curr 2 1))
  221.       (ai_ddvp_drx ai_ddvp_b_base ai_ddvp_bx 1)
  222.       (ai_ddvp_drx ai_ddvp_b_curr ai_ddvp_bx 7)
  223.     )
  224.   )
  225. )
  226.  
  227. (defun ai_ddvp_drx (ang x1 col / a x2 y2)
  228.   (setq a (polar (list 0.0 0.0) 
  229.                  (- (* 2.0 pi) (ai_dtr ang)) 
  230.                  25.0
  231.           )
  232.         x2 (+ x1 (fix (car a)))
  233.         y2 (+ ai_ddvp_by (fix (cadr a)))
  234.   )
  235.   (start_image ;|MSG0|;"ddvp_image")
  236.   (vector_image x1 ai_ddvp_by x2 y2 col)
  237.   (end_image)
  238. )
  239.  
  240. (defun ai_ddvp_image (x y / ang1 ang2 list_xy list_axby list_bxby)
  241.   (setq list_xy (list x y)
  242.         list_axby (list ai_ddvp_ax ai_ddvp_by)
  243.         list_bxby (list ai_ddvp_bx ai_ddvp_by)
  244.   )
  245.   (if (> x (- ai_ddvp_ax 1))
  246.     (progn
  247.       (setq ang1 (ai_rtd (- (* 2.0 pi) (angle list_xy list_axby))))
  248.       (if (< 90.0 ang1)
  249.         (setq ang1 (- ang1 180.0))
  250.       )
  251.       (if (< (distance list_xy list_axby) 40)
  252.         (ai_ddvp_set_a ang1)
  253.         (if (< (distance list_xy list_axby) 84)
  254.           (cond ((= ang1 0.0)
  255.                  (ai_ddvp_set_a 0.0)
  256.                 )
  257.                 ((< ang1 -72.0)
  258.                  (ai_ddvp_set_a -90.0)
  259.                 )
  260.                 ((< ang1 -53.0)
  261.                  (ai_ddvp_set_a -60.0)
  262.                 )
  263.                 ((< ang1 -38.0)
  264.                  (ai_ddvp_set_a -45.0)
  265.                 )
  266.                 ((< ang1 -20.0)
  267.                  (ai_ddvp_set_a -30.0)
  268.                 )
  269.                 ((< ang1 -6.0)
  270.                  (ai_ddvp_set_a -10.0)
  271.                 )
  272.                 ((< ang1 6.0)
  273.                  (ai_ddvp_set_a 0.0)
  274.                 )
  275.                 ((< ang1 20.0)
  276.                  (ai_ddvp_set_a 10.0)
  277.                 )
  278.                 ((< ang1 38.0)
  279.                  (ai_ddvp_set_a 30.0)
  280.                 )
  281.                 ((< ang1 53.0)
  282.                  (ai_ddvp_set_a 45.0)
  283.                 )
  284.                 ((< ang1 72.0)
  285.                  (ai_ddvp_set_a 60.0)
  286.                 )
  287.                 (T
  288.                  (ai_ddvp_set_a 90.0)
  289.                 )
  290.           )
  291.         )
  292.       )
  293.     )
  294.     (progn
  295.       (setq ang2 (ai_rtd (+ pi (- (* 2.0 pi) (angle list_xy list_bxby)))))
  296.       (if (< 360.0 ang2)
  297.         (setq ang2 (- ang2 360.0))
  298.       )
  299.       (if (< (distance list_xy list_bxby) 40)
  300.         (ai_ddvp_set_b ang2)
  301.         (cond ((= ang2 0.0)
  302.                (ai_ddvp_set_b 0.0)
  303.               )
  304.               ((< ang2 22.5)
  305.                (ai_ddvp_set_b 0.0)
  306.               )
  307.               ((< ang2 67.5)
  308.                (ai_ddvp_set_b 45.0)
  309.               )
  310.               ((< ang2 112.5)
  311.                (ai_ddvp_set_b 90.0)
  312.               )
  313.               ((< ang2 157.5)
  314.                (ai_ddvp_set_b 135.0)
  315.               )
  316.               ((< ang2 202.5)
  317.                (ai_ddvp_set_b 180.0)
  318.               )
  319.               ((< ang2 247.5)
  320.                (ai_ddvp_set_b 225.0)
  321.               )
  322.               ((< ang2 292.5)
  323.                (ai_ddvp_set_b 270.0)
  324.               )
  325.               ((< ang2 337.5)
  326.                (ai_ddvp_set_b 315.0)
  327.               )
  328.               ((< ang2 360.0)
  329.                (ai_ddvp_set_b 0.0)
  330.               )
  331.               (T
  332.                (ai_ddvp_set_b 270.0)
  333.               )
  334.         )
  335.       )
  336.     )
  337.   )
  338. )
  339.  
  340. (defun ai_ddvp_plan ()
  341.   (ai_ddvp_set_a 90.0)
  342.   (ai_ddvp_set_b 270.0)
  343. )
  344.  
  345. (defun ai_ddvp_setvdir (a b)
  346.   (list (* (sin (ai_dtr (- 90.0 a))) (cos (ai_dtr b)))
  347.         (* (sin (ai_dtr (- 90.0 a))) (sin (ai_dtr b)))
  348.         (cos (ai_dtr (- 90.0 a)))
  349.   )
  350. )
  351.  
  352. (defun ai_ddvp_set_abs ()
  353.   (setq ai_ddvp_wv 1)
  354.   (ai_ddvp_drx ai_ddvp_b_curr ai_ddvp_bx 0)
  355.   (ai_ddvp_drx ai_ddvp_a_curr ai_ddvp_ax 0)
  356.   (ai_ddvp_drx ai_ddvp_b_base ai_ddvp_bx 0)
  357.   (ai_ddvp_drx ai_ddvp_a_base ai_ddvp_ax 0)
  358.   (setq ai_ddvp_vdir_base (ai_ddvp_fixzero ai_ddvp_vdir_base))
  359.   (ai_ddvp_setang (trans ai_ddvp_vdir_base 1 0 T))
  360.   (setq ai_ddvp_a_base ai_ddvp_a
  361.         ai_ddvp_b_base ai_ddvp_b
  362.   )
  363.  
  364.   (setq ai_ddvp_vdir_curr 
  365.         (ai_ddvp_fixzero 
  366.           (trans (ai_ddvp_setvdir ai_ddvp_a_curr ai_ddvp_b_curr) 1 0 T)
  367.         )
  368.   )
  369.   (ai_ddvp_setang ai_ddvp_vdir_curr)
  370.   (setq ai_ddvp_a_curr ai_ddvp_a
  371.         ai_ddvp_b_curr ai_ddvp_b
  372.   )
  373.  
  374.   (ai_ddvp_set_a ai_ddvp_a_curr)
  375.   (ai_ddvp_set_b ai_ddvp_b_curr)
  376. )
  377.  
  378.  
  379. (defun ai_ddvp_set_rel ()
  380.   (setq ai_ddvp_wv 0)
  381.   (ai_ddvp_drx ai_ddvp_b_curr ai_ddvp_bx 0)
  382.   (ai_ddvp_drx ai_ddvp_a_curr ai_ddvp_ax 0)
  383.   (ai_ddvp_drx ai_ddvp_b_base ai_ddvp_bx 0)
  384.   (ai_ddvp_drx ai_ddvp_a_base ai_ddvp_ax 0)
  385.   (setq ai_ddvp_vdir_base (ai_ddvp_fixzero ai_ddvp_vdir_base))
  386.   (ai_ddvp_setang ai_ddvp_vdir_base)
  387.   (setq ai_ddvp_a_base ai_ddvp_a
  388.         ai_ddvp_b_base ai_ddvp_b
  389.   )
  390.   (setq ai_ddvp_vdir_curr 
  391.         (ai_ddvp_fixzero 
  392.           (trans (ai_ddvp_setvdir ai_ddvp_a_curr ai_ddvp_b_curr) 0 1 T)
  393.         )
  394.   )
  395.   (if ai_ddvp_init
  396.     (setq ai_ddvp_vdir_curr (ai_ddvp_fixzero (trans ai_ddvp_vdir_curr 1 0 T))
  397.           ai_ddvp_init nil
  398.     )
  399.   )
  400.   (ai_ddvp_setang ai_ddvp_vdir_curr)
  401.   (setq ai_ddvp_a_curr ai_ddvp_a
  402.         ai_ddvp_b_curr ai_ddvp_b
  403.   )
  404.   (ai_ddvp_set_a ai_ddvp_a_curr)
  405.   (ai_ddvp_set_b ai_ddvp_b_curr)
  406. )
  407.  
  408. (defun ai_ddvp_fixzero (vector / vector_x vector_y vector_z)
  409.   (setq vector_x (car vector)
  410.         vector_y (cadr vector)
  411.         vector_z (caddr vector)
  412.   )
  413.   (if (equal vector_x 0.0 1e-06)
  414.     (setq vector_x 0.0)
  415.   )
  416.   (if (equal vector_y 0.0 1e-06)
  417.     (setq vector_y 0.0)
  418.   )
  419.   (if (equal vector_z 0.0 1e-06)
  420.     (setq vector_z 0.0)
  421.   )
  422.   (list vector_x vector_y vector_z)
  423. )
  424.  
  425. (defun ai_ddvp_setang (viewdir / viewdir_x viewdir_y viewdir_z ai_viewdir)
  426.   (setq ai_viewdir (ai_ddvp_fixzero viewdir)
  427.         ai_ddvp_b (ai_rtd (angle ai_viewdir '(0.0 0.0)))
  428.   )
  429.   (if (equal (list (car ai_viewdir) (cadr ai_viewdir)) '(0.0 0.0) 1e-06)
  430.     (setq ai_ddvp_a 90.0)
  431.     (setq ai_ddvp_a (ai_rtd (ai_ang3dv 
  432.                              ai_viewdir
  433.                              (list (car ai_viewdir) (cadr ai_viewdir) 0.0)
  434.                             )
  435.                     )
  436.     )
  437.   )
  438.   (if (< (caddr ai_viewdir) 0.0)
  439.     (setq ai_ddvp_a (- 0.0 ai_ddvp_a))
  440.     (setq ai_ddvp_a (abs ai_ddvp_a))
  441.   )
  442.   (if (>= ai_ddvp_b 180.0)
  443.     (setq ai_ddvp_b (- ai_ddvp_b 180.0))
  444.     (setq ai_ddvp_b (+ ai_ddvp_b 180.0))
  445.   )
  446.   (if (or (= ai_ddvp_a 90.0) (= ai_ddvp_a -90.0))
  447.     (setq ai_ddvp_b 270.0)
  448.   )
  449. )
  450.  
  451. (defun ai_ddvp_main ()
  452.   (ai_ddvp_start)
  453.   (ai_ddvp_setang ai_ddvp_vdir_base)
  454.   (setq ai_ddvp_a_base ai_ddvp_a
  455.         ai_ddvp_b_base ai_ddvp_b
  456.         ai_ddvp_vdir_curr (ai_ddvp_fixzero 
  457.                             (ai_ddvp_setvdir ai_ddvp_a_base ai_ddvp_b_base)
  458.                           )
  459.   )
  460.   (ai_ddvp_setang ai_ddvp_vdir_curr)
  461.   (setq ai_ddvp_a_curr ai_ddvp_a
  462.         ai_ddvp_a_last ai_ddvp_a_curr
  463.         ai_ddvp_b_curr ai_ddvp_b
  464.         ai_ddvp_b_last ai_ddvp_b_curr
  465.   )
  466.   (if (= 0 ai_ddvp_wv)
  467.     (progn
  468.       (ai_ddvp_set_rel)
  469.       (set_tile ;|MSG0|;"ddvp_rel_ucs" "1")
  470.     )
  471.     (ai_ddvp_set_abs)
  472.   )
  473.   (setq ai_ddvp_t nil)
  474.   (set_tile ;|MSG0|;"ddvp_val_x" (rtos ai_ddvp_b_curr 2 1))
  475.   (set_tile ;|MSG0|;"ddvp_val_xyp" (rtos ai_ddvp_a_curr 2 1))
  476.   (action_tile ;|MSG0|;"ddvp_abs_wcs" "(ai_ddvp_set_abs)")
  477.   (action_tile ;|MSG0|;"ddvp_rel_ucs" "(ai_ddvp_set_rel)")
  478.   (action_tile ;|MSG0|;"ddvp_image" "(ai_ddvp_image $x $y)")
  479.   (action_tile ;|MSG0|;"ddvp_val_x" "(ai_ddvp_set_b (distof $value))")
  480.   (action_tile ;|MSG0|;"ddvp_val_xyp" "(ai_ddvp_set_a (distof $value))")
  481.   (action_tile ;|MSG0|;"ddvp_set_plan" "(ai_ddvp_plan)")
  482.   (action_tile ;|MSG0|;"accept" "(ai_ddvp_do)")
  483.   (action_tile ;|MSG0|;"cancel" "(done_dialog 0)")
  484.   (action_tile ;|MSG0|;"help" "(help \"\" \"DDVPOINT\")")
  485.   (if (= (start_dialog) 1)
  486.     (if ai_ddvp_t
  487.       (progn
  488.         (command "._WORLDVIEW" ai_ddvp_wv)
  489.         (command "._VPOINT" "_R" 
  490.                  (strcat "<<" (rtos ai_ddvp_b_curr 2))
  491.                  (strcat "<<" (rtos ai_ddvp_a_curr 2))
  492.         )
  493.       )
  494.     )
  495.   )
  496. )
  497.  
  498. (defun c:ddvpoint ( / ai_ddvp_wv ai_ddvp_vdir_base ai_ddvp_vdir_curr
  499.                       ai_ddvp_bx ai_ddvp_ax ai_ddvp_by ai_ddvp_a_curr
  500.                       ai_ddvp_b_curr ai_ddvp_a_base ai_ddvp_b_base ai_ddvp_p
  501.                       ai_ddvp_t ai_ddvp_init ai_ddvp_a ai_ddvp_b
  502.                       ai_ddvp_a_last ai_ddvp_b_last
  503.                       app dcl_id old_cmd undo_init 
  504.                   )
  505.  
  506.   ;; Set up error function.
  507.   (setq old_cmd (getvar "cmdecho")    ; save current setting of cmdecho
  508.         old_error  *error*            ; save current error function
  509.         *error* ai_error              ; new error function
  510.   )
  511.  
  512.   (setvar "cmdecho" 0)
  513.  
  514.   (cond
  515.      (  (not (ai_notrans)))                       ; transparent not OK
  516.      (  (not (ai_acadapp)))                       ; ACADAPP.EXP xloaded?
  517.      (  (not (setq dcl_id (ai_dcl ;|MSG0|;"ddvpoint"))))  ; is .DCL file loaded?
  518.      (T (ai_undo_push)
  519.         (ddvpoint_main)                           ; proceed!
  520.         (ai_undo_pop)
  521.      )                                            
  522.   )
  523.  
  524.   (setq *error* old_error) 
  525.   (setvar "cmdecho" old_cmd)
  526.   (princ)
  527. )
  528.  
  529. (defun ddvpoint_main()
  530.  
  531.   (if (and (= 0 (getvar "TILEMODE"))
  532.            (= 1 (getvar "CVPORT"))
  533.       )
  534.     (princ "\n** Comando no permitido en Espacio papel **")
  535.     (progn
  536.       (if (not (new_dialog ;|MSG0|;"ddvpoint" dcl_id))
  537.         (exit)
  538.       )
  539.       (setq ai_ddvp_vdir_base (ai_ddvp_fixzero (getvar "VIEWDIR"))
  540.             ai_ddvp_wv (getvar "WORLDVIEW")
  541.             ai_ddvp_init T
  542.       )
  543.       (ai_ddvp_main)
  544.     )
  545.   )
  546. )
  547.  
  548. (princ "  DDVPOINT cargada.  ")
  549. (princ)
  550.