Xref Files Locked and Speed Increase


In the last article I wrote about how to fix what at first seemed to many to be a randomly occurring bug that in reality was nothing more than a system variable setting. In this article we shall look at another bug or feature (depending on how you look at it) in r14.

If you are like me, you like having many drawings open at once. It makes copy and pasting information between drawings easier, as well as working with X'refs easier. However, you may have noticed that if you open the file that contains the X'refs first, you cannot open the X'referenced file because windows has locked it thinking it is open. At first I figured it was a problem with Windows until I started to notice that it only happened on some machines and not others, which leads us into today's tale.

There is a new feature in r14 called Demand Loading of X'refs. Demand loading is an effort to increase the speed at which X'refs operate. Demand Loading is found under Tools - Preferences - Performance. Find the drop down box called "External reference file demand load." This can be set to Disabled, Enabled, or Enabled with Copy. This can also be adjusted with the system variable called XLOADCTL. It can be set to 0, 1 or 2. If you turn on Demand Loading (enabled or 1) and especially if you have the X'ref clipped you will see a speed increase. The problem though lies in the fact that when demand loading is enabled, AutoCAD tells windows to lock the X'referenced file. This means no one can access the file except in read-only mode. The work around to this is setting Demand Loading to "enabled with copy" or set XLOADCTL to 2. This will copy the X'referenced file to a temporary location for use, leaving the original files available to be worked on.

If you are interested in increasing the speed of you X'refs even more you may want to adjust the system variable INDEXCTL. INDEXCTL defaults to 0, however it can be set to 0, 1, 2 or 3. With the default of 0 no indexes are created when you save your file. If you change this to 1, 2 or 3 you will see a decrease in the speed of your saves but an increase in the speed of your X'refs. The reason for the slower saves is that the indexes are attached to the drawing file. There are two types of indexes, the layer index and the spatial index. The layer index lists all objects that are in your drawing and what layer they are on. The spatial index tells the file where all the objects are in 3D space. INDEXCTL=1 tells the file to save only the layer index. INDEXCTL=2 tells the file to save only the spatial index. INDEXCTL=3 tells the file to save all the information from both indexes in the file. Normally do not change this variable unless the file you are working on will be used as an X'ref. If you will use the file as an X'ref then your best choice is INDEXCTL=1 unless you plan on using the XCLIP function, in which case you should probably use INDEXCTL=3. The reason for the speed increase with INDEXCTL=1 is that when AutoCAD reads the X'ref data from the file, it will check the index to see what is on layers turned off or frozen so that the data for those objects is not loaded. For INDEXCTL=2 you get an increase because ACAD loads only the objects that are within your clipped X'ref frame based upon the spatial index. This obviously will do no good if the X'ref is not clipped. In both cases the amount of speed increase will be based upon the size of the X'ref and the amount of information that needs to be loaded.

The copyright of the article Xref Files Locked and Speed Increase in AutoCAD Design is owned by Jonathan Jonas. Permission to republish Xref Files Locked and Speed Increase in print or online must be granted by the author in writing.

Go To Page: 1 2

Articles in this Topic    Discussions in this Topic