Identify plotting during draw overrule

<?xml encoding=”UTF-8″>By Virupaksha Aithal

Recently, I received questions from couple of developers on identifying the plotting state during overrule. Though the context of questions were different (like one developer wanted to avoid doing draw overrule during plot and other wanted kind of applying plot stamp) I felt I need to make the solution as blog. To identify the plotting state, use “Context.IsPlotGeneration” as shown in below code

public override bool WorldDraw(Autodesk.AutoCAD.GraphicsInterface.Drawable drawable,
Autodesk.AutoCAD.GraphicsInterface.WorldDraw wd)
{
if (wd.Context.IsPlotGeneration)
{
//code while ploting
}
else
{
//code while not ploting
}
return base.WorldDraw(drawable, wd);
}

Comments

4 responses to “Identify plotting during draw overrule”

  1. The above is not quite complete: The IsPlotGeneration state is NOT set when using the Autodesk PDF driver (PDF ePlot by Autodesk).
    Note: Based on testing with AutoCAD 2014 and legacy hidden viewports.

  2. Thanks for the code. I’m getting a problem when publish drawing in background. Is there any API to detect drawing is publishing in background?
    Thanks!

  3. Hi,
    Please make sure you load the overrule plug-in in the back ground acad process also. Back ground plotting starts a background acad instance. so you need make sure the overrule dll is also loaded in the back ground process. Once method is to use autoloader mechanism (make sure the autoloader bundle) is in trusted location.
    Thanks
    Viru

  4. Thank you very much for very helpful information!

Leave a Reply to THCancel reply

Discover more from Autodesk Developer Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading