ElementAgenda.BuildFromElementSet (IElementSetP elementSet, ModifyElementSource source) accepts an IElementSet.
The documentation for IElementSet reveals only ways to enumerate its contents, not ways to built the set. How does one create an ElementSet? IElementSet and ElementAgenda appear to serve the same purpose: what are the pros and cons of one over the other?
Answer Verified By: Jon Summers
Unknown said:Build an IElementSet by implementing the interface on some collection of element(s)
Something like this?
struct MyCollection : IElementSet { size_t index; bvector<MyClassInheritsFromElementHandle> data; MyCollection () : index (0) {} virtual bool GetFirst (ElementHandleR eh) override { index= 0; eh = data [index]; } virtual bool GetNext (ElementHandleR eh) override { eh = data [++index]; } };
Regards, Jon Summers LA Solutions
sure, assuming some bounds-checking and return statements.
or simpler example:
struct OneElement : IElementSet { ElementHandle m_eh; size_t GetCount() override { return 1; } bool GetFirst(ElementHandleR eh) override { eh=m_eh; return true; } bool GetNext(ElementHandleR) override { return false; } };