CreatePreviewFile

<< Click to Display Table of Contents >>

Navigation:  Programming Mechworks PDM > DBWCommandShell > Commands Reference > Document >

CreatePreviewFile

Description

Create a preview of the component specified

Syntax

call DBWShell("CreatePreviewFile UniqueID ImgExt [OutputFolder]")

Parameters

UniqueID

It is the unique id of the document to create an image preview of.

ImgExt

It is the type of image preview to create.
Possible values are:

BMP

JPG (or JPEG)

TIF (or TIFF)

PCX

TGA

DWG

OutputFolder

Optional. It is the folder to place created images.

Return values

@PREVIEW_FILE_PATH

It is path of the file created.

Remarks

warningThe parameter OutputFolder must not contain spaces character.
Remember to substitute them with pipe "|" ones.

Example

Suppose that document Part1.SLDPRT is located in the directory E:\TEST\ and has a configuration named CFG1. Suppose the UNIQUE_ID for this record is 100.

...

my_folder ="C:\My Test Folder\Drawings"
my_folder = replace(my_folder," ","|") 'replace spaces with | char
doc_uid = "100"
img_type = "JPG"
'with output folder specified
DBWShell("CreatePreviewFile " & doc_uid & " " & img_type & " " & my_folder)
previewFilePath = DBWResult("@PREVIEW_FILE_PATH")
DBWMsgBox "Image file created: " & previewFilePath 'the doc created is C:\My Test Folder\Drawings\Part1.SLDPRT.CFG1.JPG
'without output folder specified
DBWShell("CreatePreviewFile " & doc_uid & " " & img_type)
previewFilePath = DBWResult("@PREVIEW_FILE_PATH")
DBWMsgBox "Image file created: " & previewFilePath 'the doc created is E:\TEST\Part1.SLDPRT.CFG1.JPG
...