Hi,
has anybody a nice example of XAttributes?
It is stated that the old XML API is deprecated and a could not find any example of the usage of the new API.
Regards, Stefan.
Hey Stefan,
Can you clarify what you are looking to do. There are XAttributes and there are ECXAttributes. Prefer the ECXAttributes and look to the XMLInstance api in native code or look at the ECAPI for managed code. There is a sample that demos the native code api (imodelvisitor) and at the last developer conference we demo'd the managed code api.
Regards,
mark anderson [Bentley]
Visit me at https://communities.bentley.com/communities/other_communities/bentley_innovation/default.aspx
Its the ECXAttributes I would like to use. As Bruce stated the imodelvisitor-sample is very complex, so if anyone has a good example of how to incorporate the Api in c++ code I would appreciate that.
Thanks, Stefan.
Stefan,
Do you want to read only or are you going to read and write? Here are the two source files that I refer people to. BusinessDataHandler is the read side of the equation. imodeltoolModifyTool adds data to elements.
HTH,
Have you looked at the Bentley Class Editor? The first thing you have to do is create/define your "schema" (objects and properties). Then, using the C++ API, insert the schema into the model, create an "instance" of your object/properties, then assign it to the element(s).
Bruce
I have written an simpler sample for XmlInstance usage as attached. FYI
YongAn