Unable to find what you are looking for? Click here
Hello again,
does anyone have a clue, why this method could return null?
DgnECInstanceEnablerP enabler = DgnECManager::GetManager().ObtainInstanceEnabler(*ecClass, *dgnFileP);
The below statement causes the issue "object reference not set to an instance of an object"
DgnECManager manager = DgnECManager.Manager;
Is there any specific thing that is required, along with this?
I went through the examples in the SDK,…
It's used throughout the internal API, and also in the published API (see DgnECManager::GetInstanceCounts()).
Is there something you're trying to accomplish?
IElementPropertyEnabler won't be useful to you. If you want DGN element properties, whether in native or .NET, DgnECManager is usually the place to look.
You can try to get all instances available on a specific element. And then check if the individual instance has a specific property:
//ECQueryProcessFlags flags = intrinsic or extrinsic
ECInstanceList GetElementProperties(ElementHandleCR element, ECQueryProcessFlags…
Aced2X said:I will use that in the future.
It should be possible to edit existing post as well.
Aced2X said:I am trying to add 2 new members to the schema.
It would be possible, even when it's potentially risky operation.
Aced2X said:I want it to…
I'd like to compose a query to use with DgnECManager.FindInstances using an ECQuery. Unfortunately, the MstnPlatformNet documentation continues to ignore that class. The SDK examples help little, using the catch-all SelectAllProperties.
DgnECManager.FindInstances
ECQuery
SelectAllProperties
ECQuery query…
I still have not been able to successfully attach an ItemType to anything using the ::SetElmDscrToFileFunction(). The same approach when used in a DgnElementSetTool::_OnElementModify() works fine. When inside the ::SetElmDscrToFileFunction() callback,…
Not sure if this is the correct way, but here is a solution I've come up with that adds an Item to an Element Template definition, once you have an ElementTemplateNodePtr :
pTemplate = ElementTemplateUtils::FindTemplateNodeByPath (L"MyTestGroup…
Hi Jon,
Can you take a look at:
FILE: examples\DgnEC\DgnECExample\FindInstancesOnElementForm.cs+37 FUNC: FindInstancesOnElementForm CODE: /*---------------------------------------------------------------------------------**//** * Constructor for…
This works …
DgnModelP model { ISessionMgr::GetActiveDgnModelP () }; FindInstancesScopeOption option (DgnECHostType::Model); FindInstancesScopePtr scope { FindInstancesScope::CreateScope (*model, option) }; ECQueryPtr…
John Drsek said:I need to get the ec instance of an item type instance that is attached to an element
This article about EC Queries may help. It distils tips that Paul Connelly and others have given over the years. You need to create a scope and a quer…
Thanks Jan,
this is all very helpful. i was able to get a new instance added to the sub elements. but its only for the current session of microstation. once i close and reopen the sub elements no longer have the item attached.
also im struggling with…
Hi Jon.
Thanks for the codes. Looks like the code is searching one instance on an element, and the scope is limited in specified schema.
I am using similar codes which returns ECInstances for one element,
DgnECManagerR dgnECManager = DgnECManager…
Hi Bruce,
If you only want to find a specific [ECShema:ECClass] on an element, I think it doesn't need to use WhereCriterion. Below is an example which can get [BaseElementSchema:MstnVolume] on an element.
void getVolumeByEC(WCharCP unparsed) { …
This code successfully creates a StandaloneECInstance, to which I attach some Item Type properties...
DgnElementECInstancePtr AggregateHolder::CreateInstanceAsElement (AggregateCollectionCR aggregates) { DgnElementECInstancePtr instance; DgnECManagerR…
Paul Connelly said:Create an ECInstance of AreaClass
I'm stumped. I think that I need a DgnECInstanceEnabler in order to create an ECInstance. Here's what I have so far...
if (TextPropertyManager::GetMstnPropertyFormatterSchema (formatSchema)…
Jon Summers said:What am I doing wrong?
Based on some testing, I think the problem is how you define the scope. This code works fine with your design file:
FindInstancesScope scope = FindInstancesScope.CreateScope(Session.Instance.GetActiveDgnFile…
got this from Artur Goldsweer from Bentley Support. He said to get it from the EC data.
here is some code sample he gave me.
using BD = Bentley.DgnPlatformNET; ---------------------------------…
Hi,I am trying to access the grid properties (grid lines, coordinates, orientation, etc.) of a OpenBuildings Designer model from a c# addin. I can see from the XML export that the used EC schema should be StructuralModelingComponents.06.00.When I ask …
I see the properties for the cell element like gasket, but unable to retrieve some through the code mentioned below. This code gives me properties of category like "Raw Data", "Extended" etc., but does not gives the category and its properties highlighted…