CNC Prepare

This plugin is no longer supported. 
All commands are part of A>V>C> Pro.

Plugin AVC_CNC for AutoCAD and BricsCAD
Formation of a closed polyline for CNC-milling: outside contours, dadoes, grooves, pockets, cutouts... Contours for milling approach in the inside corners. Approximation splines with a given tolerance.

If your production is used CNC milling machines, you will probably have to prepare the outlines of parts before exporting to CAM program. Not enough to make flat shots from 3D solid. It need to remove the lines overlay and intersection, convert splines to arcs, close a polylines to loops, assign the right layers according to the type of processing. All this work can be done by regular means of AutoCAD. But it is a long time and you cannot see a lot of mistakes. To speed up the making loops are commands from this plugin.

The program can:
- Make flat shots from 3D Solids without any question.
- Distribute the line of flatshots in layers (visible and invisible separately)
- Make flat shot from PolyFaceMeshes and any other AutoCAD objects
- Finding in a heap of lines the contours of parts, choose the maximum of them and label it as the contours for outside milling.
- Finding the maximum closed loop in a set of intersecting lines and arcs.
- Finding nested contours and distribute them in layers - for outside and inside milling.
- Closing contour of dadoes (grooves, mortises, pocket or rabbets) into the loop with using fragments of outside contour of workpiece.
- Generate arc for the circular cutter approach in the internal corner of a workpiece (full cut out of corner).
- Generate a cut out surface at the inner corner of the 3D-solid.
- Generate arc to exit milling cutter out of the dado loop on the edge of the details (instead of the usual stretching dado loops).
- Check that the cutter given diameter will pass dado, automatically extend the dado loop.
- Convert splines and ellipses to lines and arcs with a given tolerance (the maximum deviation from the original curve).
- Project 3d splines and 3d polyline on the XY plane for conversion into ordinary polyline.
- Inverting the wrong arc whose NormalZ = -1.
- Work with the object "2d polyline", which occurs when the explosion texts using TXTEXP command.
- Restore the circle from ellipses and splines, when you projected cylinder (the hole in the Solid) crookedly.
- Optimize the number of polyline segments and remove the extra line joints.
- Ignore the small occasional gaps.
- Remove the small waste objects. Glue tiny trimming lines into full lines and arcs.
- Delete lines superimposed one on top of another or too close to another.
- Replacing small chains of lines with arcs and vice versa, too straight arc with a line.
- Correct slightly inclined horizontals and verticals.
- Use UCS, project all curves on XY plane of current UCS.
- Filter selected lines, ignoring the invisible and auxiliary by layer and linetype.
- Set up tolerances, both in size and in angle.
- Enable or disable management of layers.
- Find big dado loops and set layer Pocket for it.
- Specify the diameter of the holes in the name of drilling layer (for diameters no longer cutter).
- Specify the desired depth in the name of dado or pocket layer (As indicated in the settings).
- Get two overall dimensions on all solids and contours by one click

A special mention is the command "NC Prepare" (NCP), which maximizes automation of contouring by solids. The command itself calculates the depths of milling, the incline of the saw blade, sets the overall dimensions and dimensions for the side drillings, indicates the diameters of the drilling, corrects the heights of the texts.

This program does not replace the CAM-program. It does not create G-codes and it not contain nesting module for lay out details on the sheet. The program has a different task - to prepare accurate DWG-circuits for export; to technologist easily made 2d processing program at any CAM program.

BricsCAD can not make FlatShot from solids, so I had to create a simplified algorithm that projects the edges of solids. I can not determine the visibility of edges and create silhouettes of surfaces.  

According to your request I can optimize the command for the standards of your company. Offer your price.

Special thanks: This program is based on the source code writed by Sergey Donskov.




Real work with LAY, OutsideLoop, DadoLoop


NC Prepare

NC Prepare adaptation for inch drawing


DDL - DadoLoop – 
Formation of a closed polyline for CNC-milling dadoes 

OSL – OutsideLoop – Join segments to closed polyline. Convert any curves to polylines. Contour optimization.

IC - InsideCorner - 
Contours for milling approach in the inside corners

FLT - FlatShot - generate flat drawing from any AutoCAD objects. Project all on XY

DimOverall Get two overall dimensions on all solids and contours

NCP - NC Prepare - generate contours from Solids, create layers by milling depth and type, make dimensions and annotations. Works with solid images, visible through the viewport.

+Options - options dialog. In AutoCAD, the command will call up the usual Options dialog on the last tab of which you can configure all plug-in commands. In the BricsCAD, a special settings dialog opens.

I am currently working towards obtaining loops from solids. This is necessary for detecting the inside and outside processing, for calculating the depth of the dadoes and holes, and for notation of a slope of a circular saw.

FlatShot (FLT)

The command is published in a separate plugin AVC_Flat. See page Flat for details.

Overall Dimensions (DimOverall)

The command is published in a separate plugin AVC_DimOverall. See page Overall Dimensions for details.

InsideCorner (IC)

When you need a mill to cut a window in the details, then in the inner corners are always rounding cutter diameter. Often, these rounding prevent docking details. To CNC milling machine brought the cutter to the corner, you need to add to the contour of the approach arc. Of course at the same time formed a small gap in the part near the corner. Usually they are not visible or no value. The main thing that the details will dock with each other.

You can select any cutter diameter. Default = 8mm or ½ inch. Program will draw an arc with a diameter slightly larger cutter (0.01 mm) and place it in the corner so to provide finishing cutter into a corner, but leave a minimum extra hole. At start you can select two lines or a line and an arc. The main thing that they were in the same plane and have a common point. Also, you can use Ctrl for selecting two segments of polyline (liner or arched).
The command can handle all internal corners of closed polyline. Just program will ask you which side milling.
It is also possible to make notch at 3D model. You can select solid for cutting all inner corners or select solid edge through CTRL which adjoin two flat surfaces forming the inner corner. On the cylindrical surface of the program is not working.

The program works on a cycle, until you press the Esc
In the options you can choose sub-object selection mode (for polyline segments and solid edges), so as not to hold CTRL.
The program is designed to work with angles from 90°. For sharp corners, this method does not work because the resulting circuit has a very narrow section.
The program will automatically calculate the sharpest angle that a milling cutter can pass through a given gap. For example, if the cutter is 8mm and the gap is 0.01, then angles sharper than 87.1° will be ignored. If the gap is not specified, a limitation > 90° - 0.5° (angle tolerance) will be used.
Does not make sense doing calls in too obtuse angles because "notch" in the details may be hardly noticeable, less tolerance. The program automatically calculates the most obtuse angle for which it makes sense to make the cutter's approach (in which the arc enters into part to a depth specified by the permissible tolerance). For example, for a cutter 8mm and an tolerance of 0.5mm, angles obtuse 122.1 ° will be ignored.
If the polyline segments are too short to make the arc between them, the program will ignore such segments, find the intersection point of the following segments and try to make a notch into this "imaginary" angle.

OutsideLoop (OSL)

OSL command operates similarly to conventional commands Join and Boundary: combines lines and arcs in the polyline. But unlike Join this command can a lot more:
  • Look for the largest outer contour
  • Allowed to line intersect. All tails are cut off.
  • Closing contour within the outside contour.
  • Connects small gaps in the loop.
  • Converts splines and ellipses to lines and arcs with a given tolerance
  • Removes dust, small segments, dots similarly Overkill cleaning command.
  • Combines line broken into segments into one whole. Thereby optimizing the number of segments.
  • Flips arc whose NormalZ = -1. These are arcs that leave FlatShot and because of which it is impossible to pull solid and impossible to close to polyline. 
  • Spreads the contours obtained by layers. The layers from the template are used. If internal contours are detected, the program can record the depth of milling in the layer name.
  • The program will check that the contour can be traversed by the specified cutter and will identify the contours of the Pockets that require individual milling programs.
  • Replacing small chains of lines with arcs and vice versa, too straight arc with a line.
  • Correct slightly inclined horizontals and verticals.
  • Call “Inside corner” command for all polylines. The option is configured separately for external and internal circuits.
  • You can create multiple contours in a single call command.
  • Program runs within specified, configurable tolerance.
As a result, the output is a contour fit for further processing on CNC.
Command Settings can be found in AutoCAD Options on the CNC tab.

DadoLoop (DDL)

DDL command designed to close the contour of dado, grooves or rabbets. Program works only with 2d drawings lying in the XY plane. At start the command requests cutter diameter for ensure patency of the loop. Next the program prompts contour of dado. It can be arcs, lines, polylines, and splines. One can select the two parallel contours if it dado. Next the program will find for the main contour of part. Without it the work is not possible. The main contour must be a closed polyline (only!), and dado contour you have selected must end on main contour of detail. The program will builds a loop so as to ensure the passage of a given diameter cutter but minimally harass material on the sawdust. In addition the program makes the cutter approaches into all inside corners (Called the command "Inside corner"), so that rectangular parts can be inserted into the dado. At finish loop will close in the polyline. 

The program works on a cycle, until you press the Esc.
The program will expand the loop, if it is too narrow for a given cutter. And if it will not be able to expand – it will issue a warning. But program checked only the ends of the dado. Please follow to the middle of the dado was not restrictions.
This program allows you to enter cutter diameter equal to zero - in this case the dado circuits just closes on the contour of detail, without calling “Inside corner”. Just keep in mind that before calling the NCP or OSL should go to AutoCAD Options and check on “Consider diameter”.
Program can add depth at end of layer name. 
DodoLoop will check the area of the loop and the big loop will be marked as a NC_Pocket and little loop marked as NC_Inside. Pocket mark need for milling like spiral or like scan. This feature is disabled in the settings. Area check is not always appropriate - be sure to check the result.
Command Settings can be found in AutoCAD Options on the CNC tab.

NC Prepare (NCP)

The command will analyze the solids, reveal the contours of the dadoes, calculate the depths of the milling, find and mark the inclined ends. If necessary, cutters are made into corners. The command can make overall dimensions of the parts and the dimensions of the side drilling. Also, the program can designate the holes in blocks or record their diameter. For the MTexts found in the viewport, the height will be adjusted.
To use the command, you need to prepare:
  • Use the drawing file with the required hole pattern blocks, with the layers configured and the desired dimension styles. If the program does not find this, it will try to load all of these objects from the template file.
  • Configure the current Dimension style (_DimStyle). Pay attention to the accuracy of the display of linear and angular dimensions.
  • Adjust the current style and height of the text (_Style and TextSize). The height of the texts should correspond to the PAPER space, not the MODEL.
  • Call the Options dialog. On the CNC tab, check the cutter diameter, permissible variation and all program settings. Check the NCP command options.
  • Lay solids in the XY plane. It's best to use the LAY command.
  • Customize the layout and the viewport on it so that one or more solid is visible. If you see several solids, then leave enough space between them for dimensioning.
  • The command does not work if you did not select a layout, but you can work in the model via the viewport.
  • Call the NCP command.
  • The command works with only one viewport. If there are several of them on one layout, then there will be a selection request for the viewport.
  • The command maximizes the viewport on the screen and blocks its scale.
  • Milling depths and hole diameters in layer names will be rounded to within the specified permissible variation. The format is configured in the Common settings of AVC plug-ins.
  • All annotations will be in paper space, not in the model.
  • After completing all the work, the command will write to the console how many solids have been processed.
  • The original solids will be replaced by flat contours.
  • Adjust the position of the callouts and dimensions. The program can not arrange them perfectly.
  • Enter the model and call the Dado Loop (DDL) to close the contours of the dadoes. This is not done yet automatically.
  • Check the contours that have fallen into the NC_Inside layers. Some of them can be handled in reverse, on the outside - your task is to choose the optimal milling algorithm.
Remember that the command is intended for obtaining contours for 2.5D-milling. She will not be able to draw drawings of complex products.
BricsCAD can not make FlatShot from solids, so I had to create a simplified algorithm that projects the edges of solids. I can not determine the visibility of edges and create silhouettes of surfaces.

CNC Options

You can access the settings dialog from any command by selecting the Settings option. In addition, the program options are the usual dialogue of the AutoCAD Options on the CNC tab. In BricsCAD use command +Options. All options have a tooltip.

The operation of the commands from this plug-in is affected by the Common options of all the A>V>C> plug-ins.



  • BricsCAD 18 Pro ready


  • AutoCAD 2019 ready
  • Fixed FLT MText rotation error


  • New version of FLT command
  • Unitless drawings are recognized as Inch drawings if a fractional length format is specified.
  • Fixed DDL bug - in Other contours the depth was erased and the pocket were not recognized.
  • Fixed IC error - the contour shifted to 0 coordinates.
  • Fixed OSL error - crash on splines projected in a line.


  • Fixed a bug in the command Outside Loop (OSL) - an error of projection of polylines and splines in some coordinate systems UCS


  • Fix AutoCAD 2012 eInvalidInput error in NCP and DimOverall
  • Fix Windows x32 "acedTrans in DLL accore.dll" error  in NCP and DimOverall


  • Updated command FLT
  • New command DimOverall


  • Fixed: NCP error: selection objects in rectangular viewport in AutoCAD 2018
  • Fixed: NCP error: choice curved viewport from several   


  • Fixed: Template error “The path is not of a legal form”
  • Fixed: IC not work on first corner


  • Fixed: angNumToCut error in IC
  • Fixed: spline-circle converted to not closed arc
  • Fixed: pocket detection algorithm
  • Fixed: spline-circle converted to not closed arc
  • Added: pocket detection check contour for traversed by the specified cutter and can use layer NC_Other


  • Added: NCP compatibility with inch drawings
  • Added: Locking the viewport to NCP
  • Added: scaling of texts that fall into the viewport in NCP
  • Added: NCP call IC for closed loops
  • Added: setting the names of NC_ layers
  • Added: button for calling Options in the CNC panel in the ribbon interface
  • Fixed: Changing common settings not always displayed in AutoCAD Options dialog


  • Fixed: Error converting flat elliptical arcs
  • Fixed: Half-arc error when searching for the largest contour
  • Fixed: "NULL exception" error in IC
  • Removed: AVCMessage command button
  • Added: Beta version of the NCP command


  • Fixed: Attempting to correct a fading activation
  • Added: Common AVC options in the CNC options window
  • Deleted: the command to configure the sending of messages
  • Updated: Completely new FLT command, which now works with any AutoCAD objects

Outside Loop (OSL)

  • Almost the entire program has been rewritten for correct work with contours from many small straight lines. It became possible to process casts from meshes and exploded texts.
  • Updated: a new algorithm for combining closely spaced contours. Eliminated the formation of extra loops.
  • Updated: a completely new algorithm for defragmentation of contours. Added: defragmentation of small segments with increased accuracy. Now the figures with rounded corners are correctly processed.
  • Added: the ability to replace a group of line segments to an arc
  • Updated: a completely new algorithm for garbage collection. Garbage segments are grouped together, and the program tries to assemble large lines or arcs from them
  • Fixed: there was garbage after dividing intersecting segments
  • Fixed: out of allowable deviations due to repeated defragmentation
  • Updated: the sub-routine of vertical and horizontal alignment now uses all the specified accuracy, not half of it. Those alignments will occur twice as often.

Inner Corner (IC)

  • Fixed: missing polyline corners after short segment captures
  • Fixed: the wrong choice was Inside/Outside when the polyline on the NC_Outside layer
  • Added: skipping any number of small segments, calculating the angle and forming an arc only on long segments
  • Added: automatic calculation of the most obtuse angle, for which it makes sense to make the approach of the cutter (in which the arc enters inside part to a depth specified by the permissible tolerance). For example, for a cutter 8mm and an tolerance of 0.5mm, angles obtuse then 122.1° will be ignored
  • Added: automatic calculation of the sharpest angle at which the milling cutter enters the corner due to the specified gap. For example, if the cutter is 8mm and the gap is 0.01, then angles sharper than 87.1° will be ignored. If the gap is not specified, a limitation of > 90° - 0.5° (angle tolerance) will be used.


  • Added: you can enter depth each time you call DDL or OSL.
  • Make flat shot from PolyFaceMeshes
  • Fixed: Error loading layers when template is locked.


  • AutoCAD 2018 compatibility
  • Added: Auto-align  line to vertical or horizontal
  • Optimization of contours:  Replace loop from two similar arc on one arc
  • Fixed: Inverted arcs while defragmenting contours
  • Fixed: The circle instead of gluing the two arcs
  • Fixed: eInvalidInput error when approximating spline
  • Fixed: trim spline when approximating
  • Fixed: Planar spline not projected on XY UCS
  • Fixed: Error finding outside contour
  • Fixed: Common Options not saved if AVC_KIT installed
  • IC on all corners of solid
  • New options – IC on inside|outside loops
  • Updated setting dialog
  • Default options changed
  • Demo mode fix
  • UCS used
  • OSL make polyline form free lines

  • German names of layers
  • Test loops for Pocket
  • Depth for layer name
  • Updated options dialog
  • Project rotated curves to XY
  • Fixed typos
  • Replaced space on _ in layer names
  • Updated options dialog
1.0 First public version