Discuss and ask questions about CADEditorX and XML API.

Moderators: admin, support, SDS

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


Post by agvs » 14 Nov 2016, 10:14

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">
<Result Instruction="add">
<Created Handle="$2E" Position="71,1" />
<Created Handle="$2F" Position="167,1" />
<Result Instruction="invalidate" />

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.

Posts: 2794
Joined: 30 Mar 2005, 11:36

Re: Results

Post by support » 14 Nov 2016, 16:37

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:
Chat support on Skype:

Post Reply