anchor.diff:                (setq p1 p2)
               );END while
               (DT:InsertFlatLevelBlock p2)
  +            (vla-endUndoMark activeDocument)
             );END subcond
             ((> startParam endParam) ; reverse direction
  +            (vla-startUndoMark activeDocument)
               (while (> param endParam)
                 (setq
                   param (- param 1)
  
positive.code:             (princ "\nStart and end point are the same.")
            );END subcond
            ((< startParam endParam) ; normal direction
              (while (< param endParam)
                (setq
                  param (+ param 1)
  
negative.code:     );END if
    )
  
    (setq activeDocument (vla-get-ActiveDocument (vlax-get-acad-object)))
    (if (setq ent_name (car (entsel "\nSelect a 2D polyline: ")) )
      (if (= "LWPOLYLINE" (cdr (assoc 0 (entget ent_name))) )
        (progn
  