TheSwamp

Code Red => .NET => Topic started by: sybold on February 02, 2016, 01:56:45 PM

Title: detecting bgplot or publish
Post by: sybold on February 02, 2016, 01:56:45 PM
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.
Code: [Select]
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.
Title: Re: detecting bgplot or publish
Post by: BlackBox on February 02, 2016, 07:07:45 PM
Not sure - you may want to see what's included in Autodesk.AutoCAD.Publishing.AboutToBeginBackgroundPublishingEventArgs

Cheers