Discuss and ask questions about CADEditorX and XML API.

Moderators: admin, support, SDS


Postby agvs » 14 Nov 2016, 08: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: 30
Joined: 16 Jun 2016, 09:10

Re: Results

Postby support » 14 Nov 2016, 14: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:
Posts: 2730
Joined: 30 Mar 2005, 08:36

Return to CADEditorX

Who is online

Users browsing this forum: No registered users and 4 guests