<< Click to Display Table of Contents >> Navigation: Concepts > XML Structure |
The XML structure consists of header, instructions, footer.
Header
<?xml version="1.0" encoding="UTF-8" standalone="no"?> |
Standard XML Declaration string. |
<cadsofttools version="2.0"> |
Standard CADSoftTools XML Declaration string. |
Instructions
Instructions are XML nodes that store all needed parameters to manage CADEditorX.
<add> |
Adds entities. The ADD instruction adds entities and the Drawing Structure Data to the current drawing. There are many examples of adding particular classes by the ADD instruction that are described in the Classes examples. |
<!-- The following line adds a line. --> |
Commentary inside XML. |
<cstLine Point="0,0,0" Point1="10,0,0"/> |
Nodes inside the <Add/> instruction are Entities Classes. This code adds Line with the following coordinate parameters Point.X = 0; Point.Y=0; Point.Z=0 and Point1.X=1; Point1.Y=1; Point1.Z=1. |
<cstLine /> </add> |
<cstLine/> is an empty-element tag while <Add> has the end tag. |
<FitToSize/> - Fit to Size instruction |
The Fit to Size instruction. |
Footer
</cadsofttools> |
End-tag for the <cadsofttools> node. |
The XML code described above is contained inside XML IDE:
When the Execute XML button is pressed, the line is added and zoomed to window:
After pressing Execute XML, CADEditorX also returns the result in XML format:
<?xml version="1.0" encoding="UTF-8" standalone="no"?> |
Result has the same Header and Footer:
Header:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<cadsofttools version="2.0">
Footer:
</cadsofttools>
Results
Results are contained inside the <Results> tag. Each instruction returns to the <Result> tag
<Result> has subnodes: <Output> or <Errors>:
<Output> |
The <Created> node means that a new Entitiy (Class) is created.
Parameters:
Handle |
Unique identification of the Entity. |
Position |
Position in the input XML file where this instruction was written. |
The last one is used for debugging. Just double-click the Result inside XML IDE and the instruction will be highlighted in the input window:
Go to CADEditorX