Router-CIM Automation



Previous topic Next topic  


Previous topic Next topic  

Cutting an Ellipse

Sometimes cutting an ellipse in AutoCAD can be a tricky event.  You draw out the ellipse you want, and then use Router-CIM to cut it and determine later that the ellipse shape is not really smooth or not the shape you drew at all.


The problem that usually occurs is that in AutoCAD, PELLIPSE is set to 0, and the geometry actually lists as an ELLIPSE.  But, in Router-CIM, *NOPELLIPSE* is set to nil, so when the ellipse is geoshaped, Router-CIM turns on PELLIPSE and uses AutoCAD to draw a Polyline ELLIPSE, which is not really an ellipse, but an approximation of one drawn as a polyline. Then the two pieces do not match and you end up cutting a shape that is not the same as the one you drew.



If you have an Ellipse that does not seem to cut right...

Check that the Geoshape follows the original geometry and does not deviate or 'wander' in and out of tolerance.
List the original geometry.  See if it is an ellipse or a polyline.
Check the PELLIPSE setting in AutoCAD
Check the *NOPELLIPSE* setting in Router-CIM


If the AutoCAD geometry is an ELLIPSE when you list it (see below) then you must set *NOPELLIPSE* to T in Router-CIM in the NCVARS.

If the AutoCAD geometry is a POLYLINE when you list it then you should set *NOPELLIPSE* to nil in Router-CIM in the NCVARS.


Click here for information on how to add an NCVAR.


Listing the object in AutoCAD:

Once you have drawn your shape, type LIST at the command line and at the Select Objects prompt pick on your shape and hit ENTER.  AutoCAD will show you the data for the object.  The listing below shows a listing for an ellipse with the PELLIPSE variable set to 0.




If you select the object in AutoCAD, you will only see grips for the center and enpoints of the Major/Minor Axes.




This more or less demonstrates that the ellipse is really an ellipse and not a polyline.

If you set PELLIPSE to 1 in AutoCAD (type PELLIPSE at the command prompt and hit ENTER, when prompted for a value, 1 will make ellipses as Polylines, and 0 will make the as actual ellipses), and then draw the same ellipse again, and list it, you will see this:




Showing you that the ellipse is now a Polyline.  If you select it on the screen, you will see many more grips as the ellipse is made up from 16 arc segments, which is the absolute minimum number of arcs you can use to approximate an ellipse (which is what causes all the trouble as there really should be at least 4 in each quadrant, which means 32 total or twice the AutoCAD default resolution).




Now that you know how to determine if your geometry is an ellipse or a Polyline, you have to know how to deal with it in Router-CIM.


The trouble occurs when you draw a regular ellipse in AutoCAD (PELLIPSE is set to 0 and you only see a few grips like the first example) and in Router-CIM the *NOPELLIPSE* variable is set to nil.  That means that Router-CIM will USE the PELLIPSE routine when it creates its geoshape and approximate the ellipse in 16 arcs.  The two elements will not match because the real ellipse geometry is created with more resolution than 16 arcs can approximate.  When you geoshape then you will see this type of 'wandering' on the geoshape:




If you were to then change the NCVAR *NOPELLIPSE* to T in Router-CIM, erase your geoshape and then re-geoshape the geometry again, you would see this:




This should help straighten out some of the issues of cutting ellipses in Router-CIM.  The reason some people prefer to use PELLIPSE in AutoCAD is because it makes a Polyline with ARCS instead of a lot of point to point data.  With Polylines, you get much less code and the code is made up from arcs instead of a LOT of tiny line segments.  However, the amount of the NC code is not really relevant if your geometry is not cut correctly and unfortunately there is no way to turn up the resolution of the Polyline created by AutoCAD when PELLIPSE is set to 1.  You will get 16 arcs and that is it.


You may notice that if you touch the geoshape show above, with *NOPELLIPSE* in Router-CIM set to T, you will get many, many grips, like the drawing show below.




The sheer volume of the grips on the geoshape Polyline show that there is a great deal of resolution in this shape holding it closely to the true elliptical shape.


You can then cut this shape, and although it is more code, it will be exactly the shape you originally created.