Inserting blocks depending on certain logic have been always a requirement while working with CAD Drawings and AutoCAD has come up with commands to address this requirement. Measure command of AutoCAD can insert the blocks at a given distance. Divide command of AutoCAD can divide the give polyline into specified number of segments and then insert the block. Both these commands cannot be used to insert the block at mid point of the polyline as each segment of the polyline will be of different length. Using Mid Block (midb) lisp command, you can insert a specific AutoCAD block at the midpoint of all the segments of selected polyline.
More lisp commands to insert blocks