[Connect CPP] Place parametric cells programmaticaly


I've created some parametric cells in a celllibrary and I want to place them programmatically. I've looked into the constraint2ddemo example and I've made it work but this example 'just' places a parametric cell with predefined values from a parameterset. i would like to specify the values individually using input from the user. As a test I've made some small modifications to the exampleFunctionalCellFromDgn function:

After this line

auto defaultInfo = ParametricCellInfo::Create(status, *def, L"set1", plcModel/**pModel*/);

I've added these lines of code:

IParameterDefinitionsPtr paramDefs = def->GetParameterDefinitions();
		VirtualCollectionIterator<IParameterDefinitionsIterator> iterEnd = paramDefs->end();
		for (VirtualCollectionIterator<IParameterDefinitionsIterator> iter = paramDefs->begin(); iter != iterEnd; ++iter)
			ECValue val1;
			if (wcsicmp((*iter).GetDisplayLabel(), L"Radius1") == 0)
				ECObjectsStatus rc = def->SetValue((*iter).GetAccessString(), ECValue(43.0));
				char msg[80];
				sprintf(msg, "rc = %d", rc);

The value returned is 200730 meaning Bentley::ECN::ECOBJECTS_STATUS_UnableToSetReadOnlyProperty

Is it somehow possible to place a parametric cell and specify specify the values individually ?


Regards, Evan

Parents Reply Children
No Data