CAD Link Events

CAD link events allow you to customize the behavior of the links to the various applications that Meridian supports. These events occur when the link commands are run from within the Meridian client applications and when the link commands are run from within the linked applications.

ClosedCAD Link Event Sequences

The events that occur for the application link commands are shown in the following lists in the sequence that they occur.

ClosedSynchronize properties from file event sequence

  • DocCADLink_AfterReadMTBProperties

  • DocGenericEvent_PrepareCommand

  • DocCADLink_InitializeUpdateProperties

  • DocCADLink_BeforeUpdateProperties

  • DocCADLink_AfterReadProperty1

  • DocCADLink_AfterUpdateProperties

  • DocCADLink_TerminateUpdateProperties

Notes

  1. Once for each property.

ClosedSynchronize properties to file event sequence

  • DocCADLink_BeforeWriteMTBProperties

  • DocCADLink_InitializeUpdateProperties

  • DocCADLink_BeforeUpdateProperties

  • DocCADLink_BeforeWriteProperty1

  • DocCADLink_AfterUpdateProperties

  • DocCADLink_TerminateUpdateProperties

Notes

  1. Once for each property.

ClosedSynchronize references from file event sequence

  • DocCADLink_InitializeUpdateReferences

  • DocCADLink_BeforeUpdateReferences

  • DocCADLink_AfterUpdateReferences

  • DocCADLink_TerminateUpdateReferences

ClosedDocCADLink_AfterReadProperty Event

Occurs after a document property that is mapped to a title block attribute is read.

Syntax

DocCADLink_AfterReadProperty(Batch, PropertyName, Value)
Parameters
Name Description

Batch

An object that represents the batch of documents the user has selected.

PropertyName

A string that contains the property name that was read.

Value

The property value that was read.

Remarks

This event also occurs after a title block is read during batch import by the Document Import tool. The Document object is available during this event but is read-only.

ClosedDocCADLink_AfterReadMTBProperties Event

Occurs after a document property that is mapped to multiple title block attributes is read.

Syntax

DocCADLink_AfterReadMTBProperties (Batch, BCPropStorage)
Parameters
Name Description

Batch

An object that represents the batch of documents the user has selected.

BCPropStorage

An object that contains the property information that will be written. See BCPropStorage Object for its available properties and methods.

Example

Sub DocCADLink_AfterReadMTBProperties(Batch, BCPropStorage)
  Dim rowCollection
  Dim allColDefs
  Dim colDef
  Dim row
  Set allColDefs = BCPropStorage.GetColumnDefs(2)
  Set rowCollection = BCPropStorage.Rows

  For Each row in rowCollection
    For Each colDef In allColDefs
      If Not IsNull(row.Property(colDef.Name).Value) Then
        WinMsgBox "AfterReadMTB_Layout: " & _
          row.Property( "Layout").Value & vbCrLf & _
          "Property: " & CStr(colDef.Name) & vbCrLf & _
          "Value: " & CStr(row.Property(colDef.Name).Value)
      End If
    Next
  Next
End Sub

ClosedDocCADLink_BeforeWriteProperty Event

Occurs before a document property that is mapped to a title block attribute is written.

Syntax

DocCADLink_BeforeWriteProperty(Batch, PropertyName, Value)
Parameters
Name Description

Batch

An object that represents the batch of documents the user has selected.

PropertyName

A string that contains the property name that will be written to.

Value

The property value that will be written.

Remarks

The Document object is available during this event but is read-only.

ClosedDocCADLink_BeforeWriteMTBProperties Event

Occurs before a document property that is mapped to multiple title block attributes is written.

Syntax

DocCADLink_BeforeWriteMTBProperties (Batch, BCPropStorage)
Parameters
Name Description
Batch

An object that represents the batch of documents the user has selected.

BCPropStorage

An object that contains the property information that will be written. See BCPropStorage Object for its available properties and methods.

Example

Sub DocCADLink_BeforeWriteMTBProperties(Batch, MTBProperties)
  Document.Log "BeforeWriteMTBProperties -->"
  Dim rowCollection, allColDefs, colDef, row

  Set allColDefs = MTBProperties.GetColumnDefs(2)
  Set rowCollection = MTBProperties.Rows

  For Each row in rowCollection
    For Each colDef In allColDefs
      If Not row.Property(colDef.Name) Is Nothing Then
        Dim rv: rv = "AfterReadMTB_Layout: " & _
          row.Property("Layout").Value & vbCrLf & _
          "Property: " & CStr(colDef.Name) & vbCrLf & _
          "Value: " & CStr(row.Property(colDef.Name).Value)
        Document.Log rv
      End If
    Next
  Next
End Sub

ClosedDocCADLink_OnUpdateReference Event

Occurs when a specific reference to or from the selected documents is updated.

Syntax

DocCADLink_OnUpdateReference(Batch, RefFile, IsCreated, ToFile)
Parameters
Name Description

Batch

An object that represents the batch of documents the user has selected.

RefFile

A string that contains the name of the file that is referenced.

IsCreated

True if the reference exists, False if the reference does not yet exist.

ToFile

Set to True to update the reference information stored in the file, False to only update the references in the vault.

ClosedDocCADLink_*UpdateProperties Events

Occurs when document properties that are mapped to title block attributes are synchronized.

Syntax

DocCADLink_*UpdateProperties(Batch, ToFile)
Parameters

Name

Description

Batch

An object that represents the batch of documents the user has selected.

ToFile

Set to True to update the title block, False to only update the document properties.

ClosedDocCADLink_*UpdateReferences Events

Occur when references to and from the document are updated.

Syntax

DocCADLink_*UpdateReferences(Batch, ToFile)
Parameters
Name Description

Batch

An object that represents the batch of documents the user has selected.

ToFile

Set to True to update the reference information stored in the file, False to only update the references in the vault.

2021 R2