The RECTANG command

The RECTANG command draws a rectangle (surprisingly..), which is really just a closed polyline. There are however a few ways you can use the command that you may not know about.

Normal Usage

Invoke the RECTANG command, and pick two points denoting the two opposing corners of the rectangle. It might be worth noting that the polyline is drawn starting from the first point you specify, in the horizontal direction. So if you specify the bottom left followed by the top right, it will be drawn in the anti-clockwise direction.

Special Usage

Perhaps the most interesting usage is the ability to add chamfers and fillets to the rectangle. This could be quite handy in some circumstances. Otherwise this tool is pretty straight forward.

Other Information

There is some best practice advice I can give on the use of rectangles (and any other polyline). Generally you want to use them in a way that makes sense in the context of the drawing. For example:

This is a washer drawn in section – so the rectangle in the middle represents the hole through the centre of the washer. However, none of the rectangles that I drew enclose the centre rectangle. Instead, the washer is made up from one rectangle on the left, one on the right, and one denoting the boundary:

If you think about it this makes much more sense than anything else because you’ve captured the actual outlines of the object. These can be reused later in a way that makes sense, i.e., as a hatch boundary in this example. Try to get in the habit of thinking in this way and you’ll save yourself time later.

There is much more good advice from where this came from – please do subscribe to my blog.

The PLINE command and the polyline entity

The PLINE command creates an entity known as the polyline, which is basically a series of connected lines or arcs. There are some interesting tips for using polylines and the PLINE command, and many system variables that govern its use. There are also a few ways that you can customise AutoCAD® to utilise the polyline to better advantage.

Normal Usage

After invoking the PLINE command the user can pick points to define the path. The ‘A’ key can be pressed to switch to arc mode whereby arcs are created instead or lines. There are several modifiers once in arc mode, such as pressing ‘D’ to reorient the start direction of the arc.

Types of Polyline

Confusingly there are three types of polyline – polylines, 3D polylines and LW polylines (light weight polylines). The difference between them is that a LW polyline truly is two dimensional – it only stores X and Y coordinates, but it must be associated with a UCS plane. When drawing a LW polyline it inherits the current UCS as the plane for that LW polyline. Points added must reside on this plane, which can sometimes cause confusion when there is also three dimensional data in the drawing.

You don’t get any points for guessing what a 3D polyline is I’m afraid… Yes, it captures the coordinates in three dimensional space rather than on a two dimensional plane. This one isn’t creatable using the PLINE command – it has a command of it’s own called 3DPOLY.

So what is the last type… the one that isn’t a LW polyline or a 3D polyline… the one simply called a “polyline”? It is the type of polyline that was originally available before AutoCAD® R14. It too captures all the three dimensional coordinates for every point, so in this sense it is the same as the 3D polyline, but this type only allows 2D geometry. You can only draw shapes that would be possible to draw on a two dimensional plane. So in terms of what you can do with it, its the same as the LW polyline. It does the same job, just much less efficiently, hence why the newer version is called a light weight polyline. It is only really provided for backwards compatability and generally it is use is depreciated.

This brings me on to my next point – what type of polyline is created by the PLINE command? This is controlled by the system variable PLINETYPE. By default PLINETYPE is set to 2, which tells AutoCAD® to use LW polylines instead of polylines. Additionally, all old format polylines are automatically upgraded to LW polylines when the drawing is opened. You can change this setting to 0 or 1 to stop AutoCAD® upgrading polylines and to force AutoCAD® to produce old-format polylines from the PLINE command, but I’d strongly advise against it.

Special Usage

Polylines are versatile little things, and I’d recommend using them instead of lines in pretty much all cases. In addition to being able to have a line-thickness property much like any other entity, polylines are given the option of a width too. Most AutoCAD® users don’t realise that polylines can vary in width along the length of the line. Polylines do not have to be a uniform width. The global width option under properties is what people tend to go to when they want to change polyline width which is perhaps where the perception comes from. But all this does is override all width properties along the whole line. You can specify individual widths at any segment of the polyline by iterating through the points of the polyline in the properties window. This allows you to edit the start and end widths of the segment. This can be done on the fly when creating the polyline using the ‘width’ option during the command.

Because of their continuous nature, polylines make excellent boundaries for specifying a hatch boundary. I’m sure nearly every person that has ever used AutoCAD® has selected the ‘pick points’ option under the HATCH command, only to receive the message “a closed boundary could not be determined”. Infuriating as this can sometimes be, it is usually due to a gap or ambiguity somewhere in boundary. Get into the habit of drawing your objects using polylines and this will become less of an issue. Your boundaries for hatching will already be defined – you’ll just have to use the ‘select objects’ option instead.

Other Information

Third party software can sometimes generate polylines in the ways that we do not expect. For instance, have you ever had a polyline that you just couldn’t join other lines to? This is usually down to one of two things: the UCS of the polyline, or its elevation. Sometimes you can get polylines where the UCS is looking in a completely different direction, even though the drawing is say in plan. There is a quick fix for this however, simply explode the polyline to convert it into its constituent parts, and rejoin them into a polyline in the UCS you want. This may require also selecting all of the exploded lines and changing their Z coordinate to 0. The second common reason for polylines that won’t join is due to elevation. Make sure that the elevation of the polyline and what you’re joining it to is what you expect, and this should then allow you to join them.

Editing Polylines

The PEDIT command allows you to edit polylines. This is a useful feature, expecially when used on objects that aren’t polylines in the first place. This will convert the entity to a polyline, however there is a somewhat annoying popup asking you to confirm the action. Fortunately as with most things in AutoCAD®, this can be customised. Set the PEDITACCEPT system variable to 1 to suppress this prompt.

There is also an extension to this idea which I personally like to use. A little known trick is that under the CUI editor, users can customise the default double click action on specific entities. The default action when double clicking on a line for example, is to open the properties palette. Try changing the default action of lines and arcs to the PEDIT command instead, and you will be able to convert to polylines with a simple double click.

Some users may experience the problem of linetypes being irregular along polylines. This problem is caused by a display property of the polyline, namely the ‘linetype generation’ property. This should be set to ‘enabled’. The default property when polylines are created can be customised with the PLINEGEN.

There are many other commands that produce polylines as their ultimate output, including RECT, BOUNDARY, POLYGON, DONUT, and SKETCH.

Please do subscribe to this blog – you won’t regret it!

The LINE command and the line entity

It doesn’t get much simpler than this does it. Does it…?

Well, no not really. But there are a few things that people generally don’t know, and there are some misconceptions about the LINE command that you should know about.

Normal Usage

After starting the LINE command you are prompted for a start point and an end point. Enter them as requested, and you’ve got yourself a swanky new line in your drawing. The LINE command repeats until cancelled by the user, assuming the end point of the last line is to be the start point of the new line. During a chain of lines you have the option to press ‘U’ for undo, which deletes the last line drawn, or ‘C’, which ends the command by joining the ends of the string of lines to form a closed loop.

Special Usage

Did you know that you do not have to give a start point? This is a fairly standard AutoCAD® thing, but if you press return at the prompt AutoCAD® will assume you want to start from the last point you entered. So if you drew some lines, ended the command but then wanted to continue drawing from the endpoint of the last line you drew, start the LINE command and press return at the first point prompt.

Ok its not that special, but it leads me to the extension of this idea. Lets assume the last object you drew was an ARC. If you now invoke the LINE command and press return at the first prompt, the start point is at the end point of the ARC, as you’d expect. But, the line is constrained to the tangent of the ARC, which could indeed be quite useful.

Other Information

There is often debate on whether it is better to by default use the LINE command or the PLINE command. The PLINE command offers additional functionality but at the cost of file size. I want to dispel the notion that polylines result in bigger file sizes, because it simply is not true. Yes, if you compare one polyline with one line, the polyline contains more information and therefore takes up more space. But, compare a string of lines to the same string of lines represented by a single polyline and you’ll get a different story. The reason for this is that a polyline stores the points as a list of coordinates. While its true that lines do the same, a string of lines means that there are many repeated coordinates because the ends of the lines are on top of each other. So in this instance the overhead of having a polyline is worthwhile because it stores the points more efficiently.

If you found this interesting, I have no doubt that you will find a subscription very useful. I will always be willing to answer any question you have on anything.