NETWORKING AutoCAD Release 12


The level of networking support in AutoCAD varies from platform to platform.  On the high
end are some of the UNIX versions which provide a host of special features from machine
locking to floating licenses.  On the low end of support is the Apple Macintosh version which
provides only the minimal compliment of features.  This document will deal with the DOS
and Microsoft Windows  versions of AutoCAD Release 12 and the special considerations for
each version.

Network Features.

All versions of AutoCAD have the same functionality within the program itself (i.e the Line
command exists everywhere), but the special features of each version depend on which
operating system you are using.  All versions of AutoCAD Release 12 provide a basic service
level of network support.  This basic service level insures that each version of AutoCAD
Release 12 has the ability to function on a network and additionally to co-exist with any other
version of AutoCAD Release 12 running on any supported platform.  The DOS and Microsoft
Windows versions provide an additional level of support that simplifies administration and
lessens network resource requirements.

The basic level

The basic level of network support allows for data integrity while operating AutoCAD in a
network environment.  The basic level consists of two features, File Sharing and File
Locking.


                    File Sharing.

All of AutoCAD's files are sharable.  This allows multiple users to access the same file at
once without causing errors.  This feature is particularly useful for AutoCAD's support files
on a network.  It is possible to have a single copy of the menu, lisp, block, etc. files on the
network that can then be accessed by all AutoCAD users.  The exception to this rule is the
AutoCAD executable itself on Apple Macintosh machines.  It is not sharable.

                    File Locking.

File locking allows AutoCAD to keep tabs on who is using a particular file and what rights
they have to that file.  Every file that AutoCAD opens and that it has write access to will be
locked.  Everything from drawing files to DXF files.  AutoCAD creates two types of lock
files.  A read lockfile allows the user to open a file for read-only access.  This lock permits a
user to open a drawing for viewing, but will not allow the user to save data back to the file. 
A write lockfile allows the user to read and write data into a file while denying others
anything but read permission.

AutoCAD uses a method of file locking that is independent of the operating system.  This
allows for the proper operation of the locking mechanism across many network operating
systems and even across several hardware platforms (i.e.  AutoCAD for DOS will read, honor
and modify a lockfile created by AutoCAD for Macintosh).  This independent implementation
of file locking has however, created more than a little confusion over just what is happening
and how to troubleshoot a locking problem.  Following is a short hypothetical situation to
help explain how AutoCAD uses and manipulates file locks.


"John tells AutoCAD to open the drawing file DHOUSE.  AutoCAD first tries to create a
temporary lockfile in the directory that the drawing file exists, this file will be called
DHOUSE.DWL .  This file will disallow anyone else from accessing the drawing while John
is trying to open the drawing file.  If AutoCAD is unable to create the temporary lock file, it
reports back that the directory is read-only and only read-only access to the drawing will be
permitted, i.e. no changes to the drawing will be permitted.  If AutoCAD is able to create the
temporary lockfile it then creates the actual drawing lockfile, called DHOUSE.DWK.  This
lockfile regulates access to the drawing file.  The lockfile itself is a database that contains the
AutoCAD login name of all users accessing the file, the date and time they locked and
unlocked the file, whether they have read or write access and several other pieces of internal
information.  In this case, the drawing will be locked by John for read and write access. 
Once AutoCAD has written all of it's information into the drawing lockfile, DHOUSE.DWK,
it deletes the temporary lockfile, DHOUSE.DWL.  Other users are now able to attempt access

to the drawing file.  Each user will follow the same procedure as above except, when
AutoCAD detects the existing drawing lockfile DHOUSE.DWK, the user will be allowed
exclusively read-only access to the file, i.e. no changes will be allowed to DHOUSE.DWG. It
is important to note that the temporary lockfile will exist only during the time AutoCAD is
creating the drawing lockfile and as such the only time that this file will be seen is after a
crash or any time that AutoCAD was unable to terminate properly.  Drawing lockfiles on the
other hand exist during the entire editing session and are deleted only when the user closes
the drawing file.  When John closes the drawing file, AutoCAD backs out much the same
way it came in.  A temporary lockfile is created, the record for John's session  is checked out
of the drawing lockfile, and if there are no there entries in the drawing lockfile, it is deleted."

One note.  In the unlikely but all too possible event (particularly on large installations) that
two nodes attempt to lock a file at the exact same time, each session will back off for a
random amount of time and try again.  AutoCAD will try this twelve times before giving up.

The Enhanced Level

                    Multi-User Support.

The DOS and Microsoft Windows versions provide multiple user support in addition to the
basic level of network support.  One of the particularly nice features of AutoCAD's network
support mechanism is that it is totally network independent.  AutoCAD will install and
function on practically any network because AutoCAD itself uses the network only as an
extended DOS workstation,  essentially a big disk.

Multiple user support is the final step in special network features.  This feature allows a
single copy of AutoCAD to be licensed for multiple users.  AutoCAD then keeps track of
who is using AutoCAD and how many licenses are in use or available.  Multiple user support
allows a single copy of AutoCAD to be installed on a server and used by any capable
workstation on the net.  No files need to be kept on the workstation itself, although if
possible it is preferable to have some local disk space for certain files to improve
performance.

When AutoCAD is installed on a network, it creates a "password file" to keep track of the
maximum number of allowable sessions and which session is in use by whom (in actuality
this password file is created on a single user install but it contains only one allowable
session).  The password file is actually a database file that contains a record for each
allowable session and each record contains several fields that include the AutoCAD login
name, the date and time the session was checked out and several additional fields for data
required by AutoCAD's internal operation.

When you install AutoCAD in a network environment, you are presented with two options for
controlling the password file.  You can tell AutoCAD that it is in a read-only directory and
provide a second directory for the writeable password file, or you can tell AutoCAD that it is
not installed in a read-only directory and have the password file written into the main
AutoCAD program directory.  When installing AutoCAD in the latter option, the AutoCAD
program directory must be left as writeable by all those who will be using AutoCAD.  It is
strongly recommended that AutoCAD be configured for a read-only environment and that the
files be marked as read-only.  A common mistake arises from configuring AutoCAD as
read-only but not marking the files as read-only.

By configuring and setting up AutoCAD as read-only, AutoCAD actually creates two
password files.  It first creates a password file in the main AutoCAD directory.  This file is
merely a pointer to the writeable password file in the second directory.  The second password
file is the actual password database file.  This file is where the actual logging in and out takes
place.  When AutoCAD is run as read-only, only the second password file is subject to file
locking and the lockfile mechanism for the remainder of the AutoCAD program and support
files is effectively bypassed, thus eliminating a significant amount of network traffic as well
as the possibility of lockfile collisions on all but the drawing files.

AutoCAD for DOS: A sample network installation.

Installing AutoCAD for DOS on a network is very simple and varies little from a single user 
installation.  The basic steps below illustrate a sample network installation on a Novell
Netware 3.11 network ( The steps are generic to any network, but the commands are specific
to Netware).  

A common mistake during network installation is to mis-judge the permissions required by an
application.  AutoCAD has two levels of required permissions.  When running AutoCAD in a
read-only environment, the only permissions allowed should be Read and File-Scan.  When
running without any read-only restrictions, AutoCAD requires Read, Write, Create, Erase,
Modify, and File-Scan rights.  Granting only Write and Modify rights without Erase rights
will cause lockfile and autosave errors.  Because of the improved performance when
AutoCAD is installed as read-only, and the fact that the installation for a non-read-only setup
is virtually identical to a single user setup, this document covers a read-only installation. 
 
1.   Login as Supervisor or an equivalent.

2.   Create a directory somewhere on the server where all AutoCAD users have Read,
     Write, Create, Erase, Modify and File-Scan rights.  This directory will be where you
     tell AutoCAD to put the multi-user password file.

               MD F:\PWDS

3.   Install AutoCAD into a directory on the server using the install program.  This
     directory should have only Read and File-Scan rights for any AutoCAD user.

               A:INSTALL

4.   If possible, create a directory on each workstation for temporary and swap files,    
     otherwise create a directory somewhere on the server for each workstation to place   
     these files.  If the directory is made on the server, it MUST have Read, Write, Create,     

 
     Erase, Modify, and File-Scan rights for that workstation.

               MD C:\ACAD_TMP


5.   If possible, create a directory on each workstation for the configuration file, otherwise
     create a directory on the server for each workstation.  If the directory is made on the
     server, it MUST have Read, Write, Create, Erase, Modify, and File-Scan rights for that
     workstation.

               MD C:\ACAD_CFG

6.   Change to the directory where you have installed AutoCAD and configure          
     AutoCAD's Phar-Lap switches to include the 16bit application protection switch and to
     allow the addition of custom switches that will be set using an environment variable      
     called ACAD386.

               CFIG386 ACAD.EXE -SAVEREGS %ACAD386

7.   Create the AutoCAD startup batch file in the SYS:PUBLIC directory, or any directory
     that will be in the path when your AutoCAD users login to the network.  The batch
     file should include the lines in the sample batch file below.    
     
     NETR12.BAT:

     @echo off
     set acad={acaddir}\support;{acaddir}\fonts
     set acadcfg=(The configuration directory)
     set svadicfg=(The configuration directory)
     set avecfg=(The configuration directory)
     set acaddrv={acaddir}\drv
     set acadplcmd=spool %%c %%s (more on this later)
     set acad386=-swapdir ( The temporary file directory)
     set avepagedir=( The temporary file directory)
     set avefacedir=( The temporary file directory)
     set acadpagedir=( The temporary file directory)
     {acaddir}\acad %1 %2
     set acad=
     set acadcfg=
     set avecfg=
     set svadicfg=
     set acaddrv=
     set acadplcmd=
     set acad386=
     set acadpagedir=
     set avepagedir=
     set avefacedir=

     *Detailed explanations of each variable are in the AutoCAD Installation Guide and    
     README.DOC file.  Note that when dealing with a network installation the
     acadpagedir variable and acad386 variable MUST be set to properly direct AutoCAD's
     temporary files to a directory where the user has sufficient rights to create and erase
     files.

8.   Start AutoCAD using the netr12.bat file.

               NETR12

9.   Configure AutoCAD for the appropriate peripheral devices (i.e. digitizers and plotters).


10.  When AutoCAD asks for the authorization code enter your code.  When asked if you     
     want to run AutoCAD from a read-only directory respond YES.  AutoCAD will then
     ask for the directory where you want to install the Read-Writeable password file. 
     Enter the directory that you created in step 2.

               F:\PWDS

11.  Go to the Configure operating parameters menu.

12.  Configure the autosave filename to be a unique name for each workstation.  Using the    

     
     workstation number makes identifying the autosave files much easier.

               ENG_WS1

13.  Set the placement of temporary files to the directory that you have set the acadpagedir
     environment variable to.

               C:\ACAD_TMP

14.  Set the default plotfile name to AUTOSPOOL.  (This step only needs to be done if
     you intend to use a network printing device)

15.  Set the default plotfile directory to the same directory specified by the acadpagedir     
     environment variable.

               C:\ACAD_TMP

16.  Set the login name to a name unique for this workstation.  Usually this should be set
     to the workstation number or name to assist in debugging lockup and crash problems.

               Engineering_WS1_3rdFloor

17.  Set the network node name to a unique value for each workstation.  This selection    
     controls the extension of any plot files that you may create while spooling to a network
     device.  It is helpful to give the workstation number as the node name.

               WS1

18.  Save your changes to the configuration, and verify the proper operation of AutoCAD.

19.  Exit AutoCAD, change into the AutoCAD program directory and mark all files,
     including those in sub-directories as sharable.

               FLAG *.* RoSA /SUB /C

At this point, AutoCAD is installed and configured for the workstation that you are working
on.  To complete the network installation, you must repeat steps 4, 5, 8, 9 and 12 - 18 for
each additional workstation that will be running AutoCAD from the network.


Microsoft Windows Installation

The Windows installation is similar to the DOS installation other than the following items.

1.   No modification to the AutoCAD executable is necessary to redirect any swap files.    
     Windows handles virtual memory management on it's own so AutoCAD does not need
     to be told anything about swap files.

2.   The AutoCAD environment variables can be set from DOS, the command line, or
     from the preferences dialogue box.  AutoCAD will look first for any command line
     options, then for a preferences file and finally for any DOS environment variables.

3.   AutoCAD's temporary files must be redirected from the operating parameters menu in      
     the configuration menu.  AutoCAD will not redirect all of it's temporary files by
     setting only the options in the preferences dialogue box.

4.   Microsoft Windows version 3.0 will not properly display the "." and ".." entries on the
     file dialogue boxes unless a line is added to the shell.cfg or net.cfg file in the directory
     where the net(X).com or net(x).exe Netware shell is run from.  Add the following line
     to the beginning of the file.

               Show Dots = On

5.   AutoCAD Release 12 for Windows (R12c1c) does not include the extended options for
     autospooling plot files.  Only the %s option for the spool file name is provided.

If using Windows itself across the network, you can expect a significant speed problem while
running AutoCAD unless the Windows swap file is re-directed local to the workstation.  In
this configuration however, program, drawing and support file load times will be noticeably
slower than when running Windows and AutoCAD locally.

Microsoft Windows NT 3.1 Installation

AutoCAD Release 12 (R12c1c) for Windows 3.1 will run successfully under Windows NT,
however it has not been run through a quality assurance test suite to check for any problems. 
AutoCAD R12 for Windows is, therefore not officially supported under Windows NT.  There
are several known problems installing and running AutoCAD R12 for Windows under
Windows NT, however there are acceptable work-arounds for most of these problems to date.

1.   To install AutoCAD R12 for Windows under Windows NT, you must double click on
     the setup file setup.exe from the File Manager.  Selecting File/Run from the Program      
     Manager will result in a "File Not Found" error.

2.   AutoCAD cannot use the "GDI Bypass" feature in the display configuration.  This
     option must be disabled in order for AutoCAD to function properly.

3.   Microsoft Windows NT will not allow an application to print to a re-directed network      
     printer using LPT ports (i.e. printing to a file named LPT1:).  If you have a network     
     printer and wish to plot data to it, you must configure a system printer and have    
     AutoCAD plot to the system printer.  LPT ports are only accessible for devices that
     are physically connected to the local LPT port.

4.   AutoCAD digitizers will properly operate under Windows NT.  Mole mode support for
     AutoCAD digitizers is however, not available under Windows NT.


Network Printing

With the advent of AutoCAD 386 Release 12c2, there were several changes made to the way
AutoCAD outputs it's plot information. These changes allow for a seamless interface to your
network print devices.  These changes allow AutoCAD to automatically access a different
network output device for each configured plotter (up to 29).

By default, AutoCAD usually outputs it's data to the hardware port on your machine (i.e.
COM1: or LPT1:).  AutoCAD has the ability however, to output it's data to a file. 
Additionally the autospooling mechanism allows AutoCAD to perform virtually any system
level action on that file once it is created, all without user intervention.

When AutoCAD is configured for autospooling, it does several things.

1.   AutoCAD will plot to a file in the directory specified during configuration.

2.   AutoCAD will then execute the command specified by the ACADPLCMD
environment  variable.  At this point, AutoCAD also makes available several optional
parameters that can be passed to the operating system level.  These variables are
listed below.

     %p   The plotter number as specified in AutoCAD.
     %c   The plotter description as specified in AutoCAD.
     %m   The plotter model as listed in driver configuration.
     %n   The plotter name as listed in driver configuration.
     %d   The full path including name and extension to the drawing file that is being    
          plotted.
     %s   The full path including name and extension of the plot file that was created.
     %w   The plotted width of the drawing.
     %h   The plotted height of the drawing.
     %l   The AutoCAD login name of the person plotting the file.
     %e   The equal sign (=)
     %%   The percent sign (%)


     AutoCAD Release 12c2 for DOS supports the ACADPLCMD variables listed above.      

  
Currently Release 12c1c for Windows only supports the %s option.  

     If you are using Release 12 for DOS on a network, with the use of these variables it is
possible to make a batch file that could parse the information and send plots to specific
printers or plotters based on file type, size, user name or any number of  methods.  

     The batch file below is a fairly simple and common network plotting setup.  This file     
assumes that AutoCAD is configured for an HP Laserjet III called LaserJet_III, an HP          
DraftPro called DraftPro_A and an Apple Laserwriter IINtx called Apple_PS and that      
AutoCAD was initially started using the batch file described in the installation section of    
this document.  It also assumes that you have network queues called HP_LASER_III,    
HP_DRAFTPRO_A and APPLE_PS.   

     SPOOL.BAT
     
     @echo off
     if %1 == DraftPro_A goto DP
     if %1 == Apple_PS goto PS
     if %1 == LaserJet_III goto LJ
     goto ERROR
     :DP
     nprint %2 /s=print_server /q=hp_draftpro_a /nt /nb /nff > nul
     del %2
     goto END
     :PS
     nprint %2 /s=print_server /q=apple_ps /nt /nb /nff > nul
     del %2
     goto END
     :LJ
     nprint %2 /s=print_server /q=hp_laser_iii /nt /nb /nff > nul
     del %2
     goto END
     :ERROR
     cls
     echo   There has been an invalid printer specified.  Call your system admin.
     echo ^G
     pause
     goto END
     :END

     Using the batch file above and the system configuration specified earlier, when
AutoCAD runs the command specified by ACADPLCMD=spool %%c  %%s  it expands
the whole command out to be:

               spool LaserJet_III c:\acad_tmp\v051d433.ws1.

     A properly implemented batch file will allow effective network plotting and
accounting without any user intervention at all.



Troubleshooting.

In general most network AutoCAD installations go without incident.  However several
patterns of common mistakes have become evident.  With careful attention and a little
pre-planning these problems can be overcome quickly and easily.

Permissions.
The single most common error that you will likely run across will somehow be related to
permissions.  Quite a few network administrators have incorrectly judged the necessary
permissions for an AutoCAD installation and caused needless hours of troubleshooting.  It is
STRONGLY recommended that AutoCAD be installed into a directory where AutoCAD users
have read-only rights.  This will prevent any accidental sharing, lockfile, and file deletion
errors.  Only the drawing files that a particular draftsman is working on need be writeable.

Initial Setup.
One point that is not sufficiently documented in the Installation Guide is that some initial
non-installation setup is required by the supervisor before locking up the file permissions.  As
shipped, AutoCAD does not have a compiled menu or help index.  During the initial
installation process, the administrator should start AutoCAD, verify it's operation, compile any
menu files that will be used and bring up the help dialogue to compile the index.

Plotting.
It is often easier to troubleshoot an autospool batch file from DOS than starting AutoCAD
each time to test your modifications.  As a time saver, you can create a plot file in AutoCAD
but not use autospool as it's name.  To test your autospool batch file, you can manually feed
it the information AutoCAD would normally supply until you think you have it right, then
you could start AutoCAD to run the tests.

Sharing Violations.
Here are a few things  that vastly reduce or eliminate the problem.  1. Make sure that each
workstation on the network that will be using AutoCAD has DOS share loaded.  2. When
AutoCAD is run as a  read-only application, many people have reported that the problems
have gone away. 3. The /R and /F parameters for Share.exe may need to be increased (see
your DOS manual for details).

Password File Corruption.
It is an unfortunate side-effect of allowing many users to have total access to the password
file that corruption can and will happen.  As a time and sanity saving technique, it is a good
idea to make a backup of the password file after installing and configuring AutoCAD for the
first time.  In the event of a password file corruption this file can simply overwrite the
corrupted file and business can resume.  A majority of password corruption problems actually
arise from a rogue lockfile left in the password directory.  Should this error occur, the rogue
lockfile can be viewed to determine which workstation is leaving behind files and that
workstation can be investigated to determine the cause of it's lockfile errors.

Some common messages and solutions to errors involving acad.pwd are:

1)   "Waiting for ACAD.PWD file" or "Unable to read ACAD.PWD"

This message occurs when two or more AutoCAD sessions attempt to access the ACAD.PWD
file simultaneously.  Normally this message appears only until the first session releases the
password file.  However, if that session terminates while the password file is open, the
AutoCAD file locking mechanism (protecting the password file) may not be released.  When
this happens subsequent accesses of the password file will fail.

To recover from a locked ACAD.PWD file: First have all users exit AutoCAD. Next, erase
the file ACAD.PWD, and also erase the associated lock  files: ACAD.PWK and ACAD.PWL
(which should be located in the same directory as ACAD.PWD) if they exist.  If only one
lock file is present, erase it. Finally, start one session of AutoCAD, and configure when 
prompted.  The password file will be restored once AutoCAD is reconfigured.

To facilitate this process in the future, make a copy of the newly  created  ACAD.PWD file
and store it in a safe place.  If you encounter this problem again, have everyone exit
AutoCAD, then copy the saved ACAD.PWD file over the existing one.

2)   "Login Failed:  The maximum number of users has been reached"

This message indicates that all AutoCAD licenses are in use.  Normally licenses become
available as AutoCAD sessions are exited.  However, if a session crashes or if a customer
turns off his computer without first exiting AutoCAD, the license may become locked.  If this
happens, re-enter and correctly exit from it on the station which was exited improperly.  If
this does not release the license, a new password file must be created by following the steps
under "To recover from a locked ACAD.PWD file" in number 1) above.

3)   "ACAD.PWD is missing or unreadable"

This error message indicates that the password file was somehow  corrupted or deleted. When
this message occurs, you will automatically be prompted to configure AutoCAD.  If there is
still a problem after configuring, a new password file must be created by following the steps
explained under "To recover from a locked ACAD.PWD file" in number 1) above.

A note to Netware users.

If you run AutoCAD on a Novell Netware network and you experience erratic lockfile errors
or password file corruption, check the Minimum Packet Receive Buffers setting on your file
server.  AutoCAD has the ability to easily overwhelm the default setting for this value and
thus create network traffic errors.  Set the value to a higher number until no "No ECB
Available" errors remain.

Anomalous Behavior.

Several AutoCAD installations have reported that their workstations have been locked out of
AutoCAD or been unable to load any menu files because each time they start AutoCAD it
would try to re-compile the read-only network menu files.  Ordinarily AutoCAD will only
re-compile a menu if the source menu file has a newer modification date than the compiled
menu file.  On these installations, the workstations did not synchronize their clocks, so each
machine would have a different idea of what date and time it was.  Once the clocks were
synchronized, the problem went away.