BlueCielo Meridian Enterprise 2018 Configuration Guide

Disabling the AutoCAD link programmatically

When creating a new vault document and immediately opening it in AutoCAD from VBScript or a custom program, the user is prompted to select a document type for the new document. This is because both actions occur within the same Meridian Enterprise transaction and the AutoCAD link is not yet aware that the document already exists in the vault. The document type selection dialog can be avoided by disabling the AutoCAD link for the document from within the custom code that opens the document. This allows the code to proceed without requiring user interaction with the AutoCAD link while leaving the link available for user-opened documents.

To clear the AutoCAD link programmatically, run the custom command DisableICLinkForDoc for the document within an AutoCAD session as shown in the following example:

On Error Resume Next

Dim objDoc
Set objDoc = objACAD.ActiveDocument
   
Let newDoc = False
If objDoc Is Nothing Then
   Set objDoc = objACAD.Documents.Add
   newDoc = True
End If
   
objDoc.SendCommand "DisableICLinkForDoc " & "<FullDocumentPath>" & vbCr
   
If newDoc Then
   objDoc.Close False
End If

On Error GoTo 0

The fully-qualified document name must be <= 1024 characters. If the name is longer, the command will be skipped. The document name must be set before the document is opened by the link. Once set, the AutoCAD link will be cleared for the specified document when it is opened and until it is cleared by custom code or the drawing is closed in AutoCAD.

To clear the document name, run the command again without specifying a document name as in the following examples:

objDoc.SendCommand "DisableICLinkForDoc " & vbCr

Or

objDoc.SendCommand "DisableICLinkForDoc" & vbCr & vbCr

The DisableICLinkForDoc command is available in the standard AutoCAD links (AmAcad****.arx and IcAsset****.arx) beginning with build 2322. The command is also available at the AutoCAD command line to be invoked manually by a user.