DataCAD How-To's



Template and Symbol Primer:

(Click Here To Download a MS Word file of this page)

The following is the keyboard macro we currently use in our office. We feel that Multi-Scale Plotting, 3D GotoViews and Clip Cubes are so

DATACAD TEMPLATE & SYMBOL PRIMER

A "symbol" (.SYM) file contains the actual image that will be placed in your drawing. A "template" (.TPL) file is a simple TEXT file that tells DataCAD where to find the "symbols" that you want to place in your drawing. Here is the text from the 3D-BED1.TPL template file:

DataCAD template file. version 01.10.

1
4
*
sym\12-furn\bedroom\beds\twin
sym\12-furn\bedroom\beds\full
sym\12-furn\bedroom\beds\queen
sym\12-furn\bedroom\beds\king

The "DataCAD...01.10" line is the header. The "1" tells DCAD to display 1 horizontal row of boxes in, and the "4" tells DCAD to display 4 vertical columns of boxes when you turn on the template in DataCAD. The * separates the column number from the next four lines. Those four lines tell DataCAD where to find the symbols to be displayed in your drawing. The actual name of the symbol is the LAST name after the last "\" character. The .SM3 extension is not written. So the name of the first symbol is "TWIN.SYM", and it can be found in the \SYM directory, in the \12-furn\bedroom\beds\ sub-directory. Notice that the full path of the symbol does not need to be written! This template file will work if your symbols were located in either of these examples:

C:\cadstuff\dcad\sym\12-furn\bedroom\beds\twin

or

C:\dcad\sym\12-furn\bedroom\beds\twin

Writing template files with the SYM\ directory shown first is called the "Relative Path Method". The other method is called the "Absolute Path Method". The above example, written in this later method, would look something like this:

DataCAD template file. version 01.10.

1
4
*
c:\dcad\sym\12-furn\bedroom\beds\twin
c:\dcad\sym\12-furn\bedroom\beds\full
c:\dcad\sym\12-furn\bedroom\beds\queen
c:\dcad\sym\12-furn\bedroom\beds\king

There are some distinct advantages and disadvantages to both methods, and how they behave depends partly on whether you have you symbols located on a local hard drive or a network drive.
 
 

RELATIVE PATH METHOD:

All of the original DataCAD template files that come with the program are written with the "Relative Path Method." Presumably part of the reason is so that the installation program does not have to deal with writing new paths to all 146 template files, based on what drive and path the user might want their symbols in.

Using this method, in the example above the TWIN.SYM file would get saved like this:

\sym\12-furn\bedroom\beds\twin

One thing about the DOS version -- as long as your symbols are in a subdirectory called "SYM", located in the root DCAD directory, DCAD will find your symbols regardless of whether they are written via the "Relative Path" or "Absolute Path" methods. Once you place the SYM directory outside of the root DCAD directory, however, DCAD gets very touchy about how its template files are written.

What's so GOOD about using the "Relative Path Method":

1. If done properly, it allows you to freely relocate your SYM directory at will. For instance, you could move your symbols from the C:\DCAD\SYM directory to the C:\DCADWIN\SYM directory, or the S:\SYM directory (which you will probably want to do if you run DCAD on a network) you want to store your TPL and SYM directories on network drives).

2. It makes it easy to transfer and copy TPL and SYM directories to other users and computers and have them work without re-writing any of the .TPL (template) files.

3. As noted above, as long as your symbols are in a subdirectory called "SYM", located in the root DCAD directory, Relative Path and Absolute Path definitions will coexist peacefully.
 
 

What's so BAD about using the "Relative Path Method":

1. If your symbols are NOT located in the \SYM directory in the root DCAD directory (perhaps they are on a network drive like S:\SYM), mixed Relative Path and Absolute Path definitions will cause your system to go horribly wrong. This is because when a new symbol is saved, that path of that symbol is appended to the SYM PATH setting in the CONFIG program (DOS) or the PREFERENCES options (Windows). This is the path used by the AUTOPATH option in DCAD (see the end of this document for an explanation).

2. If your symbols are located in a different directory than the DCAD root \SYM directory, keeping your the Relative Path templates working properly takes a lot of user intervention. This is because DCAD does not allow you to save new symbols via the relative path method, so you will have to open the .TPL file every time you create new symbols, in order to manually delete the full path to the symbol. More on this later.

Curiously, there is one difference in the way the DOS and WINDOWS versions handle path settings in the CONFIGURATION or PREFERENCES menus for "Relative Path" templates. In DCAD DOS, as long as the \SYM directory is in the DCAD root directory, DCAD will always find that \SYM directory, even if the path in the CONFIGURATION program points to a different drive or directory. So none of these path settings would keep DCAD from finding the \SYM directory:

(Assuming DCAD is in C:\DCAD)

SYM path: C:\DCAD\SYM\

SYM path: C:\

SYM path: D:\

SYM path: C:\WINDOWS\

However, the same is not true for the Windows version of DataCAD. It is very sensitive to the path settings for the \SYM directory. In the above \sym\12-furn\bedroom\beds\twin example ONLY the following will work (in the Preferences/Options/Path Names menu):

SYM path: C:\DCAD\

If your symbols are located on drive S:\ in the SYM directory (S:\SYM), then you must have your path set to:

SYM path: S:\

So if you ever have the problem where your template windows are displayed without symbols in them, check your path settings and/or your template paths.
 
 

ABSOLUTE PATH METHOD:

The other way to save symbol locations in a template file is via the "ABSOLUTE PATH" method. This is the most consistent and foolproof method of creating and saving symbols, but becomes tedious if you need to move symbols to another path on your computer or network, or if you want to share symbols with another DCAD user. Using this method, in the example above the TWIN.SYM file might get saved like this:

c:\dcad\sym\12-furn\bedroom\beds\twin

This means DCAD will ONLY search for the TWIN.SM3 file in that specific location, and nowhere else. If you decide to change your DCAD directory name from "c:\dcad" to c:\dcadwin" (as in the example above), then you will have to rewrite ALL of your template files to make hem read:

c:\dcadwin\sym\12-furn\bedroom\beds\twin

This becomes a long and tedious process to rewrite 100, 200 or more template files. There are Windows utilities that help eliminate much of this tedium.

You might ask, "when would I ever want to rename or move my template or symbol directories?" Perhaps:

1. If you start a network in your office you will want the template and symbol directories on their own drive partitions (like S:\ and/or T:\).

2. If you want to share your symbols with consultants.

3. If you need to move or copy symbols to a computer with different template and symbol paths.
 
 

RECOMMENDATIONS FOR YOUR NEW CSI TEMPLATES:

1. If you plan to keep all your symbols and templates in the root DCAD directory (like: C:\DCAD\SYM ), then leave the Relative Paths that are installed by this Program.

2. If you are installing your templates and symbols in directories OTHER than the root DCAD directory (like C:\SYM, or S:\SYM, or T:\TPL, etc.) then you should change all the symbol paths in the .TPL files to Absolute Paths, pointing to the proper location. To do this, use the Ultra Edit program, or something similar to change them all at once.

  1. Note that this has nothing to do with the installation of the CSI symbols with this Program. These recommendations are valid even if you plan to keep the original non-CSI DCAD symbol installation.
  2. By doing this it will be even easier in the future to make mass changes to your .TPL files, since replacing by C:\SYM\... is more accurate than just SYM\, since many templates may contain names like SYM\TABL-SYM\TABLE-1.

TROUBLESHOOTING

If, when you open a template file, the template boxes appear, but there are no symbols in any of them, it is most likely because your DCAD path to the symbols does not match the path for the templates. Correct the .TPL file and reset the symbol path to rectify the problem.

  1. Open the offending .TPL file in a text editor like Windows Notepad.
  2. Make sure all the paths are either relative ( c:\dcad\sym\... ) or absolute ( sym\ ). I still suggest they all be absolute.
  3. Make sure the correct path is shown. It might have old path references.
  4. If the offending .TPL file has relative paths in it, then the probable cause of the problem is that the SYM path in the Configuration program (DOS) or Preferences menu (Windows) now has an absolute path in it. If you want to keep the symbols on a relative path in the .TPL file then go to the Configuration program or Preferences menu and change the path back to relative. Otherwise just change the path in the .TPL file to absolute. (Note that in DCAD DOS you have to QUIT DataCAD, change the path in the CONFIG.EXE program, then restart DCAD for the changes to take effect.)

KEEPING THE CSI SYMBOL DIRECTORY STRUCTURE

Now that you have all the symbols in CSI format you will want to ensure that all the new symbols you create maintain this order. This turns out to be both easy and difficult. It's easy to do, but difficult to get users to do properly and consistently. Here are the basic steps.

Let's assume our templates and symbols are located on the K:\ drive partition. We want to create a TEMPLATE by the name of TEST.TPL, and we want to place a SYMBOL in it, called FIRSTSYM.SYM. So when we are done it will look like this:

K:\DCAD\TPL\80-DETLS\TEST.TPL and

K:\DCAD\SYM\80-DETLS\TEST\FIRSTSYM.SYM

(These directions assume the DOS version of DCAD. For the Windows version simply use the Windows dialog boxes to change directories and type in new names.)
 
 

Create Template file:

1. Open the Template menu.

2. Select NewPath and scroll to and/or type the following:

3. The prompt line says: "Enter template filename:" Type: 4. The prompt line says: "Create new file?" 5. Enter more information for the new template file, or right click to end.
 
 

Create Symbol file:

1. Select SaveSymb.

2. The prompt line will display a path based on the last path used, and will ask: "Create it?"

3. If the prompt line is still asking: "Create it?" 4. Select NewPath. 5. The prompt line reads: "Enter the name of the symbol file to be saved: ". Type: 6. The prompt line will read, "Path K:\dcad\sym\80-detls does not exist. Create it?" 7. Create the symbol in the usual manner (Entity/Area, etc.)

8. The prompt line will then read, "Item name: ". Type:

9. Enter more symbol info or right click to finish.

You have now created a new template file, and saved a new symbol, while keeping the CSI format intact.
 
 

Note, however, that there is no way in DataCAD to save new template files via the Relative Path Method. In the example above the only way to do it would be to save the symbols as outlined. Then you would open the TEST.TPL file in an plain text editor (like Windows notepad) and delete all references to K:\dcad\. So:

Original .TPL line:

New .TPL line:

USING "ULTRA EDIT" TO EDIT MULTIPLE .TPL FILES AT ONCE:

There is a shareware utility called Ultra Edit that will allow you to open all of your .TPL files at one time, change all the paths in them in one fell swoop, and save them with one click. It's called Ultra Edit. With this utility it took me 10 minutes to change the paths of a little over 200 .TPL files (really!).

Ultra Edit is available for both Win3.1 and Win95/NT. You can find it at the company's web site.

Let's assume you want to change all your Relative Path template files to absolute paths. FIRST: Back up your TPL directory in case!! Then:

1. Open Ultra Edit

2. First change one configuration setting.

  1. Go to Advanced/Configuration/Backup
  2. Check "No Backup"
  3. If you don't do this then all the files you change will have .BAK files saved as well, which you will have to manually clean up later.
  4. If you want the backup file, then skip all of Step 2 and go to Step 3.
  5. Press Apply then OK
3. File/Open

4. Go to your Template directory

5. Go into each folder and open every .TPL file. You can pick multiple files in the Windows dialog box by dragging a bounding box around all the files, then pressing OPEN. This will save a lot of time.

  1. Be sure to open ALL your .TPL files at once. This is what will save you a great deal of time
6. Choose Search/Replace

7. Assuming your templates now say --> SYM\... :

  1. Find What = SYM\
  2. Replace With = S:\SYM\
8. Check "All Open Files", then select "Replace All"
  1. All your files will be changed
9. Press Cancel when finished

10. Select File/SaveAll

11. Select File/Close All Files

NOTE:

One thing to be careful of: If some of your templates already have absolute paths, like C:\DCAD\SYM\ and some have relative paths, changing all your files at once, as in the example above, will result in some text being duplicated like this:

C:\DCAD\S:\SYM\

I got around this by FIRST replacing all: C:\DCAD\SYM\ text

THEN I did the replace like in the instructions above.

Also, if a path says something like:

SYM\NEW-SYM \SINKS

you will get something that looks like:

S:\SYM\NEW-S:\SYM\SINKS

You probably won't run into too many of these, but if you do you will just have to rewrite the path correctly in a text editor
 
 

WHAT IS "AUTOPATH"?

It is a good concept gone awry. The DCAD manual says it, "appends a subdirectory, with the same name as the template file, to the symbol path that you set in the Configuration program."

But part of the problem is that every time DCAD accesses a different symbol with an absolute path (like c:\dcad\sym\lights) the Configuration program's symbol path is updated to this new path. So if you are not careful you will wind up with symbols in very different locations.

I would suggest that you do NOT use Autopath. In DCAD DOS you will see the Autopath prompt when you try to save a new symbol. In DCAD for Windows you will find Autopath in Preferences/Options/Misc/Symbol Auto Path. Make sure the box is UN-checked.