RJ:
I have tried to use"ElementEnumerator" but I encountered a Type Mismatch error.
We can't see your code, so we don't know...
- Where in your code the error occurred
- Whether it occurred at run-time or compile-time
Try using VBA's debug tools to step through your code (F8).
RJ:
I have seen this in the help file and I do not know if it really works
Here's a scan procedure that looks for dimension elements...
Sub ScanForDimensions ()
Dim oCriteria As New ElementScanCriteria
oCriteria.ExcludeAllTypes
oCriteria.IncludeType msdElementTypeDimension
Dim oDimensions As ElementEnumerator
Set oDimensions = ActiveModelReference.Scan (oCriteria)
Do While oDimensions.MoveNext
ProcessDimension oDimensions.Current.AsDimensionElement
Loop
End Sub
Sub ProcessDimension (oDimension As DimensionElement)
... do something with dimension element
Debug.Print "Dimension element ID " & DLongToString (oDimension.ID)
End Sub
The scanner is a common MicroStation programming idiom. It's used whenever you want to search a DGN model for some kinds of data. An enumerator is a common programming idiom for iterating (enumerating) a collection of objects. The ScanCriteria are a set of tests that let you filter the result of a scan. In the above example, the criteria restrict the scan results to dimension elements.