Hi guys,
I want select all elements (and only them) in a level of a referenced file.
myFilter.ExcludeAllLevels
myFilter.ExcludeAllTypes myFilter.IncludeLevel ActiveModelReference.Levels(myLevel.Name) Set myCellElement = ActiveModelReference.Attachments(ModelName).Scan(myFilter)
"myFilter.IncludeLevel ActiveModelReference.Levels(myLevel.Name)" gives an error
How can I select all elements (and only them) of a level in a reference?
Thanks and bye.
Paolo
Something like this...
Sub SelectElementsInModel (ByVal oModel As ModelReference, ByVal levelName As String) Dim oFilter As New ElementScanCriteria Dim oLevel As Level ' Following line will throw error if model does not contain specified level Set oLevel = oModel.Levels (levelName) oFilter.IncludeLevel oLevel Dim oElements ElementEnumerator Set oElements = oModel.Scan (oFilter) Do While oElements.MoveNext oModel.SelectElement oElements.Current Loop End Sub
You must obtain the Level object from the DGN model. Usage...
SelectElementsInModel ActiveModelReference, "MyLevel"
SelectElementsInModel ActiveModelReference.Attachments ("MyModel"), "MyLevel"
Regards, Jon Summers LA Solutions
Jon, you are the number ONE. Thanks a lot :-)