- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi Everyone
I am trying to copy elements from one sheet to another which works ok until I try and copy lines
I am finding the elements to copy like this (for text)
'get text items
Dim Collector_Text As FilteredElementCollector = New FilteredElementCollector(doc, SourceView.Id)
Dim Filter_Text As ElementClassFilter = New ElementClassFilter(GetType(TextElement))
Dim FoundElements As ICollection(Of ElementId) = Collector_Text.WherePasses(Filter_Text).ToElementIds()
Then using
ElementTransformUtils.CopyElements(sourceView, ElementsToCopy, targetView, Transform, CopyPasteOptions)
So far so good. This works fine if I store the ids of text and generic annotations.
However if I add the ids of Lines, which I find like this
'get line elements
Dim Collector_Lines As FilteredElementCollector = New FilteredElementCollector(doc, SourceView.Id).WherePasses(New ElementClassFilter(GetType(CurveElement)))
For Each e As Element In Collector_Lines
FoundElements.Add(e.Id)
Next
then I get these errors:
I have tried changing the active view to the target view but this makes no difference.
Anyone got any ideas?
Paul Collins
Solved! Go to Solution.