How can I programmatically find which field from ECClass correspond to some real EC data on object. In .Net I can use Elemennt.GetDependants() to find connected textnodes, but I don’t know how extract information that this text or some part of text is field from some EC property and and which key belongs to this field?
In old fashion way in tags is simple extract to which element is tag connected and which tag-definition from which tagset represents.
Something similar I expect with fields is it possible?
Miro
Paul Connelly said:it sounds like you will need some enhancements to the published SDK: 1. Make TextField::FindTarget() available. This returns an ECInstance from which you can obtain ECSchema+ECClass. 2. Make TextField::GetAccessor() available. This returns the property access string
it sounds like you will need some enhancements to the published SDK:
1. Make TextField::FindTarget() available. This returns an ECInstance from which you can obtain ECSchema+ECClass.
2. Make TextField::GetAccessor() available. This returns the property access string
Did those suggestions get anywhere?
Regards, Jon Summers LA Solutions
@Robert Hook,Thanks!
Hi hao huanghao,
I am not sure if you replied to this post accidentally since it is rather old. If you needed to reply to a different/correct post please feel free to do so. If I ready your need properly, consider taking a look at our CONNECT APIs > EC blogs that may be helpful.
HTH,Bob
I care more about ECProperty and ECValue than graphic element from an ECInstance.
Paul Connelly said:API enhancements...
Good suggestions!
From a TextBlock you can obtain a Caret, which is an iterator over the contents of the text block.
From a Caret, you can obtain a TextField.
Unfortunately, the published SDK is rather stingy regarding what it will allow you to do with a TextField once you've obtained one. This is in part due to backwards-compatibility with EC fields create in v8i - of particular relevance to your question, such fields do not store an ECSchema name.
So it sounds like you will need some enhancements to the published SDK:
2. Make TextField::GetAccessor() available. This returns the property access string.
If you have further requests in this area please specify them.
Miro Cecho said:is it possible to write some wrapper for .Net solution?
For sure it is ;-)
NET offers PInvoke (Platform Invoke) as a standard way how to call native code from managed. Often C++/CLI is used instead of PInvoke, because C++/CLI allows more precise implementation (especially memory and resources management) and sometimes it's more straightforward comparing to "cryptical" marshalling definition. There are also solutions that help to automate the wrapper implementation (e.g. this one).
In MicroStation SDK, there are several "mixed examples" that show how C++/CLI can be used. It does not demonstrate how to create a wrapper, but this is topics where many discussions (using both PInvoke and C++/CLI) can be found on Internet.
With regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
Yes as Jan said, I want extract information from text node which can contain more text blocks and maybe some text block is EC Field and I want know from which EC schema/class/property is this field filed. If it is not directly accessible via C# is it possible to write some wrapper for .Net solution?
If Miro can more clearly explain what they're trying to accomplish, sure.
Otherwise, look for 'TextField' in the APIs defined in TextBlock.h, and peruse the APIs defined in TextField.h.
Hi Paul,
Paul Connelly said:you can do very little with EC Fields using the C# API.
Thanks for your answer. Can be your answer interepreted in such way there is a solution when C++ is used? ... which opens a possibility e.g. to implement own wrapper using C++/CLI to access such functionality from NET.
Regards,