Block Attribute Shortcut

It is an every-day task to edit the attributes of a block. I’ve always just opened up the block attribute editor by simply double-clicking on the attribute that I want to edit.

However, Julien Chevrier has informed me of a very useful shortcut, which allows you to edit the attribute outside of the normal attribute editor, as if you were just editing text. All you have to do is hold CTRL, and double click on the attribute you want to edit, and you will be able to make changes directly without opening the block attribute editor. Simple, but effective.

That’s all for today,

Will

P.S. If like Julien you have any tips you’d like to share, let me know and I’ll forward them on. Also, make sure you subscribe if you haven’t already!

CTRL Selecting Polylines

First and foremost – hello again! I’ve had a surge in subscribers over the last few months, so for all my new subscribers, welcome to HowToAutoCAD.com.

There are many reasons why lately I’ve been struggling to find time to add new content to HowToAutoCAD.com, and for that I apologise. Many of you know that I’ve just finished my BSc (Hons) Computing, and I literally graduated a few weeks ago. Six months ago I also started a new job at a software development company. The company uses a proprietary programming language, so I’ve pretty much spent the last six months getting up to speed with their software, and their development language. Very interesting, but demanding, and I’ve had little time to dedicate to my blog.

I’ve also been working on something which is on the cusp of being released to you guys – it’s really something I’m quite proud of. It’s called Hex-Script, and it is a graphical AutoCAD® Script building tool, which allows you to create code for AutoCAD® tools by using a simplistic graphical user interface. I honestly think it can save a significant amount of time and effort, and will encourage those that are reluctant to learn how to develop AutoCAD® tools (or simply are afraid of what they might break…) to get stuck in, and develop the tools that they always wanted to build. The software is starting to look pretty swanky too – I’ve posted a teaser image at the end of this post…

I’ve sifted through the mountain of comments I had left to approve – apologies to those that may have waited a while for a response, but I have now responded to you all.

🙂

Now after all of this, things are starting to settle again, and I’m getting back some time on my hands… so I’m going to post more tips for you.

And without any further ado, on with my latest tip! This one is brought to us courtesy of Julien Chevrier, who kindly got in touch to share this great tip.

CTRL Selecting Polylines

A very useful feature introduced in the latest versions of AutoCAD® is the ability to select “sub-entities”. Entities such as polylines are essentially created under the bonnet of AutoCAD® by creating multiple line entities. It just makes sense to reuse this concept, as that’s pretty much what a polyline is – a sequence of lines.

To select a sub-entity, simply hold down the CTRL key and click the part of a polyline that you’re interested in, and it will be selected. The great thing about this is you can then modify this sub-entity as if it were a normal entity, and the geometry of the polyline will be modified to suit the changes you make. So if you MOVE the line sub-entity that you selected, the lines that connect to its endpoints will move too. This is a really handy way of making tweaks to existing geometry, and opens up possibilities for editing your drawings in new and unique ways.

Julien explained that he finds it useful to shape rectangles to the right dimensions by moving polyline sub-entities, while using object tracking. Of course you are not limited to only using the MOVE command either. For example, another useful command to use is ERASE – it’s a very quick and easy way to split the polyline into two parts, removing one of the lines in the process. Often this eliminates the need to use the sometimes cumbersome BREAK command.

I hope you find this tip useful – I certainly have. Many thanks to Julien for this. If you have any tips you’d like me to share with my readers, please feel free to get in touch and I’ll review them, and pass them on.

All the best, and don’t forget to subscribe below if you haven’t already.

Will

P.S. Here’s the teaser for Hex-Script that I promised… I’ll be looking for some volunteers to test my beta release, when it’s ready… 🙂

Convert 3D Polyline to 2D Polyline

There are various polyline types in AutoCAD®, the most common of which is usually the LWPolyline (lightweight polyline). It can be confusing because the LWPolyline and the old Polyline entity used way back in the early days of AutoCAD® are both shown as a “Polyline” in the Properties window. Chances are though, unless you’re working on some nasty generated drawing, you’re probably using LWPolylines.

The third polyline type is the 3D polyline, which as the name implies is a 3D version. Both the LWPolyline and the Polyline only permit the creation of geometry on a flat plane (UCS), but the 3D polyline allows points anywhere in 3D space.

Converting between the various types therefore has obvious difficulty, because going from 3D to 2D means you’re going to have to remove some of the 3D information from the polyline, and AutoCAD® could interpret how to do this in many ways. Therefore historically there have not been native commands to convert between the polyline types.

The FLATTEN command is an option for making the polyline flat (i.e., visibly the same as before, but drawn as a 2D line on whatever UCS you’re working on). I have had troubles with FLATTEN in the past however, because I think it does some odd stuff sometimes with merging lines and approximating… so I tend to avoid it where possible.

In most cases if I wanted to convert 3D to 2D, I’d do this:

  1. Explode the 3D Polyline ( ! )
  2. Select all of the Line entities we just created
  3. Go to the properties window
  4. Set the Z elevation of the start and end points of all lines to 0 (or whatever elevation you want)
  5. Use PEDIT to join all the lines together again

And then you’re left with a nice 2D Polyline again.

If at this point you then want to convert back to a 3D Polyline again, do the following:

  1. Gather up some raw materials
  2. Use them to build a time machine
  3. Go back in time to just before you did all of the above, and tell yourself to CREATE A COPY OF THE 3D VERSION FIRST!
  4. Return to the present, and use the line that now magically exists in the drawing

Alternatively you can avoid the inconvenience of mastering the laws of the space-time continuum by planning what you’re doing before you make any irreversible changes…

🙂

That’s all for today – if you haven’t already subscribed to my blog, join the other 340 who have! Holy-moly that’s a lot of people listening to my nonesense… !

Will

Oops, I deleted it again

We’ve all deleted stuff we didn’t want to, and you probably got it back by mashing the good old CTRL+Z key combo until you’ve got back the objects you deleted. This however undoes anything you did after deleting these objects. So for example if you deleted something and then went off and did some other work, to get back the stuff you deleted you’d probably end up undoing all that work.

OOPS.

Whilst “oops” is an apt comment, I’m actually referring to the OOPS command. This will reinstate the objects removed by the last ERASE command, and is really handy in the right situation.

This one isn’t just for mistakes either. There have been many times that I’ve deliberately used OOPS – for example, if I had certain objects on top of each other I could select the top objects, erase them, move the objects underneath somewhere else, and then invoke OOPS to retrieve the deleted objects.

I hope knowing this command helps you as it has helped me!

Will

P.S. Oops, I’m accidentally going to slip in a reminder to subscribe below… 😉

XLine Find

This has happened to all of us – we get hold of (someone else’s) drawing, and their modelspace is littered with junk. Duplicate copies of the same thing all over the place, so that you can’t easily find the one shown in your viewport.

Annoying. Very.

But, there is a quick little trick I often do which saves me some messing about time. When in paperspace, double click into the viewport, and invoke the XLine command. Pick your basepoint anywhere in the viewport, and then two arbitrary, but different, points. This will have drawn two XLines in the modelspace of the drawing, which intersect nicely at the detail you’re looking at on the viewport. Now you can switch to modelspace and hone into the section you’re after.

Simple, but effective.

Will

P.S. There is a rumour going around that I have been sucked into a swirling vortex in the space-time continuum, never to be seen again. BUT, these rumour are unfounded, and I am still alive! Craaazily busy lately, but I have been working on a project for all you developers, non developers, and especially the wanna-be developers out there… I’ll keep you posted.

The SELECTSIMILAR Command

On with another quick-tip today. This is a command that it took me a while to realise how useful it truly is – SELECTSIMILAR.

One of the most fundamental tasks in AutoCAD® is creating your selection to manipulate. There are many ways to select, and generally you’ll end up windowing entities on screen.

But, you must remember that it is not the only way – sometimes you’ll have an idea for what you want to achieve, and often another command isn’t only faster, it’s more semantically correct to use, and therefore less prone to errors that you might make doing it another way.

So in cases where you have objects that are in some way similar (i.e, same layer, type, colour etc), go crazy with the SELECTSIMILAR command. You’ll grow to love it – trust me. There are many different object properties you can use to define what “similar” is. Typing “SE” for settings after invoking the SELECTSIMILAR command brings up this dialog box:

SelectSimilar Dialog Box

It is worth noting that if you’re using one of the verticals of AutoCAD® such as Civil 3D®, there are actually variants of the SELECTSIMILAR command. For example, right clicking an object and picking the “Select Similar” object actually invokes a different command, namely the AECSELECTSIMILAR command. This variant is not governed by the same settings dialog, and does not appear to have the same level of control – for this reason I personally prefer the good old fashioned SELECTSIMILAR command.

That’s all for today,

Will

P.S. please do subscribe below if you haven’t already – this site is still growing fast and there’s a lot more content to come!

 

The LAYDEL Command

Firstly, many thanks to Mark Pettitt and John Coon for their first posts on HowToAutoCAD.com. A great start to something very positive and beneficial for all.

Secondly, I have a quick-tip for today. I literally used it under 5 minutes ago and it was so useful that I just had to write a post on it immediately.

The LAYDEL command. Using this command you can literally scoop spoonfuls of additional productivity into your work (see what I did there?? hehe).

This command identifies and deletes all entities on a layer, and removes the layer. On it’s own this might not seem very special, but read on… Consider you’re working with LOADS of data… normally you’d perhaps isolate the layer, select all the entities, and delete right? Well, as discussed previously in my guide to what causes AutoCAD® to freeze or crash, this is one of them. Selecting a large number of entities invites AutoCAD® to start “preparing” things, and it is a great way to crash AutoCAD.

Because LAYDEL is a built in AutoCAD® command, it is much MUCH faster than any way of doing the same thing. It’s lightning fast – and that makes me love it ! 😀

That’s all for now,

Will

P.S. I’m going to have to do a top 10 coolest-named AutoCAD® commands… send me your nominations if you like!

Missing Setting Tab

Hello, this is my first post on HowToAutoCAD.com.  My name is John Coon.  I’ve been using AutoCAD® and AutoCAD® civil add-on products for some 25 years.   The firm I work for, Hoyle, Tanner & Associates, Inc.  works on airport construction projects along the eastern United States. I’ve worked mainly on aviation design projects for the past 20 years. I hope to post general Civil 3D® tips.

Last week while using civil 3D 2011 I somehow lost my Settings tab. Well, what I found out was that using the preview somehow makes the setting tab disappear. I’m not sure why, but to get the settings tab back type  “SETTING”. This should restore the missing settings tab.

I’ve tried to reproduce the same on my 2012 install but it doesn’t seem to happen.

John

 

 

Creating New Layers

Firstly, a note from Will:

A few days ago this post went out using the word “apostrophe”, when it should have said “comma”. In a word, oops. Give Mark a break – its a great tip, even if sometimes he confuses the names of punctuation! Also apologies if you received a duplicate email, evidently my system doesn’t like it when posts get unpublished! Now for the post…

Hello and welcome to my first post on HowToAutoCAD.com.  First things first though, I’m Mark Pettitt and I’ve been using AutoCAD® since the days of the puck and digitiser, and Windows For Workgroups as an OS!!  I’ve built a practical knowledge base using AutoCAD® creating project work mostly in the Building Services stream, helping to pull together designs for all sorts of construction projects through the years.  Radiohead, Zhandra Rhodes and the giant ‘Gherkin’ building in London all have a little bit of me somewhere in their lives.

So, my first post………

There are numerous ways to create new layers in AutoCAD®, a quick way I use quite a lot is using the comma (,) within the layer dialogue.

For example, if you want to create a new layer named slightly differently to one that already exists, in an open layer dialogue, right click on the source layer you want to copy, select the layer name text then hit CTRL + C for copy (or right click and select copy from the contextual menu):

Now, whilst the little edit box is still open on the layer text hit the comma key and another layer entry should be added directly underneath the one you have highlighted:

 

Hit CTRL + V (or again right click and select paste this time) to paste in the layer text you just copied and amend the layer name hitting APPLY or OK when finished.  What you’ll also notice is that whatever colour or lines that are set in your source layer will be copied to your newly created layer.  I find this way of creating duplicate layers handy to create layers with certain settings already defined. I also find it very quick to add lots of layers by typing in the new layer name then hitting comma instead of RETURN, which then drops your cursor to another newly inserted layer line ready for the next new layer.  Remember to hit APPLY or OK when you have finished though, otherwise all your efforts in entering lots of new layers will be lost!

So there you have it, my first entry on HowToAutoCAD.com, hope you found it useful and thanks for reading.

Mark

Using XREFs and XREF Best Practice

XREFs can be an extremely helpful tool at your disposal when used well. However when used badly they can be a nightmare. In this article I am going to go through how to use XREFs and talk about some best practice tips to get the most out of your XREFs. Also I’ll talk about some common pit-falls that often cause problems.

What is an XREF?

If it wasn’t already obvious to you, XREF stands for external reference. As such, these are drawing files that are used as external references in our drawing. Other names for XREFs include references, overlays, attachments and model files. No matter what the name, the concept is the same. The external file is inserted into the current drawing as a reference. If you want to edit the geometry of the XREF, you’ll need to open the referenced file and edit that.

Basic Usage

We can insert an XREF by simply entering XREF into the command line. This brings up the the External References dialog box. In the top left there is a button for attaching a DWG file. Click this button, and you will be prompted to select a DWG file to insert. The insertion point for the XREF will always use the coordinate 0,0 in the XREF as the base-point in a similar fashion to how blocks work.

The External References dialog lists the currently loaded XREFs and displays details for each. Here is a good place to look to find any problems with your XREFs, such as XREF paths that might have changed. You can update the XREF paths from here by overwriting the “found at” path, or by selecting the ellipsis (…) in this field and browsing to the drawing. If you seem to be unable to edit this, it is likely that the reference you are trying to edit is a nested reference. This means that the drawing is actually an XREF within another drawing, and has not been directly referenced to this drawing. In other words, it is an XREF within an XREF. If this is the case you’ll need to edit the path within the first XREF, and then refresh that XREF within the current drawing.

While the External References dialog can be convenient, for simply inserting an XREF you do not need to open this dialog. Using the XATTACH command, you can invoke the command that would be used by clicking the DWG button on the XREF dialog.

Best Practice

What to use XREFs for

XREFs should be used for content that could potentially be displayed on many drawings. Having multiple copies of the same thing is just a pain to deal with. Ok, you can copy easily enough from one drawing to the other, but you have to remember to do that every single time you make any change to either drawing. The solution is to use an XREF. Put all the information in the one drawing and insert that XREF into all the drawings that require it. Essentially, XREFs can become a kind of external modelspace for your drawings, saved in a central location. You can also logically separate aspects of the model so that each XREF has its own distinct purpose. This is a great way to add some structure to you drawings, and minimise any headaches you might face later with discrepancies between drawings.

Breaking your modelspace down into smaller XREFs is also a great way to reduce file size. I work under the premise that the bigger the drawing file size, the higher the chance that it’ll crash my PC. As such I try to keep individual drawings to below 5mb. Sometimes this is not practical, but mostly it is.

Also, be careful of surveys and other mapping information such as Ordnance Survey maps. While these are of course essential, avoid putting these directly into your drawings like the plague. These should ALWAYS be an XREF, unless you actually want AutoCAD® to crash 🙂

Attachments vs Overlays

XREFs can be inserted as two different types; an attachment or an overlay. While both may appear to achieve the same thing, there is a subtle difference between them. If you insert an XREF as an attachment, this means that any other drawings that XREF the current drawing will also show the nested XREF as well. For example, Model.dwg contains the XREF Outline.dwg as an attachment. If Drawing1.dwg then XREFs Model.dwg in, Outline.dwg will also be shown as a part of Model.dwg.

Conversely, overlays allow you to insert as many XREFs as you want, but prevents them from being nested. So in the example above, if Outline.dwg were inserted as an overlay, it would not be shown when Model.dwg is XREFed into Drawing1.dwg.

So which do you use? Well, like most things it depends what you’re doing. Generally speaking the preferred default option is to use overlays, because this prevents the possibility of having a reference loop, and is generally the more lightweight option. However, if you have much to gain from having XREFs that contain other XREFs, clearly an attachment is the way to go.

Where should XREFs be saved?

This is a good question – they have to go somewhere, and having them scattered all over the place so that you don’t know what’s what is not good at all. Generally speaking, I create a folder called xrefs, and put them all in there. I sort of consider the xrefs folder as the modelspace of all my drawings, and I treat it accordingly.

I have the luxury of working on projects that aren’t massive, so if you’re working on huge projects you’ll certainly need some other structure to accommodate the scope of the project. It would be no good having hundreds and hundreds of drawing files all saved in one folder named xrefs. For this, you’d probably have to set up zones, and subcategorise your xrefs by zone. This will have to be done on a project by project basis, and agreed with the others working on the project before starting.

Pit Falls

I’m going to kick off the pitfalls with VISRETAIN, a system variable that has been the bane of many a AutoCAD® user. It can easily catch you out as well. VISRETAIN controls how layers within XREFs behave. With VISRETAIN set to 1, the layer state of XREFs are remembered. So when you make some intricate changes to your XREF layers to ensure it plots a certain colour for example, this will be remembered. Set VISRETAIN to 0 and it’s another story – you’ll close the drawing, the layer changes you made will be lost, and you’ll have no idea it happened until you open the drawing again, and (maybe) spot the mistake. If you never ever want this to be an issue again, put this in acaddoc.lsp, which ensures VISRETAIN is set to 1 each time a drawing is opened:

(setvar “VISRETAIN” 1)

Next, I’ll talk about broken XREFs. A broken XREF is what we call an XREF with a path that no longer resolves to the .DWG file that it originally pointed to, and the file cannot be found. This is usually the result of an element of the path being renamed, such as the folder or the .DWG file itself. As noted earlier, you can update the path for the XREF from the XREF dialog, and modifying the “found at” path.

An additional problem can be to do with drive paths. Say you have an XREF that resides in W:\CAD\Projects\xrefs, but you also have a Z drive mapped such that Z:\Projects\xrefs refers to the same folder. If the XREF was originally loaded using the W:\CAD\Projects\xrefs path, then AutoCAD® usually expects the drawing to be on the W drive. This can be a temperamental issue, but I have often found that AutoCAD® will prevent you from re-loading an XREF from what appears to be another drive.

If you or someone else has renamed a folder, you’ll notice that many, if not all of your XREFs will have a broken path. Then you’re faced with the somewhat daunting task of updating all the XREF paths in your whole drawing set… For this, look into using the Reference Manager tool provided with AutoCAD® – its really useful, but I’ll save the details for another post.

The final problem is that with great power comes great responsibility! Although it is great to be able to update all your drawings in one go, equally you can screw the whole set up just as easily. BE CAREFUL. And regularly take a backup of your XREFs folder so that if you make a huge mistake, you can roll back to a previous version.

 

So there we go – XREFs. Use them, and use them wisely.

Will

P.S. Don’t forget to subscribe below – I’m nearly at 200 subscribers!