SyncPropertiesFromMFiles Method


Description

Updates the titleblock(s) of the named DWG file in the specified object. The block names and attribute mappings are determined by the Property Mapping configuration of the vault. If the DWG file contains more than one instance of the configured block names, all matching blocks are updated. The DWG file is saved back as the same file version as the original file.


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 file with the specified Drawing Name exists, then an error is raised.

Syntax


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

DrawingName


String

The name of the DWG file to process (excluding the file extension). Use with Multi File Document (MFD) objects containing more than one DWG file.

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 DWG Processor object
Set dwgProcessor = GetExtensionObject("PentagonDOCS.DWGProcessor")


'sync properties from M-Files

dwgProcessor.SyncPropertiesFromMFiles Vault, ObjVer, "A Drawing Name", ActivityID




The resulting log file would contain the following information:


01/01/2019 09:00:00:0053 - Sync Properties from M-Files

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

01/01/2019 09:00:00:0133 - Creating RealDWG COM Object. (dllhost.exe)

01/01/2019 09:00:00:2813 - Call SyncPropertiesFromMFiles COM method.

01/01/2019 09:00:00:3633 - Processing Object: ID 1 Version 8

01/01/2019 09:00:00:3702 - DrawingName: A Drawing Name

01/01/2019 09:00:00:3783 - FileVer: ID 1 Version 3

01/01/2019 09:00:00:3783 - Download DWG to temp file: C:\ProgramData\Pentagon Docs\DWG Processor\Temp\01cnyvti.dwg

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

01/01/2019 09:00:00:4993 - Update attribute values of matching Titleblocks

01/01/2019 09:00:00:5763 - Save DWG file

01/01/2019 09:00:00:7303 - Upload updated DWG file

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

01/01/2019 09:00:00:7673 - Releasing COM object.