with autocad 2014 i used the following to detect if a drawing was being opened by publish or was being plotted as a background plot.
private void docs_DocumentCreated(object sender, DocumentCollectionEventArgs e)
{
string str = HostApplicationServices.Current.FindFile(e.Document.Name, e.Document.Database, FindFileHint.Default);
if (str.Contains("AcPublish") | str.Contains("BGPlot")) {
//' just plot drawing, no action
} else {
//' normal opening a drawing, show custom document management form
}
}
now with 2016, the findfile return value doesn't have the "acpublish" or "bgplot" in it, and when publishing a lot of drawings they all are being treated as a normal being opened file.