26 February 2010

Ever find your blocks or xrefs are inserting in the wrong place or at the wrong scale?

It seems to be a fairly common support query we get from a number of our customers – “I’m using the AutoChart Xref Data command and my Xrefs aren’t showing in my charts”. If this has happened to you, the chances are that you’ve run into the dreaded curse of the INSUNITS variable in AutoCAD – you are not alone!

Prior to AutoCAD 2006 the setting used for this variable had little effect on most users and consequently, most people didn’t pay it any attention or even know of its existence. However, from 2006 onwards Autodesk introduced a feature to automatically scale inserts and blocks according to the value set in the INSUNITS variable. All very nice and I’m sure it’s an extremely useful function for numerous AutoCAD users, unfortunately, if you’re unaware of what it does, mixing INSUNITS between drawings can lead to problems when inserting blocks and Xrefs.

To better understand what effect the variable can have, first we can take a look at its entry in the AutoCAD Help File:


Source: AutoCAD MAP 2010 Help Documentation
So you can see there are numerous settings relating to the distance units used within a drawing. When AutoCAD is installed the default template is normally acad.dwt (or map2d.dwt for AutoCAD MAP). If you inspect the value of INSUNITS for this template (by typing ‘insunits’ at the AutoCAD command line) you’ll see (assuming it hasn’t already been changed since installation) that it is set to 1 (or, according to the table above ‘inches’).

When you insert a drawing as a block or Xref, AutoCAD uses the value set in INSUNITS to control the scaling factor of the inserted drawing. If you insert a drawing with an INSUNITS of 1 into another drawing with an INSUNITS of 1 then no scaling takes place. However, if you insert it into a drawing with an INSUNITS of 6 (i.e. metres) then it gets scaled by 25.4. Suddenly the inserted drawing is not in the correct position or at the correct scale.

We generally recommend to AutoChart users that they set up a default template (dwt) file with the appropriate INSUNITS set according to the Coordinate System they are working in. So if you are working in a metre coordinate system you would set up a dwt with an INSUNITS of 6, if you are working with a foot Coordinate system the INSUNITS would be set to 2. To make sure that AutoChart uses the correct AutoCAD template when it creates new drawings, use the File->New command to create a new drawing using the appropriate dwt file. This setting is then saved to the Registry and so whenever AutoChart runs a command that creates a new drawing, it will use the required template with the appropriate INSUNITS variable set. It’s also a good idea to set this dwt file as the Default Template for QNEW (set within the Files tab in the AutoCAD Tools->Options menu) so that whenever the QNEW icon is used to start a new drawing the INUNITS is set to the required value.

If the INSUNITS is set to 0 (unspecified) then two other variables come into play; INUNITSDEFSOURCE and INSUNITSDEFTARGET. The former controls the source units whereas the latter control the target units and using different values will also cause scaling of blocks and xrefs to take place. Unlike INSUNITS which is a drawing specific variable, INSUNITSDEFSOURCE and INSUNITSDEFTARGET are stored in the Registry.

If you NEVER mix INSUNITS then you shouldn’t run into a problem, but frequently you will end up working with drawings from different sources. If you ever run into the situation that a drawing is not inserting at the correct scale or in the correct location (particularly if you find an Xref is not showing within the charts despite it appearing in the Xref list) then generally the first place to look is for differences in the INSUNITS between drawings.

No comments: