Active view filter not working

Active view filter not working

Anonymous
Not applicable
326 Views
0 Replies
Message 1 of 1

Active view filter not working

Anonymous
Not applicable
Hi,

I have these two filters which I want to use to select elements which use
fonts (textual elements) in order to change some parameters like bold,
italic underline, etc.


[code]
Dim TheActiveDocument As Document = commandData.Application.ActiveDocument
Dim TheActiveView as ElementsView =
commandData.Application.ActiveDocument.ActiveView

' iterate the document and filter
' -------------------------------
Dim iterator As ElementIterator = TheActiveDocument.Elements
Dim TextualElements As New System.Collections.ArrayList

iterator.Reset()
While iterator.MoveNext()
If
iterator.Current.Parameter(parameterId:=Parameters.BuiltInParameter.TEXT_FONT)
IsNot Nothing Then
TextualElements.Add(iterator.Current)
End If
End While



' iterate the active view and filter
' ----------------------------------
Dim iterator As IEnumerator = TheActiveView.Elements.GetEnumerator
Dim TextualElements As New System.Collections.ArrayList

iterator.Reset()
While iterator.MoveNext()
If
iterator.Current.Parameter(parameterId:=Parameters.BuiltInParameter.TEXT_FONT)
IsNot Nothing Then
TextualElements.Add(iterator.Current)
End If
End While
[/code]

The first one is working and iterates at document level. I've build the
second one kind of by analogy with the first one. However the second one,
supposed to iterate at the active view level is not working and the
TextualElements set is always empty, although I know that there are valid
elements in the view.

Can anybody explain what am I doing wrong and how to do it ?

TIA


--
Humans are born with a wide horizon.
As time goes by, the horizon narrows and
narrows, until it becomes a point of view.
0 Likes
327 Views
0 Replies
Replies (0)