Hi, I am trying to attach data of an ECClass to an element and keep getting this exception:
Bentley.Exceptions.EnvironmentalException : CreateInstanceOnElement failed with error code: 6
This is NOT my first ECData class or schema. I have created 3 others (about 2 years ago) that work fine. 1 is ECXAttrubutes and it attached to the DgnFile, the other 2 are ECXData and are attached to Elements.
This new Schema imports successfully, but throws the exception when I try to attach to an element as follows:
DgnECInstanceEnabler instanceEnabler = DgnECManager.Manager.ObtainInstanceEnabler(ActiveDgnFile, baseDataClass); if (instanceEnabler.SupportsCreateInstanceOnElement) { StandaloneECDInstance instance = instanceEnabler.SharedWipInstance; IDgnECInstance dgnInstance = instanceEnabler.CreateInstanceOnElement(callout, instance, false); // <<-- exception is thrown HERE SetProperties(dgnInstance, bData); dgnInstance.WriteChanges();}
callout is a TextNodeElement
instance is the correct ECClass from my schema
I modeled this new Class and the import and attachment process after one of my existing ECXData classes and for whatever reason it is not working?
I have tried stripping my Class down to barebones and still I get this exception.
I feel like I'm missing something small but, unfortunately, "failed with error code: 6" is not very helpful?