Add if Layer is Missing (AutoCAD .net API)

A very handy method. Often detailers will ask for something to be placed on a particular layer. But since they are using a 100 different drawing templates without any consistency nor standards, the onus is on you to impose that standard on them. So you’d have to check for a layer and add it if it doesn’t already exist. Anyways, that’s enough griping: here is the code:

Written on May 11, 2018