Results

Discuss and ask questions about CADEditorX and XML API.

Moderators: admin, support, SDS

Post Reply
agvs
Posts: 30
Joined: 16 Jun 2016, 11:10

Results

Post by agvs » 14 Nov 2016, 10:14

Hello,
I have a question about result of XML.

I get 'handle value' after using 'GetAttribValue(doc,nodeL3, attInst) like below source.
My source is
string handle1 = GetAttribValue(doc, nodeL6, "Handle");//"cadsofttools/Results/Result/Output/Created";


If I add 2 objects(ex, block and text), I will get 2 handles like below result.

<?xml version="1.0" encoding="UTF-8" standalone="no"?><cadsofttools version="2.0">
<Results>
<Result Instruction="add">
<Output>
<Created Handle="$2E" Position="71,1" />
<Created Handle="$2F" Position="167,1" />
</Output>
</Result>
<Result Instruction="invalidate" />
</Results></cadsofttools>

Then, How to get each handle of 2 objects as C# source?
(I tried to to
string handle2 = GetAttribValue(doc, nodeL7, "Handle");//"cadsofttools/Results/Result/Output/Created/Created";
but, I couldn't get second handle value.)
Let me know, please.

support
Posts: 2811
Joined: 30 Mar 2005, 11:36
Contact:

Re: Results

Post by support » 14 Nov 2016, 16:37

Hello,
Please, try using the following C# code to get each object handle:

Code: Select all

List<UInt64> res = new List<UInt64>();
XmlNode data = GetDocumentNode(xml, "cadsofttools/Results/Result/Output");
if (data != null)
    foreach (XmlNode node in data.ChildNodes)
        res.Add(Convert.ToUInt64(node.Attributes["Handle"].Value.TrimStart('$'), 16));
I hope it helps you.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

Post Reply