Navigation:  CADtools Tools > Batch Process's >

CADtools Ustn Batch Remap References

Previous pageReturn to chapter overviewNext page

The CADtools reference file remapping tool works as follows:

 

1. The remapping defintions MUST be defined in the file C:\CADtools_Ustn\vba\RefFileRemap.csv. You may need to create that directory and file.

2. The remapping definition is simply a CSV files with 2 columns, the 'Old Path' and the 'New path'.

3. The remapping can remap both particular files (i.e remap Xref-1.dgn to Xref-2.dgn) or remap all files in a particular directory (i.e. remap all files in the     backgrounds\ directory to the same filename in the Xrefs\ directory). The directory paths can be either relative directories or absolute directories.

4. The remapping can be run against a single file using the keyin vba run [CADTools_Tools]ReferenceFile.Ref_Remap_Path or against a batch of files using the 'Batch Process' tool and the 'CADtools_Ref_Remap.txt' command file. See CADtools_Ustn_Batch_Process

 

An example RefFileRemap.csv file can be copied from P:\Program Files\Oasys\CADtools_Ustn\Common\Columbus\Settings\CADtools_Ustn\Vba

 

An example RefFileRemap.csv file

 

# ReMap Reference File Paths [CADtools MicroStation],

#,

# Format CSV:,

#,

# <Orginal path> <comma> <New path>,

#,

U:\120000\123300\123345 KXRP Grip 5\4 Internal Project Data\03 Drawings\G_General\GX_test\,GX:

 

Note: that the file can include some comments where the line begins with #

A complete example

The following example shows capabilities of remapping both files and directories, as well as changing from absolute to relative paths.

The remapping file is filled out with the following information. The first column should match the information displayed in the 'File' column of the reference dialog box in Microstation (or part thereof when remapping many files in one directory).

 

Remap_Ref_Excel_example

 

Using the above remapping file, the following results are expected

 

All files in the 'triforma_sections\' folder will be remapped so they come from the folder defined by the config variable $S_TRIFORMASECTIONS (Note, the ':' added to the end of the config variable name). The name of the reference file will NOT change

 

All files in the directory J:\123456\4 Internal Project Data\03 Drawings\G_General\ will be remapped so they come from the directory '.\' (i.e the same directory as the DGN they are attached to). Again, the name of the reference will NOT change

 

The reference file xm_100.dgn will be replaced by the reference file xm_200.dgn (since no directory is given, both xm_100.dgn and xm_200.dgn must exist in the same directory as the dgn they are attached to)

 

The reference file xm_20.dgn will be replaced with a reference to the file xm_2d.dgn, which is in the directory defined by the config var $S (again note the ':' added to the end)

 

All reference attachements begining with AB that have a coresponding file in the Xrefs directory beginning with BC will be replaced. eg AB_123.dgn will be replaced with Xrefs\BC_123.dgn

 

All reference attachements with a corresponding file in the Xrefs directory will be replaced eg 123.dgn will be replaced with Xrefs\123.dgn

 

All reference attachements ending in _Rev1 that have a corresponding file in the Xrefs directory ending in Rev2 will be replaced eg 123_Rev1.dgn will be replaced with Xrefs\123_Rev2.dgn

 

 

Notes

 

When remapping files by name, you must include the filename and extension in both the old and new columns, the extension must be DWG or DGN only

 

When remapping all files in a directory, you must include the complete directory path, the remapping won't accept 'part matches'. i.e If you want to remap all the files in C:\temp\Dir1\ and C:\temp\Dir2\, then the CSV file must contain an entry for both those directories, you can't just put in an entry for C:\temp\ and expect it to work for the files in Dir1 and Dir2.

 

The tool may not be able to change reference files attached by config variable definions. i.e. To change $S:xm_200.dgn to $GX:xm_200.dgn the remapping file must contain the line

  $S:xm_200.dgn, $GX:xm_200.dgn

 

It will not work with the following remapping line:

$S:, $GX:

This means you need a remapping entry for every file where the config variable is being changed.

 


Direct link to this topic:

© 2013 Arup