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

  1. DocCADLink_AfterReadMTBProperties

  2. DocGenericEvent_PrepareCommand

  3. DocCADLink_InitializeUpdateProperties

  4. DocCADLink_BeforeUpdateProperties

  5. DocCADLink_AfterReadProperty: Once for each property.

  6. DocCADLink_AfterUpdateProperties

  7. DocCADLink_TerminateUpdateProperties

ClosedSynchronize properties to file event sequence

  1. DocCADLink_BeforeWriteMTBProperties

  2. DocCADLink_InitializeUpdateProperties

  3. DocCADLink_BeforeUpdateProperties

  4. DocCADLink_BeforeWriteProperty: Once for each property.

  5. DocCADLink_AfterUpdateProperties

  6. DocCADLink_TerminateUpdateProperties

ClosedSynchronize references from file event sequence

  1. DocCADLink_InitializeUpdateReferences

  2. DocCADLink_BeforeUpdateReferences

  3. DocCADLink_AfterUpdateReferences

  4. DocCADLink_TerminateUpdateReferences

ClosedAfterReadProperty 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.

ClosedAfterReadMTBProperties 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

ClosedBeforeWriteProperty 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.

ClosedBeforeWriteMTBProperties 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

ClosedOnUpdateReference 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.

Closed*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.

Closed*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.

2024