Hi
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; mdlDialog_dmsgsPrint((*iter).GetDisplayLabel()); if (wcsicmp((*iter).GetDisplayLabel(), L"Radius1") == 0) { ECObjectsStatus rc = def->SetValue((*iter).GetAccessString(), ECValue(43.0)); char msg[80]; sprintf(msg, "rc = %d", rc); mdlDialog_dmsgsPrintA(msg); } } def->WriteValues();
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 ?
TIA
Regards, Evan
Hi Evan,
As per current sample code available with us; there is no means to address the mentioned scenario by using API.
We have reported Defect 945501: [Community][Microstation Forum]SDK sample for creating parametric cell programmatically to track the issue and soon come up with the solution.
I appreciate your patience,
Regards,
Abhijit
[RH-20220323-UPDATE: MicroStation CONNECT Edition SDK Update 13 added: ..\examples\Elements\ManagedParametricCellPlacementExample to resolve Defect 945501]