January’s Plugin of the Month live on Autodesk Labs: DrawOrder By Layer for AutoCAD

As Scott has announced over on his blog, January's Plugin of the Month, DrawOrder By Layer, is now available on Autodesk Labs. I first posted the code for this very useful plugin back in October, and this version includes only a very minor change from that one (for performance reasons it now only works with modelspace layers).

A huge thanks to Terry Dotson from DotSoft for generously donating this plugin.

After the original post, a few people provided feedback on user interface enhancements they'd like to see in the tool – thanks for taking the time to do so, those of you who did – but for this release the user interface has been left as it was: as usual the plugin is provided with full source-code, should you wish to go ahead and implement more advanced capabilities (multiple reordering/drag & drop/etc.).

Enjoy! 🙂

6 responses to “January’s Plugin of the Month live on Autodesk Labs: DrawOrder By Layer for AutoCAD”

  1. It would be nice to be able to save and call up a 'standard' draw order list to process. Also, a reactor to process this 'standard list' prior to the plot command would also make this invaluable. I'll try to take a stab at these.

  2. Will this work on xref layers as well? Wildcards?

  3. My understanding is that it will not (as we restrict our selection of layers to those in modelspace). But then I haven't tried it, specifically.

    I'm not even sure how draw-order is meant to work with the contents of xrefs, to be honest.

    Kean

  4. I haven't looked at the plugin, but draw-order for xrefs works much the same as it does for other BlockReferences. The host drawing has a BlockTableRecord for the xref which has a DrawOrderTable. That DrawOrderTable is the same as the xref's modelspace DrawOrderTable, which means that the xref's draw-order is honored in the host drawing.

    You can change the xref's BTR just like any other BTR, including modifying it's DrawOrderTable. It will affect what you see in the host drawing, but it won't persist past the next xref reload.

    Some changes that you can make in the host drawing's BTR for an xref may prevent refedit from working until the xref is reloaded [erasing entities, for example.] Modifying the DrawOrderTable doesn't seem to affect refedit, though.

  5. I do something similar, but not based on layers.

    I recommend that you use the PlotReactorManager events (in the Autodesk.AutoCAD.PlottingServices namespace) because you'll catch the plot, publish, and preview commands. You'll also catch plotting techniques that aren't command-based, such as those used by the Sheet Set Manager.

    I use the PlotReactorManager.BeginPage event to enforce draw order per-layout.

  6. Maybe I'll just try to do a draw order re-order upon drawing save/close.

Leave a Reply

Your email address will not be published. Required fields are marked *