Try your hands on AutoLISP coding. Dive straight away.
Code is on GitHub at the URL present in the comment.
Source codes for all subsequent hands on practice tutorials will reside on separate branch of this repository.
You can use git command line utility for cloning just one branch.
Command for this is given in the first comment of this video.
Another condition is added to see , if the entity selected by user is LWPOLYLINE , or some other entity. Debugging process , adding breakpoints and other things are covered in more detains.
This if block checks , if the entity selected by user is LWPOLYLINE.
(if (not (eq (cdr (assoc 0 (entget (car ply)))) "LWPOLYLINE"))
(progn
(princ "\nInvalid selection. \nPlease select a polyline.")
(vl-exit-with-value -1)
)
)