BindReferences Method
Description
Binds any Xrefs in the named drawing to make them a permanent part of the drawing and no longer externally referenced files. Binding Xrefs to a drawing is also an easy way to send a drawing to reviewers. Rather than sending a master drawing plus each of the drawings it references, you can use the BindReferenecs method to merge the Xrefs into the master drawing. The DWG file is saved back as the same DWG 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.
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 BindReferences(Vault As Vault, DrawingObjVer As ObjVer, DrawingName As String, LogIdentifier As Object)
Parameters
Name |
Data Type |
Description |
Vault |
The Vault object provided by the event handler. |
|
DrawingObjVer |
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 ExcitechDOCS DWG Processor object
Set dwgProcessor = GetExtensionObject("ExcitechDOCS.DWGProcessor")
'bind References
dwgProcessor.BindReferences Vault, ObjVer, "A Drawing Name", ActivityID
The resulting log file would contain the following information:
01/01/2019 09:00:00:0390 - Bind References
01/01/2019 09:00:00:0480 - DWG File Count: 1
01/01/2019 09:00:00:0490 - Creating RealDWG COM Object. (dllhost.exe)
01/01/2019 09:00:00:3300 - Call BindReferences COM method.
01/01/2019 09:00:00:3670 - Processing Object: ID 1 Version 10
01/01/2019 09:00:00:3695 - DrawingName: A Drawing Name
01/01/2019 09:00:00:3850 - FileVer: ID 1 Version 4
01/01/2019 09:00:00:3850 - Download DWG to temp file: C:\ProgramData\Excitech Docs\DWG Processor\Temp\iucnhedn.dwg
01/01/2019 09:00:00:4110 - Open DWG file
01/01/2019 09:00:00:4770 - Repath and Bind References
01/01/2019 09:00:00:6920 - Upload updated DWG file
01/01/2019 09:00:00:7240 - Delete temp files from server
01/01/2019 09:00:00:7250 - Releasing COM object.