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

  1. ; Next available MSG number is    22 
  2. ; MODULE_ID XREFCLIP_LSP_
  3. ;;;
  4. ;;;    xrefclip.lsp
  5. ;;;    
  6. ;;;    Copyright (C) 1990, 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. ;;;----------------------------------------------------------------------------
  28. ;;; DESCRIPTION
  29. ;;;   
  30. ;;;   This routine is intended to make the task of inserting, sizing, and 
  31. ;;;   positioning of external references easier, by clearing the screen of
  32. ;;;   all graphics, creating a viewport exclusively for the XREF, creating 
  33. ;;;   a layer on which to attach the XREF, and zooming to the extents of 
  34. ;;;   the XREF in current UCS plan view.
  35. ;;;   
  36. ;;;   The routine may be called with either XC or XREFCLIP.
  37. ;;;   
  38. ;;;   If TILEMODE is set to 1 or ON, you are asked whether you want to reset
  39. ;;;   it, and if not, you are exited from the routine.  If you elect to change
  40. ;;;   it, or it is already 0 or OFF, then you are prompted:
  41. ;;;   
  42. ;;;     Xref name: 
  43. ;;;     Clip onto what layer? 
  44. ;;;     
  45. ;;;   The XREF name must be a valid drawing file name that can be found on 
  46. ;;;   AutoCAD's search paths.  The layer name must not be the name of an 
  47. ;;;   existing layer name;  if it is you are so informed and asked for a 
  48. ;;;   new name.
  49. ;;;   
  50. ;;;   At this point, all of the viewports are turned off, and all thawed 
  51. ;;;   layers are frozen.  A new viewport is fit to the screen, and the 
  52. ;;;   XREF is attached to the layer specified in that viewport.  The XREF
  53. ;;;   is zoomed to its extents so that you may select the area you want to
  54. ;;;   clip (inclusively.)
  55. ;;;   
  56. ;;;   You are prompted for the two clip points;
  57. ;;;   
  58. ;;;     First corner of clip box:  
  59. ;;;     Other corner:
  60. ;;;     
  61. ;;;   and the zoom ratio;
  62. ;;;   
  63. ;;;     Enter the ratio of paper space units to model space units...  
  64. ;;;     Number of paper space units.  <1.0>:  
  65. ;;;     Number of model space units.  <1.0>: (8)
  66. ;;;   
  67. ;;;   All of the viewports are restored to their former state, and a box 
  68. ;;;   designating the clipped viewport can be dragged around and you are 
  69. ;;;   prompted for a location for the clipped view.
  70. ;;;   
  71. ;;;     Insertion point for clip: 
  72. ;;;     
  73. ;;;   A new viewport containing the clipped view of the XREF will be inserted 
  74. ;;;   at the location specified.
  75. ;;;   
  76. ;;;   
  77. ;;;----------------------------------------------------------------------------;
  78. ;;;   
  79. ;;;   
  80. (defun xcmain ( / xc_err s xc_oer xc_oce xc_oem xc_olu xc_ocv 
  81.                   curlay xc_nam lay xc:sov xc_vpn xc:ltg xc:ltl)
  82.  
  83.   ;;
  84.   ;; Internal error handler defined locally
  85.   ;;
  86.  
  87.   (defun xc_err (s)                   ; If an error (such as CTRL-C) occurs
  88.                                       ; while this command is active...
  89.     (if (/= s "Funci≤n cancelada")
  90.       (if (= s "quitar / salir abandonar")
  91.         (princ)
  92.         (princ (strcat "\nError: " s))
  93.       )
  94.     )
  95.     (if (= 8 (logand (getvar "undoctl")))(command "_.UNDO" "_EN"))
  96.     (if xc_oer                        ; If an old error routine exists
  97.       (setq *error* xc_oer)           ; then, reset it 
  98.     )
  99.     (if xc_oce (setvar "cmdecho" xc_oce)) ; Reset command echoing on error
  100.     (if xc_oem (setvar "expert" xc_oem)) ; Reset expert mode on error
  101.     (princ)
  102.   )
  103.   
  104.   (if *error*                         ; If there is an error routine defined
  105.     (setq xc_oer   *error*            ; Store AutoLisp error routine
  106.           *error*  xc_err)            ; Temporarily replace it
  107.   )
  108.   
  109.   (setq xc_oce (getvar "cmdecho"))
  110.   (setq xc_oem (getvar "expert"))
  111.   (setvar "cmdecho" 0)                ; Turn off command echoing
  112.   (setvar "expert" 5)                 ; Turn expert mode way up.
  113.   (command "_.UNDO" "_GROUP")            ; Set start of Undo group
  114.   (if (xc_ctm)                        ; Is Tile-mode on? T or nil
  115.     (progn
  116.       (xc_sxc)                        ; Set up for Xref Clip
  117.       (xc_dxc)                        ; Do XREF clipping
  118.     )
  119.   )
  120.   (if (/= xc_ocv 1) (setvar "cvport" xc_ocv) (command "_.PSPACE"))
  121.   (command "_.LAYER" "_SET" curlay "")
  122.   (if xc_oer                          ; If an old error routine exists
  123.     (setq *error* xc_oer)             ; then, reset it 
  124.   )
  125.   (command "_.UNDO" "_END")              ; Set Undo End
  126.  
  127.   (if xc_oem (setvar "expert" xc_oem)) ; Reset expert mode
  128.   (if xc_oce (setvar "cmdecho" xc_oce)) ; Reset command echoing
  129.   (princ)
  130. )
  131. ;;;
  132. ;;; Check Tile-mode.  Returns T if ON and nil if not on.
  133. ;;;
  134. ;;; xc_ctm == MView_Check_TileMode
  135. ;;;
  136. (defun xc_ctm (/ ans)
  137.   (if (= (getvar "TILEMODE") 1) 
  138.     (progn
  139.       (initget "Sφ No")
  140.       (setq ans (getkword
  141.         "\n┐Activar Espacio papel? <S>: ")
  142.       )
  143.       (if (= ans "No")
  144.         nil
  145.         (progn
  146.           (setvar "TILEMODE" 0)
  147.           T
  148.         )
  149.       )
  150.     )
  151.     T
  152.   )
  153. )
  154. ;;;
  155. ;;; Get set up for reference file clipping; get the file name, the layer to 
  156. ;;; put it on, and make the layers, and set up all of the layers correctly
  157. ;;; to minimize "viewports".
  158. ;;; 
  159. ;;; xc_sxc == MView_Setup_for_Xref_Clip
  160. ;;;
  161. (defun xc_sxc (/ xc_ver xc_xdf xc_xlf xref xdpnd)
  162.  
  163.   (setq xc_ver "1.11")                ; Reset this local if you make a change.
  164.   
  165.   (setq xc_ocv (getvar "cvport"))
  166.   (if (/= xc_ocv 1)
  167.     (command "_.PSPACE")                ; Change to paperspace
  168.   )
  169.  
  170.   (setq xref T)
  171.  
  172.  
  173.   ;; Save the current layer name.
  174.   (setq curlay (getvar "clayer"))
  175.   
  176.   ;; Get the name of the xref...
  177.   (setq xc_nam (xc_gxn))
  178.  
  179.   ;; Check whether the XREF has already been attached.  Or whether a block
  180.   ;; by that name exists in the current drawing.
  181.   ;;   xc_xrs == xref_status == 0 -- not in current drawing.
  182.   ;;                            1 -- Xref in current drawing.
  183.   ;;                            2 -- Block ref in current drawing.
  184.   ;; Also set xdpnd True if the layer on which the Xref or block insert
  185.   ;; has been placed is an exclusive layer, nil otherwise.
  186.   (setq xc_xrs (xc_gxs xc_nam))
  187.  
  188.   ;; Get a layer name for the Xref.  It must not already exist!
  189.   (setq lay (xc_gln))
  190.  
  191.   ;; Make a layer for the new viewport.
  192.   (command "_.VPLAYER" "_NEW" (strcat lay "-vp") "")
  193.   (command "_.VPLAYER" "_F" (strcat lay "-vp") "_ALL" 
  194.            "_T" (strcat lay "-vp") "" "")
  195.   (command "_.LAYER" "_SET" (strcat lay "-vp") "")
  196.   
  197.   ;; Save the names of all the layers that are thawed globally.
  198.   (xc_sgt) 
  199.  
  200.   ;; Freeze all of 'em except the current layer.
  201.   (command "_.LAYER" "_F" (strcat "~" lay "-vp") "")
  202.   
  203.   ;; Save the names of all the viewports that are ON.
  204.   (xc_sov) 
  205.  
  206.   ;; Freeze all of 'em except the current layer.
  207.   (command "_.MVIEW" "_OFF" xc:sov "")
  208.   
  209.   ;; Create a new viewport on the viewport layer.  Fit it to the screen.
  210.   (command "_.MVIEW" "_F")
  211.  
  212.   ;; Make a new layer for the Xref.  Make it exclusive.
  213.   (command "_.VPLAYER" "_NEW" lay "")
  214.   (command "_.VPLAYER" "_F" lay "_ALL" "_T" lay "_S" "_L" "" "")
  215.  
  216.   ;; Save the entity name of the viewport.
  217.   (setq xc_vpn (entlast))
  218.  
  219.   (if (= (getvar "cvport") 1)
  220.     (command "_.MSPACE")                ; Change to modelspace
  221.   )
  222.                                         
  223.   ;; If xdpnd is true, thaw the layer on which the xref or insert has
  224.   ;; been placed previously.
  225.   (if xdpnd
  226.     (progn
  227.       (command "_.LAYER" "_T" xc_xrl "_T" (strcat xc_xri "*") "")
  228.       (command "_.VPLAYER" "_T" xc_xrl "_CUR" "")
  229.     )
  230.   )
  231.   
  232.   (command "_.LAYER" "_SET" lay "")
  233.  
  234.   (if (not xdpnd)
  235.     (progn
  236.       (command "_.VPLAYER" "_F" (strcat "~" lay) "" "")
  237.     )
  238.   )
  239.   ;; Do the Xref attach or block insertion.
  240.   (command "_.XREF" "" xc_nam "0,0" "" "" "")
  241.  
  242.   ;; Zoom extents in plan view
  243.   (command "_.ZOOM" "_E")
  244. )
  245. ;;;
  246. ;;; 
  247. ;;; 
  248. ;;;
  249. ;;; xc_dxc == MView_Do_Xref_Clip
  250. ;;;
  251. (defun xc_dxc (/ xc:cp1 xc:cp2 xc_vps xs ys nxs nys ip)
  252.  
  253.   ;; Get the corners of the clip box.
  254.   (while (null xc:cp2)
  255.     (if (null xc:cp1)
  256.         (setq xc:cp1 (getpoint "\nPrimera esquina del ßrea delimitada: "))
  257.         (setq xc:cp2 (getcorner xc:cp1 "\nEsquina opuesta: "))
  258.     )
  259.   )
  260.  
  261.   ;; Sort the two points into lower-left to upper-right order.
  262.   (if (> (car xc:cp1) (car xc:cp2))
  263.     (setq x (car xc:cp1)
  264.           xc:cp1 (list (car xc:cp2) (cadr xc:cp1) 0.0)
  265.           xc:cp2 (list x (cadr xc:cp2) 0.0)
  266.     )
  267.   )
  268.   (if (> (cadr xc:cp1) (cadr xc:cp2))
  269.     (setq x (cadr xc:cp1)
  270.           xc:cp1 (list (car xc:cp1) (cadr xc:cp2) 0.0)
  271.           xc:cp2 (list (car xc:cp2) x 0.0)
  272.     )
  273.   )
  274.  
  275.   (if (/= (getvar "cvport") 1)
  276.     (command "_.PSPACE")                ; Change to paperspace
  277.   )
  278.                                         
  279.   ;; Get the scale of the clip region.
  280.   (setq xc_vps (xc_ssi))
  281.  
  282.   ;; Set the X and Y scale factors based on the two points 
  283.   ;; and the scale factor entered.
  284.   (setq xs (- (car  xc:cp2) (car  xc:cp1))
  285.         ys (- (cadr xc:cp2) (cadr xc:cp1))
  286.         nxs (/ xs xc_vps)
  287.         nys (/ ys xc_vps)
  288.   )
  289.   ;; Delete the last viewport.
  290.   (entdel xc_vpn)
  291.  
  292.   ;; Turn back ON all of the viewports.
  293.   (command "_.MVIEW" "_ON" xc:sov "")
  294.  
  295.   ;; Thaw the layers which we froze earlier.
  296.   (command "_.LAYER")
  297.  
  298.   (foreach n xc:ltg (command "_THAW" n))
  299.   (command "")
  300.   (command "_.LAYER" "_SET" curlay "")
  301.  
  302.   (if (tblsearch "block" "xc_box")
  303.     (progn
  304.       (princ "\nPunto de inserci≤n: ")
  305.       (command "_.INSERT" "xc_box" "_xscale" nxs "_yscale" nys "_rotate" 0 pause)
  306.     )
  307.     (progn
  308.       (command "_.PLINE" "0,0" "_W" "0" "" "1,0" "1,1" "0,1" "_CL")
  309.       (command "_.CHPROP" (entlast) "" "_C" "bylayer" "_LT" "bylayer" "_LA" "0" "")
  310.       (command "_.BLOCK" "xc_box" "0,0" (entlast) "")
  311.       (princ "\nPunto de inserci≤n: ")
  312.       (command "_.INSERT" "xc_box" "_xscale" nxs "_yscale" nys "_rotate" 0 pause)
  313.     )
  314.   )
  315.   
  316.   ;; Get the block insertion point and scale factors.
  317.   (setq ip (xc_val 10 (entlast) nil))
  318.  
  319.   ;; Delete the block.
  320.   (entdel(entlast))
  321.  
  322.   ;;(princ "\nModifying the new viewport. ")
  323.  
  324.   ;; Create the new viewport.
  325.   (command "_.LAYER" "_SET" (strcat lay "-vp") "")
  326.   (command "_.VPLAYER" "_F" lay "_C" "")
  327.   (command "_.MVIEW" ip (strcat "@" (rtos nxs) "," (rtos nys) "," "0.0"))
  328.  
  329.   (setq xc_vpn (entlast))
  330.   (setq temp (xc_val 69 xc_vpn nil))
  331.                                         
  332.   (if (= (getvar "cvport") 1)
  333.     (command "_.MSPACE")                ; Change to modelspace
  334.   )
  335.   
  336.   (command "_.VPLAYER" "_F" lay "_ALL" "_T" lay "_S" "_L" "" "")
  337.  
  338.   (if (> (xc_val 68 xc_vpn nil) 0)
  339.     (progn
  340.   
  341.       (setvar "cvport" temp)
  342.       
  343.       (command "_.PLAN" "")
  344.       (command "_.ZOOM" "_C" (xc_a2p xc:cp1 xc:cp2) ys)
  345.     )
  346.     (princ "\nVentana grßfica demasiado peque±a. ")
  347.   )
  348.   
  349. )
  350. ;;;
  351. ;;; Get the midpoint between two points.
  352. ;;;
  353. ;;; xc_a2p == XrefClip_Average_2_Points
  354. ;;;
  355. (defun xc_a2p (a b / c)
  356.   (setq c (list (/ (+ (car  a) (car  b)) 2.0)
  357.                 (/ (+ (cadr a) (cadr b)) 2.0)
  358.                 0.0
  359.           )
  360.   )
  361. )
  362. ;;;
  363. ;;; Get the value associated with key "n" in "e".
  364. ;;; If "f" is T the "e" is an entity list, else it is an entity name.
  365. ;;;
  366. ;;; xc_val == XrefClip_assoc_VALue
  367. ;;;
  368. (defun xc_val (n e f) 
  369.   (if f ; if f then e is an entity list.
  370.     (cdr (assoc n e))
  371.     (cdr (assoc n (entget e)))
  372.   )
  373.  
  374. ;;;
  375. ;;; Save the names of all the viewports that are ON,
  376. ;;; because we are going to temporarily turn them all OFF.
  377. ;;;
  378. ;;; xc_sov == XrefClip_Save_On_Viewports
  379. ;;;
  380. (defun xc_sov (/ ss sov sslen)
  381.   (setq xc:sov (ssadd)
  382.         j      0
  383.   )
  384.   (setq ss (ssget "_x" '((0 . "viewport")))) ; Get all vports in database.
  385.   (setq sslen (sslength ss))
  386.   (while (< j sslen)
  387.     (setq sov (ssname ss j))
  388.     (if (and (> (xc_val 68 sov nil) 1) (/= (xc_val 69 sov nil) 1))
  389.       (ssadd sov xc:sov)
  390.     )
  391.     (setq j (1+ j))
  392.   )
  393.   xc:sov
  394. )
  395. ;;;
  396. ;;; Save the layer names of all the layers that are globally Thawed,
  397. ;;; because we are going to temporarily Freeze all of them.
  398. ;;;
  399. ;;; xc_sgt == XrefClip_Save_Globally_Thawed_layers
  400. ;;;
  401. (defun xc_sgt (/ lay)
  402.   (setq lay (tblnext "layer" T))      ; Get first layer in database.
  403.   (if (/= (logand (cdr(assoc 70 lay)) 1) 1)
  404.     (setq xc:ltg (list (cdr(assoc 2 lay))))
  405.   )
  406.   (while (setq lay (tblnext "layer"))
  407.     (if (/= (logand (cdr(assoc 70 lay)) 1) 1)
  408.       (setq xc:ltg (append xc:ltg (list (cdr(assoc 2 lay)))))
  409.     )
  410.   )
  411.   xc:ltg
  412. )
  413. ;;;
  414. ;;; Save the layer names of all the layers in the current viewport that 
  415. ;;; are locally thawed, because we are going to temporarily freeze them.
  416. ;;;
  417. ;;; xc_slt == XrefClip_Save_Locally_Thawed_layers
  418. ;;;
  419. (defun xc_slt (/ lay)
  420.   (setq lay (tblnext "layer" T))      ; Get first layer in database.
  421.   (if (/= (logand (cdr(assoc 70 lay)) 2) 2)
  422.     (setq xc:ltl (list (cdr(assoc 2 lay))))
  423.   )
  424.   (while (setq lay (tblnext "layer"))
  425.     (if (/= (logand (cdr(assoc 70 lay)) 2) 2)
  426.       (setq xc:ltl (append xc:ltl (list (cdr(assoc 2 lay)))))
  427.     )
  428.   )
  429.   xc:ltl
  430. )
  431. ;;;
  432. ;;; Set a layer if it exists?  Create it otherwise?
  433. ;;;
  434. ;;; xc_gln == XrefClip_Get_Layer_Name
  435. ;;;
  436. (defun xc_gln (/ temp)
  437.   (while (null temp)
  438.     (setq temp (getstring
  439.       "\n\n┐Pegar en quΘ capa? ")
  440.     )
  441.     (if (tblsearch "layer" temp)
  442.       (progn
  443.         (princ "\nEsta capa ya existe. ")
  444.         (setq temp nil)
  445.       )
  446.     )
  447.   )
  448.   temp
  449. )
  450. ;;;
  451. ;;; Get the xref file name and verify that it exists.
  452. ;;;
  453. ;;; xc_gxn == XrefClip_Get_Xref_Name
  454. ;;;
  455. (defun xc_gxn (/ temp xc_nam sl a b)
  456.   (while (null xc_nam)
  457.     (setq temp (getstring (strcat
  458.       "\nNombre de RefX: "))
  459.     )
  460.     (setq sl (strlen temp))
  461.  
  462.     (if (and (> sl 4) (= (substr temp (- sl 3)) ".dwg"))
  463.       (setq temp (substr temp 1 (- sl 4)))
  464.     )
  465.  
  466.     (if (setq xc_nam (findfile (strcat temp ".dwg")))
  467.       (princ)
  468.       (princ (strcat "\n" temp " no encontrado. "))
  469.  
  470.     )
  471.  
  472.     ;; Remove pathname
  473.     (setq a 1)
  474.     (repeat (strlen temp)
  475.       (if (member (substr temp a 1) '("/" "\\" ":"))
  476.         (setq b a) 
  477.       )
  478.       (setq a (1+ a))
  479.     )
  480.     (if b
  481.       (setq temp (substr temp (1+ b)))
  482.     )
  483.     (setq xc_snm (strcase temp))
  484.   )
  485.   xc_nam
  486. )
  487. ;;;
  488. ;;; Interactively set the scale of each viewport.
  489. ;;;
  490. ;;; xc_ssi == XrefClip_Setup_Scale_Interactively
  491. ;;;
  492. (defun xc_ssi (/ ans)
  493.   (princ "\nRelaci≤n entre unidades de Espacio papel y de Espacio modelo... ")
  494.   (initget 6)
  495.   (setq ans (getreal 
  496.     "\nN·mero de unidades de Espacio papel <1.0>: ")
  497.   )
  498.   (if (= (type ans) 'REAL)
  499.     (setq xc_vps ans)
  500.     (setq xc_vps 1.0)
  501.   )
  502.   (initget 6)
  503.   (setq ans (getreal 
  504.     "\nN·mero de unidades de Espacio modelo <1.0>: ")
  505.   )
  506.   (if (= (type ans) 'REAL)
  507.     (setq xc_vps (/ xc_vps ans))
  508.     (setq xc_vps (/ xc_vps 1.0))
  509.   )
  510.   xc_vps
  511. )
  512. ;;;
  513. ;;; Check whether the XREF has already been attached.  Or whether a block
  514. ;;; by that name exists in the current drawing.
  515. ;;;   xc_xrs == xref_status == 0 -- not in current drawing.
  516. ;;;                            1 -- Xref in current drawing.
  517. ;;;                            2 -- Block ref in current drawing.
  518. ;;;
  519. ;;; xc_gxs == XrefClip_Get_Xref_Status
  520. (defun xc_gxs (nam / ss)
  521.   (cond
  522.     ((and nam (setq ent (tblsearch "block" xc_snm)))
  523.       (cond
  524.         ((= (cdr(assoc 70 ent)) 4)
  525.           (setq flag 1)
  526.         )
  527.         (T
  528.           (setq flag 2)
  529.         )
  530.       )
  531.       (if (= (getvar "cvport") 1)
  532.         (command "_.MSPACE")                ; Change to modelspace
  533.       )
  534.       (setq ss (ssget "_x" (list (cons 0 "INSERT") (cons 2 xc_snm))))
  535.       (if ss
  536.         (setq xc_xre (entget (ssname ss 0))
  537.               xc_xri (cdr(assoc 2 xc_xre))
  538.               xc_xrl (tblsearch "layer" (cdr(assoc 8 xc_xre)))
  539.         )
  540.       )
  541.       (if (/= (getvar "cvport") 1)
  542.         (command "_.PSPACE")                ; Change to paperspace
  543.       )
  544.       (cond 
  545.         ((= (logand (cdr(assoc 70 xc_xrl)) 2) 2)
  546.           (setq xdpnd T
  547.                 xc_xrl (cdr(assoc 2 xc_xrl))
  548.           )
  549.         )
  550.         (T
  551.           (setq xdpnd nil)
  552.         )
  553.       )
  554.     )
  555.     (T
  556.       (setq flag 0)
  557.     )
  558.   )
  559.   flag
  560. )
  561. ;;; --------------------------------------------------------------------------;
  562. (defun c:xc       () (xcmain))
  563. (defun c:xrefclip () (xcmain))
  564.