# cee::ug::DataElementSetBuilder

class `DataElementSetBuilder`

  Helper class for building element sets in an efficient matter.

  If you need to call DataElementSet::addItem() or DataElementSet::addItems() many times for each data element set, you can use this helper class to increase performance.

  Use the add* functions to add items to be included in the element set. After all items are added, get the complete element set using createSet(). Always use addUnique* when possible to increase performance further.

      DataElementSetBuilder builder(1);
       std::vector<size_t> elementIndices1 = { 7, 5, 16, 8 };
       std::vector<size_t> elementIndices2 = { 17, 24, 3, 9 };
       builder.addUniqueItems(1, 1, elementIndices1);
       builder.addUniqueItems(1, 1, elementIndices2);
       cee::PtrRef<DataElementSet> set = builder.createSet();

  Public Functions

  `DataElementSetBuilder`(int setId)

    Creates the element set builder.

    setId need to be unique when the element set is added to the model

  void `addItem`(const DataElementSetItem &item)

    Adds the item to the element set builder.

  void `addItems`(int geometryId, int partId, const std::vector<size_t> &elementIndices)

    Adds the items to the element set builder.

  void `addUniqueItem`(const DataElementSetItem &item)

    Adds the item to the element set builder.

    Requires unique items. Only use this if you are sure the item does not already exist in the element set.

  void `addUniqueItems`(int geometryId, int partId, const std::vector<size_t> &elementIndices)

    Adds the items to the element set builder.

    Requires unique items. Only use this if you are sure the item does not already exist in the element set.

  PtrRef<DataElementSet> `createSet`()

    Returns the complete data element set.

    Call this once after all items are added.

Conversation saved
HOOPSY BETA

### Hello! I'm HOOPSY

Your Docs generative AI assistant. Ask me anything about HOOPS Envision for Desktop or choose a sample question below to start a conversation:

What is HOOPS Envision for Desktop?
What are the latest release notes for HOOPS Envision for Desktop?
How do I start evaluating HOOPS Envision for Desktop?
How do I write my first sample application?
How can I get assistance?

HOOPSY may store conversations according to OpenAI's policy. Responses may not always be accurate.

HOOPSY is thinking...