Identifying System Variable Differences

I’ve often been in a situation where a certain command or entity seems to behave differently in one drawing compared to another. Things such as how drawing units are handled are controlled on a drawing by drawing basis, by saving system variables in the drawing. With this in mind, it can be very useful to try to reverse engineer the differences between two drawings, so that you can identify what the offending system variables might be. Identifying these variables and tracking down the root cause to our problems is fundamental to attaining a good grasp of AutoCAD®, so that we will know how to tackle similar problems in future.

I’ve invented a neat way of tracking down the differences between two (or more) drawings, and it’s using an express tool called SYSVDLG. You can also access this command from the Express Tools ribbon tab, in the Tools section. Once you’ve started the command you’ll be presented with this:

sysvdlg

This screen allows you to edit the values saved in system variables. This is great functionality, but for the purposes of our comparison between drawings we are after the “Save All” option. This option exports all system variables to a SVF file.

The SVF file is simply a text file that contains the variable name followed by its value. Although it’s not a native format to Excel, we can still open it using Excel and it will be opened with the data populated in the first column of the spreadsheet. You can simply repeat this export process for any other drawings you want to compare against, and just copy and paste the columns into the same spreadsheet like so:

sysvdlg_excel

Now that you have the two (or more) columns side by side, you can enter a simple formula to compare the columns. As shown above, we are just using a simple IF statement in excel to check the values of the cells, and if they’re not equal to each other then display the text “!! DIFFERENT !!”, otherwise display nothing. This is a very quick way of identifying differences that may not be immediately obvious when skimming down.

I hope you find this tip as useful as I have in the past – I’ve lost count of the number of times that I’ve been caught out by an obscure system variable that I didn’t even know existed, which was for some reason changed in a drawing that I’d inherited from someone else !

If you found this tip useful please do consider subscribing below, and if you have a tip you’d like to share, let me know!

Will

 

The SKETCH Command – Drawing Freehand in AutoCAD

The SKETCH command is one of those little known commands, but it really is a great command when you have the opportunity for some artistic license in your AutoCAD® drawings. You know when you have an irregular line to draw that represents existing ground level, or some other arbitrary uneven surface? For this kind of thing, it’s a great command to use. SKETCH allows you to draw geometry, freehand, in AutoCAD®. You simple click a start point, move the mouse in any direction, and the path your mouse follows will be drawn into AutoCAD®. You’ll probably end up thinking you’re in MS Paint, and I defy anyone to not scribble all over the screen when testing it out… !

Normal Usage

To begin the command, input SKETCH into the command line. You will be prompted for a start point, or [Type/Increment/toLerance]. If you want to just get stuck in, pick a point, do your scribble (heh), and then pick your final point. This will terminate that line, but the command will continue. You can then pick another point and repeat the process. If you prefer, you can actually click and drag to draw one sketch, which does make it somewhat easier to draw one sketch after another. To complete the command, press spacebar or enter or whatever method you usually use to complete a command. It should be noted that if you exit the command at this point (i.e. press escape), your lines will be deleted. This one trips me up quite often, because this is different to how the PLINE command works for example.

Command Options

After invoking the SKETCH command you are prompted for a point or [Type/Increment/toLerance]. These settings are very useful for ensuring the SKETCH command behaves in the way that we want.

Pressing T for the type option allows you to change what is created with your sketch. By default, this is set to draw lines, which frankly speaking I think is just stupid. If you want to fill up your drawing with tiny little individual lines then this is the perfect option for you… I tend to use polylines personally, as I like to keep my geometry logically grouped depending on what they are. So if it represents existing ground level for example, that’s one logical entity, therefore it should be one actual entity in AutoCAD®. The other option for the type is to draw splines. I have personally not used this one much (as I’m not a fan of splines in general), but it’s there if you want to use it.

Pressing I for the increment option allows you to specify a minimum length of a segment in your sketch. This is really useful where you want a certain level of coarseness in your sketch, which I often like to see. It is also great for reducing the total number of segments you actually produce with this command.

Finally, pressing L for the tolerance option refers only to splined sketches – it controls how closely a spline follows the path drawn.

System Variables

The SKPOLY system variable is where your setting for the type is actually saved. This system variable is saved in the drawing, which can be somewhat annoying if you’d prefer it was always set to polyline by default. But there is of course a work around as always.

As with all drawing-saved system variables such as this, you can edit acaddoc.lsp so that each time you open a drawing, your system variables are set automatically. Input the following into your acaddoc.lsp file, found in your support directory:

(setvar “SKPOLY” 1)

This will ensure that the SKETCH command will be set up to drawing polylines in all drawings.

The SKETCHINC and SKTOLERANCE system variables do the same for the increment and tolerance options respectively. You can of course edit the lisp code above for those two system variables too, should you need to.

Final Notes

As you can imagine, the SKETCH command can potentially add a lot of geometry to your drawing. Be mindful of how much information you’re putting in, and how much is actually required. If you’re just drawing an indicative line for example, it hardly needs to be drawn with the increment set to 0.0000001… and doing so will add significant bloat to your drawing. I tend to ensure that there is a slight pause between each point when drawing the line – that way I am actually thinking about the points I’m adding to the line, which means there can’t be (much) more than required.

Hope this helps you all, and happy doodling!

Will

P.s. for all you newcomers, please subscribe below!

AutoCAD® – The LAYERDLGMODE System Variable

I’m not one that likes to scroll horizontally – so my layer dialog box fills the whole screen so that I can see all the layer names and all the properties of the layer. Not surprising then that I’m not fond of the new(ish) palette version of the layer dialog box, as docking it anywhere isn’t totally practical. Also, having it docked to the screen means it needs to be kept up to date so you are working from up to date information. Therefore, docking it to the screen adds more overhead to AutoCAD® – something I try to minimise as much as I can.

So, if like me you want to revert back to the old layer dialog, you need to set LAYERDLGMODE to 0. Setting it to 1 will use the palette version.

Will

AutoCAD® – The TASKBAR System Variable

When I first started using AutoCAD®, I was never a fan of having more than one drawing open at a time, because flipping between them was cumbersome. I’d have to go to the menu bar and select the Window drop-down, and then pick the drawing I want to activate. I’d have much preferred them to all be accessible directly from windows in the taskbar. So, I was overjoyed when I discovered the TASKBAR system variable!

If you’ve not encountered this before, you’ll love it – it makes working with multiple drawings so much easier. Set TASKBAR to 1 and all of your drawings will earn their own little button on the windows taskbar. You can identify and switch to any drawing you have open by simply clicking it on the taskbar. Additionally, you can immediately see at a glance how many drawings you have open, which is sometimes a useful way to be reminded to close them to conserve PC resources.

Try it out – if you’re anything like me you’ll like it.

Will

FILEDIA System Variable

Quick one for today – the system variable FILEDIA.

I remember on more than one occasion when learning AutoCAD® tearing my hair out wondering why my SAVE dialog box had vanished, forcing me to input paths to the command line. Very frustrating… so this system variable can be a sanity-saver to know.

The default behaviour is determined by the FILEDIA system variable. Set it to 0 to hide dialog boxes, and 1 to display.

One of my subscribers Chris Thron got in touch with an excellent addition to this post. Although his comment is still below where you’d expect comments to be, I though it would be useful to include it in the main body of this post to make sure it is not missed:

“If you find this happens you need to open a drawing or template to activate the FILEDIA command so you have to input the path name at least once. To get round this on the path prompt enter “~” “enter” (tidle) and it open the dialog box”

Sanity saved.

Will

VISRETAIN – Xrefs not saving layer states

Chances are you have already come across this problem, and chances are you found out the solution. But this one can be a real puzzler and is too vital to omit.

Have you ever xreffed in a drawing, made lots of tweaks to the layer properties of the xref, only to find that after closing and reopening the drawing all your tweaks were lost!?

Well, there’s a system variable called VISRETAIN, which controls this behaviour.

Setting to VISRETAIN to 0:
The layer table, as stored in the reference drawing (xref), takes precedence. Changes made to xref-dependent layers in the current drawing are valid in the current session only and are not saved with the drawing. When the current drawing is reopened, the layer table is reloaded from the reference drawing, and the current drawing reflects all of those layer property settings.

Setting VISRETAIN to 1:
Xref-dependent layer changes made in the current drawing take precedence. Layer settings are saved with the current drawing’s layer table and persist from session to session.

I hope this helps!

Will

Image Frames and Borders

So you’ve attached your image most likely using one of the following methods:

  1. The IMAGEATTACH command
  2. Insert>Raster Image Reference
  3. Attach Image on the Xref dialog box
  4. Drag/Drop an image file from windows explorer

But now, with your image in your drawing, you’re getting a horrible border or frame around your image. Chances are a lot of you will have come across this already but for anyone that hasn’t it is fixable using the IMAGEFRAME system variable. With this set to 0, you will have no border whatsoever. Great, but with this option you can’t select the image! Setting IMAGEFRAME to 1 makes frames visible again, and you can therefore select them again. But you don’t really want to keep switching between the two all the time when working. Setting IMAGEFRAME to 2 solves the problem – the image border or frame is visible in AutoCAD®, but is hidden when printed.

Perfect!

Will

About To Regen

If you ever get the “About to Regen, Ok or Cancel” message, it can be infuriating if you do not know how to turn it off.

So, here’s how – set the REGENAUTO system variable to ON.

Will