 ; Piano - read and run a program stored in a block.
 ; Copyright 1994, 2014 by Rocket Software Ltd.
 ; Pa contains the pick point, there are five local variables, loc1-5.
 ; Nonlocal names can be used as desired.
 ; The possibilities for good are endless.  But dare we allow it to be used?
 (DEFUN C:PIANO (/ ept entt enam pa qui afa loc1 loc2 loc3 loc4 loc5)
  (setq enam (car (setq ept (entsel))))
  (setq pa (cadr ept))
  (if (and enam
          (setq entt (entget enam))
          (= (cdr (assoc 0 entt)) "INSERT")
          (= (cdr (assoc 66 entt)) 1))
 ; Apparently you can step through a deleted entity.
      (while (and enam
                  (/= (cdr (assoc 0 (setq entt (entget enam)))) "SEQEND")
                  (null qui))
             (setq afa (cdr (assoc 1 entt)))
             (if afa (eval (read afa)))
             (setq enam (entnext enam)))
      (write-line "\nNo Suitable Entity Selected."))
 (princ))