Quantcast
Channel: MicroStation Programming Forum - Recent Threads
Viewing all articles
Browse latest Browse all 4331

[C++ Connect U14] Placing parametric cells takes long time

$
0
0

Hi

I've made some code to place parametric cells and edit the ItemType property values. I've realized that when I work with parametric cells that are just a little complex it takes quite some time.

        auto& cellHandler = ParametricCellHandler::GetInstance();
		EditElementHandle defCellEeh;
		if (ParameterStatus::Success != cellHandler.CreateCellElement(defCellEeh, *defaultInfo))
			return ERROR;

		lifalib_eehSetLvAndActiveCoWtSt(defCellEeh, levelID, false, false, false, true);

		lifalib_log("lifalib", 2, 1, "lifalib_placeParametricCellWC - Before addToModel");
		defCellEeh.AddToModel();
		lifalib_log("lifalib", 2, 1, "lifalib_placeParametricCellWC - After addToModel");
		lifalib_log("lifalib", 2, 1, "lifalib_placeParametricCellWC - Before updateItemTypes");

		std::vector<WString> params;
		std::vector<WString> values;
		if (!splitParams(strParams, strValues, params, values))
			return false;
		for (int paramIndex = 0; paramIndex < (int)params.size(); paramIndex++)
		{
			double value;
			if (swscanf(values[paramIndex].c_str(), L"%lf", &value) == 1)
				//lifalib_updateItemTypePropertyOnElm3(defCellEeh, L"LIFA", L"Rectangle", params[paramIndex].c_str(), NULL, NULL, &value, NULL);
				lifalib_updateItemTypePropertyOnElm3(defCellEeh, L"Symboler", L"Tree", params[paramIndex].c_str(), NULL, NULL, &value, NULL);
			else
				return false;
		}
		lifalib_log("lifalib", 2, 1, "lifalib_placeParametricCellWC - After updateItemTypes");

I've attached a cellibrary with 3 cells.

When I use this code with the cell "Rectangle" - (very simple) it goes quite fast - something between 2 and 3 seconds to place 10 cells.

When I use the cell "Tree" it takes about 11 seconds to place 10 cells. When I remove half of the elements in this cell (see "Tree2" the time is approx. halved.

How can that be ?

TIA, Evan

communities.bentley.com/.../ParametricSymbols.cel


Viewing all articles
Browse latest Browse all 4331

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>