 ; DDD - swap attribute values: "" to "..." & vice versa.
 ; Copyright 1994, 2003, 2004, 2008 by Rocket Software Ltd.
 ; Also contains DDDD - kill all "..." values, in case you screw up.
 ; One of the routines Captain Nemo used to design the Nautilus.
 ; Revised: Dddd should now be unnecessary.

 (DEFUN C:DDDD (/ ss num enam esav entt)
  (setq ss (ssget (list (cons 0 "insert"))))
  (setq num 0)
  (while (setq esav (setq enam (ssname ss num)))
         (setq num (1+ num))
         (if (= 1 (cdr (assoc 66 (entget enam))))
             (while (/= "SEQEND" (cdr (assoc 0 (setq entt (entget
                                              (setq enam (entnext enam)))))))
                    (if (member (cdr (assoc 1 entt)) '("..." " " "  "))
                        (entmod (subst (cons 1 "") (assoc 1 entt) entt)))))
         (entupd esav))
 (princ))

 ; Subroutine Ddd - the mechanism.
 (DEFUN DDD (enam / esav entt vala dots)
  (setq esav enam)
  (while (and (null dots)
              (/= (cdr (assoc 0 (setq entt (entget
                                     (setq enam (entnext enam)))))) "SEQEND"))
         (if (= (cdr (assoc 1 entt)) "...")
             (setq dots t)))
  (setq dots (if dots "" "..."))
  (setq enam esav)
  (while (/= (cdr (assoc 0 (setq entt (entget (setq enam (entnext enam))))))
                                                                      "SEQEND")
         (setq vala (cdr (assoc 1 entt)))
         (if (member vala '("..." "" " " "  "))
             (entmod (subst (cons 1 dots) (assoc 1 entt) entt))))
  (entupd esav)
 (princ))

 (DEFUN C:DDD (/ ss enam)
  (setq ss (ssget (list (cons 0 "insert"))))
  (setq num 0)
  (while (setq enam (ssname ss num))
         (setq num (1+ num))
         (if (= 1 (cdr (assoc 66 (entget enam))))
             (ddd enam)))
 (princ))