The XLine Command and Creating Levels in your Drawing

With the Ortho Mode and Polar Tracking at your disposal, you may be tempted to completely ignore the concept of construction lines. But I certainly still use them, as they are actually really useful for specifying a logical concept in your drawing – for instance, a level.

Basic usage of the XLINE command is simple. Enter XLINE at the command line, followed by two points that define an origin and a direction. There are additional options at the command prompt – H and V constrain the construction line to the Horizontal and Vertical directions respectively. A forces the xline to be drawn at a specific angle, which can also sometimes be useful. The O option is basically the same as the offset command, but forces the new line to be an XLINE rather than imitating whatever you selected. The B option I’ve never actually used before, but this option draws the XLINE that bisects, or is the midpoint of the angle you enclose with three points.

I mentioned that XLINEs are useful for levels, but when drawing a section or elevation with known levels, it can sometimes be clumsy inputting the elevations. For this reason, I always draw sections and elevations at their real world level in the Y direction.

 

 

Here for example, we are showing a level of 0, and 4 above some datum. Here it would be good practice to ensure that the level we have shown on the drawing is actually the level in the Y axis of the drawing. That way, we can be more certain that the drawing is correct. It also makes checking very easy using the ID command, by simply looking at whatever it says for the Y axis, and comparing with what we know it should be.

But there still is the problem of inputting the levels in a quick and elegant way. Up until recently, I had been using an XLINE drawn horizontally at a level of 0, and then offsetting upwards the amount required. This works, but it’s not the quickest way. A slight improvement is to invoke the XLINE command, press H for Horizontal, and then input a coordinate manually, using 0 (or any other number) for the X coordinate, and the desired level for the Y coordinate. This works, but still (for me) isn’t as elegant as it could be.

So instead, I decided to create a neat little lisp, for getting an XLINE at a specific level on the drawing:

level.lsp

This simple command asks you for a level, and an XLINE appears in your drawing at that level. It also scales what you enter by a factor of 1000, so that levels displayed in metres are instantly converted to millimetres. I’d suggest having a look at the lisp code, as it is really quite a good example of how a little bit of lisp can get a job done. It also gives you the opportunity to optimise the code for whatever units you are using.

All for now,

Will

 

Common causes for AutoCAD® freezing

How many times have you been working in AutoCAD®, and then suddenly it freezes on you? Panic sets in, as you try to remember the last time you saved… You wait… and wait… and… thankfully AutoCAD® un-freezes, this time…

But what actually is the cause of AutoCAD® freezing? It depends – there are many potential reasons for AutoCAD® freezing, but some can be avoided completely with a little understanding of what’s actually happening.

Selections

The first and most obvious reason for AutoCAD® freezing is when we do things to a very large selection. What can sometimes be unexpected is when AutoCAD® freezes when we have merely selected the objects without doing anything to them. This can sometimes leave us gazing at an hourglass thinking “I didn’t ask you to do anything! Why are you freezing on me!?”. Odd as this may seem, there is a reason for it.

When a selection is made, any on screen information that relates to your active selection needs to be updated; otherwise you’ll be working from incorrect information. So, if for example you have the properties window on your screen anywhere, even if it is docked with the auto-hide feature enabled, all the data in the properties window needs to be updated with correct information. The time that this takes is proportional with the amount of things selected, so you can see that simply selecting objects can be the cause of AutoCAD® freezing.

There are ways of working that allow us to drastically reduce the frequency of AutoCAD® freezing when working with a large selection. Make sure you select commands before you make a selection. This sends a clearer instruction to AutoCAD®, and it is dealt with more quickly than if we make the selection first. By selecting first you’re saying to AutoCAD® “Here are some entities that I am interested in – prepare them for me to use in any way”. This is vague, so AutoCAD® has to prepare for anything. However by invoking the command first and making a selection afterwards you’re saying “I only care about performing this action – these are the entities I want to perform it on”. This instruction is much clearer and skips out a lot that we’re not interested in. An extension of this is to get out of the habit of using the Delete key for erasing entities. Yes, it works. But again, picking the erase command first and then the entities sends a clearer message with a very noticeable difference in performance when working with large selections.

Commands

There are a few commands that more commonly cause AutoCAD® to freeze than others. Hatching is one of the main ones, but again, a little know-how can avoid this. A lot of people routinely use the pick-points option for defining a hatch boundary. I personally always try to draw in a way that makes hatching easy. For example, where possible I use closed polylines instead of lines. This allows me to then hatch later by selecting a boundary, eliminating the need to pick points, potentially making AutoCAD® hang. Take a look at my post on the RECTANG command to see what I mean.

When working in 3D, you might be tempted to avoid the 3DORBIT command completely in favour of the SHIFT+MOUSEWHEEL, but there is a reason you should generally use the 3DO command instead. AutoCAD® needs to prepare for 3D orbitting, and if you’re planning on manipulating the drawing a bit, you only want to make AutoCAD® hang for this preparation once. If you use the SHIFT+MOUSEWHEEL method, you’ll make AutoCAD® prepare for 3D orbitting each time you use it, which can be very time consuming on larger drawings. So for very small drawings, its fine to use SHIFT+MOUSEWHEEL, but for everything else use 3DO.

Networked Working

Working on drawings that are saved on some external network has been known to suffer performance issues. Try where possible to work locally, but only where doing so does not undermine whatever document management system you have in place (you do have a structured and coherent document management system.. don’t you??).

Bugs

One particularly prolific bug that I’ve had problems with is the Scale List Bug. Click here to view the solution.

When AutoCAD® Freezes or Hangs…

Wait!!! Do not mash the keys – however tempting that may be! Doing so will only make it take longer. Try to be patient. After a minute or so, you could try a few taps on the Escape key – sometimes you can cancel the command and regain control. After a few mins longer you may want to weigh up whether or not it is worth trying to regain control at all. Is the amount of work you have done since the last save worth rescuing? That will depend on how much work you did. Often, the bulk of the work is the thought processes that went into whatever you did in AutoCAD® – this work has still been done, and you can redo the actual AutoCAD® input quite quickly. If you choose to kill AutoCAD®, you might want to know this useful keyboard shortcut – Ctrl + Shift + Escape, which brings up the task manager.

I will be updating this list in the future so you may want to revisit this post in the future. If you haven’t already, please do subscribe to howtoautocad.com. It is really simple to do – just fill out your email address below, and all you get is an email whenever I post new content. So, it can only be useful to you, and you have nothing to lose 🙂

Will

The Amazing FILLET Zero Command

So you’re drawing away, and you’ve got two lines that need to come together to form a corner, but at the moment the lines are too short or too long. Instead of extending or trimming them, it can be quite neat to use the FILLET command with a radius of 0.

For those of you that already knew this little tip but dodged it in the past because you have to mess around making sure your fillet radius was 0, you’re in luck because you don’t actually have to explicitly set the fillet radius to 0 at all. In a similar fashion to the TRIM and EXTEND commands, you can hold down the SHIFT key to modify the behaviour of this command. As you guessed, holding down the SHIFT key during the FILLET or CHAMFER commands will force a 0 radius or chamfer.

One final note, if you’re doing this with just lines, you’ll be left with what you started with – lines. However, if either one or both of the entities are in fact polylines, they will be joined to form a single polyline. If you planned to join them afterwards this can be useful to know.

The CIRCLE command and the circle entity

The circle is one of those commands that can be very useful in the hands of those that know how. Obviously if you want to draw a circle this is what you need – but beyond that, circles have useful properties that make them very useful when trying to draw certain things. We’ll see some examples of what I mean later on in this post.

Normal Usage

 Invoke the CIRCLE command, and you will be prompted to supply a centre point for the circle. Next, you will be prompted for a radius. Simple.

There are some useful other ways to define your circle. One that is sometimes particularly useful is the TTR option, which is for drawing a circle of a given radius that is at tangents to two other objects.

Other Usage

One very useful little tactic sometimes is where you need to space out items, whatever that item may be, along a path. There are other ways of achieving this, but I find the circle method to be quite elegant and quick.

Draw a circle with your desired spacing as the radius. Begin the COPY command selecting the circle as your object to copy, and pick the centre point of the circle as your copy base point. Then, you can select the intersection between the circle and the path line as your insertion point for your new circle. Cunningly, we’re still in the middle of the copy command, and we have a new intersection to snap to as a result of the new circle we just created… snap to that intersection… then the next one… you get the idea. The notion using the COPY command in this sort of iterative way is very useful and will be discussed in greater detail when I write a post about the COPY command.

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.