Description

Creates a PDF rendition of the DWG file contained within the specified object. The method assumes that only one DWG file exists within a Multi File Document (MFD) object. For Multi File Document (MFD) objects containing more than one DWG file, only the first file in the collection is processed. The generated PDF rendition is of the specified Layout.


A log file is generated if a LogIdentifier is provided, no log file is created if the LogIdentifier is Nothing. Please see Log Files for more information.


WARNING: The specified object must be in a Checked Out state


If no DWG files exists in the specified object, then an error is raised.

Syntax


Sub CreatePDFRendition(Vault As Vault, DrawingObject As ObjVer, LayoutName As String, TargetObject As ObjVer, LogIdentifier As Object)


Parameters


Name

Data Type

Description

Vault


Vault

The Vault object provided by the event handler.

DrawingObjVer


ObjVer

ObjVer of object containing a DWG file to process. This could be provided by the event handler or created dynamically using CreateObject("MFilesAPI.ObjVer"). 


LayoutName

String

Name of the Layout to render to PDF e.g. Model, Layout1


Or one of the keywords below:

<ActiveLayout> - Renders to PDF the active Layout/Model when the drawing was last saved. 

<FirstLayout> - Renders to PDF the first Layout tab (excluding Model).

TargetObjVer

ObjVer

ObjVer of the target object to receive the rendered PDF file. This could be provided by the event handler or created dynamically using CreateObject("MFilesAPI.ObjVer"). 

The target ObjVer can be the same as the DrawingObjVer or a separate object. If the target object is a Single File Document (SFD) then the rendered PDF will replace the original content. Otherwise the rendered PDF will be added to the Multi File Document (MFD) object.


LogIdentifier


String or TypedValue

Used to determine the filename of the log file. To create a log file for the current activity pass in the provided ActivityID. If this parameter is Nothing, then no log file is generated.


Return


No return value. 


Example


'create ExcitechDOCS DWG Processor object
Set dwgProcessor = GetExtensionObject("ExcitechDOCS.DWGProcessor")


'create PDF Rendition

dwgProcessor.CreatePDFRendition Vault, ObjVer, "<ActiveLayout>", ObjVer, ActivityID



The resulting log file would contain the following information:


01/01/2019 09:00:00:3701 - Create PDF Rendition

01/01/2019 09:00:00:3761 - DWG File Count: 1

01/01/2019 09:00:00:3771 - Creating ODA COM Object. (dllhost.exe)

01/01/2019 09:00:00:4371 - Call CreatePDFRendition COM method.

01/01/2019 09:00:01:1101 - Processing Object: ID 1 Version 14

01/01/2019 09:00:01:1411 - FileVer: ID 1 Version 5

01/01/2019 09:00:01:1421 - Download DWG to temp file: C:\ProgramData\Excitech Docs\DWG Processor\Temp\31dheqpl.dwg

01/01/2019 09:00:01:1871 - Open DWG file

01/01/2019 09:00:01:5512 - Repath References

01/01/2019 09:00:01:8082 - Plot Settings

----------------------------------------------------------------------------------------------------------------------------------

Plot Layout:               A1

Plot Type:                 Layout

Plot Centered:             False

Paper Rotation:            _90degrees

Paper Origin:              0.00, 0.00

Paper Size:                594.06, 841.04

Paper Units:               Millimeters

Paper Margins:             (Top): 3.17 (Left): 3.17 (Right): 3.17 (Bottom): 3.17

----------------------------------------------------------------------------------------------------------------------------------

01/01/2019 09:00:01:8152 - Exporting PDF

01/01/2019 09:00:02:0032 - Delete temp files from server

01/01/2019 09:00:02:0532 - Upload generated PDF file

01/01/2019 09:00:02:0532 - Delete temp PDF file from server

01/01/2019 09:00:02:0578 - Releasing COM object.