 ; Pcl - close a polyline.
 ; Copyright 1994, 2004 by Rocket Software Ltd.
 ; 
 (DEFUN C:PCL (/ *error* typ enampt enam entt)
  (setvar "cmdecho" 0)
  (defun *error* (shk)
   (if (/= shk "Function cancelled") (write-line shk))
   (if snapp (setvar "snapmode" snapp))
  (princ))
  (setq snapp (getvar "snapmode"))
  (setvar "snapmode" 0)
  (if (and (setq enampt (entsel "Select a Polyline to Close: "))
           (setq enam (car enampt))
           (setq entt (entget enam))
           (setq typ (cdr (assoc 0 entt)))
           (or (= typ "POLYLINE") (= typ "LWPOLYLINE")))
      (command "pedit" enam "cl" ""))
  (setvar "snapmode" snapp)
 (princ))