TagExtractor Object

The TagExtractor object is created by the TaxExtractor component as described in TagExtractor Component.

You can create a TagExtractor object with the AMCreateObject Function as shown in the following example code.

Dim TagExtractor
Set TagExtractor = AmCreateObject("IcTagExtractor.IcTagExtractor") If TagExtractor Is Nothing Then ‘Show error message and exit Else ‘Do work here
End If ‘Close and destroy when done TagExtractor.Close Set TagExtractor = Nothing
Note:

Unlike the base VBScript objects, the TagExtractor object properties, methods, and result codes do not appear in Object Browser of the Meridian Enterprise Script Editor.

ClosedTagExtractor Object Methods

The TagExtractor object provides the following methods.

ClosedCreateHotSpotList Method

Creates hotspot bounding box data for the tags found in the current drawing that can be viewed in the AutoVue viewer.

Syntax

CreateHotSpotList() As Integer

Return Value

One of the codes listed in TagExtractor result codes.

Remarks

Hotspot data is stored in the vault separate from the drawing file.

Example

Dim ResCode
ResCode = cTagExtractor.CreateHotSpotList

ClosedOpen Method

Opens an AutoCAD or MicroStation drawing from which to extract the tags that it contains.

Syntax

Open(FileName As String) As Integer
Parameters
Name Description
FileName

Fully-qualified path of the file in the local workspace to open.

Return Value

One of the codes listed in TagExtractor Result Codes.

Example

Dim ResCode
ResCode = TagExtractor.Open(sFileName)

ClosedSetAdditionalFilter Method

Sets a path filter to search for tag proxy objects in the vault.

Syntax

SetAdditionalFilter(iFilterType As Integer, sVaultPath As String)
Parameters
Name Description

iFilterType

Specifies the filter type. The only supported type is parent folder. Always set this parameter to 1.

sVaultPath Vault path (recursive) in which to limit tag searches.

Return Value

This method returns no values.

Remarks

By default, the SyncTagReferences method searches for tags in the entire vault using the settings of the Tag document type and Tag indication property options (on the AMM Settings page in the vault configuration) and the tag number. Use this method to search for tags only in the specified vault folder (and its sub-folders) without using the Tag document type setting.

Examples

To set a filter:

TagExtractor.SetAdditionalFilter 1, sVaultPath 

To disable a filter:

TagExtractor.SetAdditionalFilter 1, Nothing

ClosedSyncTagReferences Method

Searches for tag proxy objects in the vault and creates Meridian references between them and the current drawing.

Syntax

SyncTagReferences() As Integer

Return Value

One of the codes listed in TagExtractor Result Codes.

Remarks

The direction of the references is as set in the asset management settings of the vault. The scope of the tag search can be limited by the SetAdditionalFilter method.

Example

Dim ResCode
ResCode = TagExtractor.SyncTagReferences

ClosedSaveLogToFile Method

Creates a log file that contains the results of the SyncTagReferences method.

Syntax

SaveLogToFile (sLogFile As String) As Integer
Parameters
Name Description
sLogFile

Fully-qualified path where to save the log.

Return Value

One of the codes listed in TagExtractor result codes.

Remarks

Call this method after performing the tag extraction with the SyncTagReferences method.

Example

Dim ResCode
ResCode = TagExtractor.SaveLogToFile(sLogFile)

ClosedTagCollection Method

Returns a collection of all tags found in the current drawing.

Syntax

TagCollection(oResCode As Object) As TagCollection
Parameters
Name Description
oResCode

Result code object in which to return the result of the method.

Return Value

A collection of Tag objects.

Remarks

To get a collection of all tags with a specific tag type, use the TagExtractor.TagCollectionEx method.

Example

Dim TagCollection
Dim ResCode
Dim Tag

Set TagCollection = TagExtractor.TagCollection(ResCode)
'Iterate through the collection     
For Each Tag In TagCollection
  ‘Do work here
Next

ClosedTagCollectionEx Method

Returns a collection of all tags of the specified tag type found in the current drawing.

Syntax

TagCollectionEx(oResCode As Object, iCollectionType As Integer) As TagCollection
Parameters
Name Description
oResCode

Result code object in which to return the result of the method.

iCollectionType

Integer that represents the type of tags to find:

1 — all tags

2 — resolved tags only

3 — unresolved tags only

Return Value

A collection of Tag objects.

Remarks

To get a collection of all tags regardless of the tag type, use the TagExtractor.TagCollection method.

Example

Dim TagCollection
Dim ResCode
Dim Tag

Set TagCollection = TagExtractor.TagCollectionEx(ResCode, iCollectionType)
'Iterate through the collection     
For Each Tag In TagCollection
  ‘Do work here
Next

2021 R3