|
<< Click to Display Table of Contents >> Navigation: User Interface > The Browser > The Preview Window > Alternative Preview |
A parameter file called SCHEMA\ALTPREVW.TXTmay be created for defining alternative extensions and paths to be used for previewing a document.
Suppose you want to have a preview of a file for which no viewers are available, but you can have an image of the same file in another format for which Mechworks PDM has a built-in viewer: you can define an association between the old unknown file extension and the new known extension through the compilation of the ALTPREVW.TXT file.
An example of such file is the following:
;===================================================================
;
; DBWorks (C)MechWorks alternative extensions for preview definition file
;
; Format:
; 01234567890123456789012345678...
; <EXT1>
; <ALTERNATE EXT1 FOR EXT1>[,<ALTERNATE DIRECTORY 1 FOR EXT1>]
; <EXT2>
; <ALTERNATE EXT1 FOR EXT2>[,<ALTERNATE DIRECTORY 1 FOR EXT2>]
; ....
;
;===================================================================
DOC
TXT
CND
DWG,E:\cn3d\arc\dxf\
ME
DXF,M:
D
DWG,R:\GBG_TO_DWG\
XLSX
nopreview
PRZ
UseCustomTool,c:\test\MyTool.exe
In this sample:
•DOC extension → looks for a file with the same name, in the same directory of the original one, but with extension .TXT; if the file exists, it will be used for previewing the document.
•CND extension → looks for a file with the same name in the directory E:\cn3d\arc\, but with extension .DWG; if the file exists, it will be used for previewing the document.
•ME extension → looks for a file with the same name, in the same directory of the original one, but on the logical unit M: and with extension .DXF; if the file exists, it will be used for previewing the document.
•D extension → looks for a file with the same name in the directory R:\GBG_TO_DWG\, but with extension .DWG; if the file exists, it will be used for previewing the document
•XLSX extension → no preview will be provided; the default data (FILE_NAME, FILE_DIRECTORY, ID, DESCRIPTION, CREATED_BY, CREATION_DATE) will be shown instead.
•PRZ extension → the MyTool.exe custom tools will create a .BMP image beside the original .PRZ file, and such image will be shown as preview.
The CAD specific files are processed BEFORE checking for the CAD files existence, so allowing to define specific image directories from where the file previews will be taken.
Suppose you like to define a shared folder (in the example Z:\HiresPreviewFiles\) where you can add high resolution images to be used (when existing) for the preview process. You can then edit the SCHEMA\AltPrevw.txt file as follows:
...
SLDPRT
JPG,Z:\HiresPreviewFiles\
...
When displaying the Preview of a .SLDPRT file, MechworksPDM will look first in the Z:\HiresPreviewFiles\ folder, and if if a file with name <original file name>.JPG will be found, then it will be used as Preview Image for the Part
In order to allow different preview files for different configurations, Mechworks PDM looks also looks for a file with name:
<original file name> (<configuration>).JPG
and if found, it will be used as specific preview for the configuration.
For example, with the above altprevw.txt file, for Part1.SLDPRT, in configuration c2, the file lookup order is:
Z:\HiresPreviewFiles\Part1.sldprt (c2).JPG
Z:\HiresPreviewFiles\Part1.JPG
It is possible to assign special keywords as alternate extension in the AltPrevw.txt file:
•useTxtViewer: the file is previewed as it was a txt file
•useTxtViewerUnicode the file is previewed as Unicode format
SPF
useTxtViewer
MPF
useTxtViewer
LOG
useTxtViewerUnicode
It is possible to declared an Alternate Preview extension only for specific multiple extension files.
In order to declare a pattern matching alternate extension, the original extension line must begin with the start '*' character.
Suppose we need to have a JPG alternate extension only for PDF files that have their name like *.PSD.*.PDF
Then we can insert the following line in the AltPrevw.txt file:
...
*.PSD.*.PDF
JPG
...
The Alternate Extension will be used only the the pattern will be matched with the original file name.
It is possible to recursively declare multiple levels of Alternate Preview Extensions in the AltPrevw.txt file.
MYEXT
MYALTEXT
MYALTEXT
MYALTEXT2
The feature may be useful when paired with the useTxtViewer and useTxtViewerUnicode special AltPrevw extensions.
With a specific MAXSIZE parameter it is possible to avoid the preview when a certain file with the assigned extension has a size greater than the assigned value. The syntax is:
<extension>
<alternate extension>/MAXSIZE=<max size in bytes>
Limit the preview of files with extensions ".AI" when such files are larger than 1Mb
...
AI
AI/MAXSIZE=1000000
...
Starting from R20sp1.0, for generic documents only, it's possible to specify an external tool for creating a .BMP image that will be used by the PDM as static preview.
...
PRZ
UseCustomTool,c:\test\MyTool.exe
...
When click on MyFile.PRZ, the tool MyTool.exe is supposed to create a MyFile.BMP beside the original .PRZ file.
The custom tool must have as unique argument the full file name of the original file, and it must generate a .BMP file in the same folder;
Example from MSDOS prompt:
c:\test\MyTool.exe z:\myfolder\MyFile.PRZ
and the custom tool must output z:\myfolder\MyFile.BMP