SyncPropertiesFromMFiles Method


Description

Updates the text in a PDF based on the object's properties in M-Files. 


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 PDF files exists in the specified object, then an error is raised.

Syntax


Sub SyncPropertiesFromMFiles(Vault As Vault, DrawingObjVer 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"). 

The ObjVer is also the target for the generated PDF file. Single File Document (SFD) objects will automatically be converted to Multi File Document (MFD) objects.


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 PentagonDOCS PDF Processor object

Set pdfProcessor = GetExtensionObject("PentagonDOCS.PDFProcessor")


'Update the PDF Rendition with the current metadata values

pdfProcessor.SyncPropertiesFromMFiles Vault, ObjVer, ActivityID



The resulting log file would contain something similar to this:

Calling SyncingPropertiesFromMFiles

Processing ObjVer: {"objType":0,"id":2918,"version":66} 

Downloading file to temp: C:\ProgramData\PentagonDocs Assistant\PDF Processor\Temp\ncbejkra.pdf

Syncing property: REVISIONNUMBER value: P06.04

Syncing property: SUITABILITY DESCRIPTION value: S0 - WIP

Syncing property: CLIENT value: Gloucester County Council

Syncing property: PROJECTNUMBER value: J0933

Syncing property: PROJECTTITLE value: Chopin Music School

Syncing property: TITLE1 value: East & West Elevations

Syncing property: TITLE2 value: HELLO

Property has not changed

Calling SetTextValue

Checking attribute: TITLE2 has locations

Locations information found

Calling SetTextAtLocation

Processing page 1

Processing location #0

Search Boundaries: 2183.36369747125 295.333099373665 2270.54156795083 307.309726723519

Fontname: Helvetica

Fontsize: 11.9766273498535

Checking for missing font information

New value length: 39.2713610801697

Max wrap width: 263.271013395452

Wordwrap enabled: True

Removing existing fragments

Fragment text: HELLO WORLD

Does fragment text match a previous value: True

New Fragment xIndent: 2183.36369747125

New Fragment yIndent: 295.333099373665

New String: HELLO

Current position: 2183.36369747125 295.333099373665

Horizontal justification: Center

Center: 2207.31695217095 295.333099373665

New Search boundary: 2207.31695217095 295.333099373665 2246.58831325112 307.309726723519

Syncing property: TITLE3 value: 

Syncing property: DRAWDATE value: 11/2/2020

Syncing property: SUITABILITY value: S0

Syncing property: DRAWING_NUMBER value: J0933-EXC-ZZ-ZZ-DR-A-0004

Syncing property: DRAWBY value: SG

Syncing property: WATERMARK2 value: 

Syncing property: STATUS value: DESIGN INTENT

Syncing property: FILETYPE value: