Reference Manual - ctXML



CAD Tools XML, or ctXML for short, is a CAD addin application that defines an interface between CAD software and a XML format defined by ctXML without having to learning the API of the CAD system. ctXML will support all the popular version of major CAD applications.

ctXML has been designed to work with Windows 2000, Windows XP and Vista with the latest Service Packs applied.

Jump to Top of Page

License Agreement

CADology LIMITED (UK) designed and provides this computer software, CAD Tools XML (ctXML), and documentation as is and licenses its use. The user assumes responsibility for the choice of this program to achieve its intended results, and for the installation, use and results achieved.

ctXML is not, nor has ever been, public domain or free computer software.

This software may only be distributed within an application with a valid distribution license; this license is obtained on an annual basis from CADology.

Limited Warranty

ctXML is provided without warranty of any kind. The complete risk as to the results produced by this program is assumed by purchaser/user. If the program becomes defective, the purchaser/user assumes the complete cost of all associated damages. CADology Limited shall have no responsibility or liability to any person or company.

The Governing Law

The Governing law of this Agreement shall be that of England, UK.


AutoCAD, DWG, DXF, DWF and SHX are trademarks of Autodesk, Inc.
MicroStation, DGN and DesignFile are trademarks of Bentley Systems Inc.
Windows 2000, Windows XP and Vista are trademarks of Microsoft.

Jump to Top of Page

Installing ctXML

Minimum Configuration

ctXML requires the following:

  • Windows 2000, Windows XP and Vista with the latest Service Packs
  • .NET Framework 2.0 or above

Installing ctXML for AutoCAD Family

ctXML for AutoCAD is developed as a .NET AddIn and requires to be loaded using the NETLOAD command at the AutoCAD command prompt.

Installing ctXML for MicroStation

To be developed.

Updating to a Newer Version of ctXML

To update to a newer version of ctXML, you can simply visit the CADology website to see if a newer version is available.

Jump to Top of Page

Distributing ctXML with your Application

You may distribute this software with your application only if you have purchased the "Annual Distribution License". This is included in the first year but after 1 year from purchase you are obliged to purchase the license to distribute.

Jump to Top of Page

ctXML Hints and Tips

The following is a list of notes and hints that maybe helpful as a user of ctXML.

Jump to Top of Page

ctXML XML Structure

Encoding Type

The encoding of the XML file can be of any type and if you are using the MSXMl DOM or any of the .NET XML tools then you can leave these are the default. In the samples for ctXML, we use:

<?xml version="1.0" encoding="utf=8"?>

ctXML Elements

The XML elements type are used to define the type of graphical object or type of classification. i.e. Grouping. An example of graphical element objects would be Line, Arc, Circle, etc.

<ctXML> Element Attributes

The <ctXML> element at the start of the XML has the following attributes that assist in the process of ctXML, these are:


The is for user and will set to your application name.


The is used when you are developing your program to create the XML for ctXML to process, when this is found as a attribute ctXML will display messages where possible to inform of errors, hints and tips.


If this attribute is set to a valid filename, then ctXML will create a log of the actions. Primarily this would be used where the calling application requires some information back from ctXML i.e. Handle of the entity created / Element Id.


Each user will be given a special unlockKey code that will enable the ctXML to work without any restrictions. This unlockKey is unique to each licensed user.


This is the internal version number of the XML file structure, as the product develops and new XML elements; the version of the XML fileit was added will be documented below in the manual for each specific element.

ctXML Graphical Objects Attributes

Attributes are used on an element to define the data values that will be used to construct the graphics. An example would be the coordinates of the start and end of a line.

Coordinates Cartesian/GeoGraphical

ctXML will allow some graphical object to be placed using Latitude and Longtitude coordinates in the following form DD:MM:SS.SSSS.

If the CAD drawing has been assigned a coordinate system then the geographical lat/long are assumed to be WGS-84 and will be converted to the assign coordinate system in the CAD drawing. Hence, if a UTM coordinate system is defined then the lat/longs will be translated using the CAD software API to the X,Y coordinates of the UTM projection.

Common Object Attributes

Each of the graphical objects has a set of common attributes that apply to all types, these are details below and are refered to in CAD as the header values.


This is the Layer or Level that the newly created graphical object will be placed, if the Layer/Level does not exist then it will be created automatically using the default values of the CAD software.


This is the colour value that will be assigned to the graphical object, this can be from a predefined colour list below or you can specify a RGB value separated by commas. The predefined colours are RED, YELLOW, GREEN, CYAN, BLUE and MAGENTA. The RGB values must be assigned in the Red, Green, Blue order and have a value between 0 to 255 (e.g. 123,92,100).


This is the line style that will be assigned to the graphical object.


This is the thickness or weight than will be assigned to the newly created graphicl object.


This allows the graphics being created to remain in the CAD drawing after the user has finished. By default, this is set to True so that all graphics remain in the CAD drawing. In some cases you may wish to draw the graphics so that the CAD system will delete when the CAD drawing in closed. If even if the drawing is saved, non-persistent graphics WILL BE deleted from the CAD drawing.


If this attribute is present and assigned to a valid GUID then ctXML will report this GUID and the entity handle/element id of the graphic created in the StatusXML file. This feature is to assist the user in knowing the unique handle/id of the created graphic for future use. For example, if you were creating a line and wanted to delete it in future then this technique will allow the calling application to store the unique identifier of the line for later use.

Graphical Object XML Elements


This will allow the user to create a facet graphical object in the CAD system.

AutoCAD - This is a 3DFACE entity of 3 or 4 sides
MicroStation - This is a SHAPE element of 3 or 4 sides

InvisibleEdge attribute can specify if the edge along the 3D face is invisible when displayed by the CAD software. There are 4 edges, one for each side of the 3D face graphical object.

Example XML for a 3DFace:

<Create_3DFACE Persistent="0" Layer="RunwayStrip" Colour="Blue" LineStyle="Continous" LineWeight="1" NumberOfPoints="4" X1="722828.688010441" Y1="5753682.0615099" Z1="0" X2="722156.094687469" Y2="5752889.66849133" Z2="-10" X3="722384.810422641" Y3="5752695.53165174" Z3="-10" X4="723057.403745614" Y4="5753487.92467032" Z4="0" InvisibleEdge1="False" InvisibleEdge2="False" InvisibleEdge3="False" InvisibleEdge4="False" />


This will allow the user to create a ARC graphical object in the CAD system.


Radius - Radius of the arc
StartAngle - Start angle in degrees of the arc
EndAngle - End angle of the arc (in degrees)
NormalX,Y,Z - These allow the arc to be rotated around the centre point using the direction of a vector. These are optional and wil default to 0,0,1 so the arc is placed on the XY plane.
StartAnglePointX,Y - Start point on the arc's circumference
EndAnglePointX,Y - End point to determine the end angle

An arc can be drawn either by specifiy the start angle, end angle, radius or a start and end point. If the later is used then the radius will be calculated by ctXML from the center point to the start point.

Example XML for a Arc:

<Create_ARC Layer="CTXML_GeoTestArc" Colour="RED" LineStyle="Continuous" LineWeight="1" X1="5144.8116" Y1="25.6476" Z1="0" Radius="100" StartAngle="45" EndAngle="180" NormalX="0" NormalY="0" NormalZ="1" />


This will allow the user to create a CIRCLE graphical object in the CAD system.


Radius - Radius of the arc
NormalX,Y,Z - These allow the arc to be rotated around the centre point using the direction of a vector. These are optional and wil default to 0,0,1 so the arc is placed on the XY plane.

Example XML for a Circle:

<Create_CIRCLE Layer="CTXML_GeoTestArc" Colour="RED" LineStyle="Continuous" LineWeight="1" X1="44.8116" Y1="25.6476" Z1="0" Radius="100" NormalX="0" NormalY="0" NormalZ="1" />


This will allow the user to create a LINE graphical object in the CAD system, a line object is defined by having a start point and a end point. Each start and end point has a X, Y and Z value to define the 3D position in the CAD drawing file.

Example XML for a Line:

<Create_LINE Layer="ASM_ConicalContours" Colour="CYAN" LineStyle="Continuous" LineWeight="1" X1="736438.925815753" Y1="5709253.7041025" Z1="45" X2="737133.51852642" Y2="5709192.93511454" Z2="45" />


This will allow the user to create a polygon line graphic based on a number of coordinates which can be open or closed. The start and end coordinates that define the shape to not need to the same, if a closed shape is required then set the attribute “Closed” to true.

AutoCAD - LWPolyline
MicroStation - Line String


Closed - This defaults to false and controls if a segment is added to close the line between the first and last coordinate.

Example XML for a Create_POLYLINE:

<Create_POLYLINE Layer="ctxml" Closed="false" Colour="BLUE" LineStyle="Continuous" LineWeight="1">
    <Coordinate X="0.0" Y="0.0" />
    <Coordinate X="10.0" Y="10.0" />
    <Coordinate X="50.0" Y="25.0" />


This will allow the user to create a symbol graphical object in the CAD system:

AutoCAD: INSERT entity
MicroStation: Cell element


Name - Name of the symbol, block name in AutoCAD or Cell Name in MicroStation
Rotation - Rotation of the symbol
ScaleX,Y,Z - These allow the symbol to be scaled around the base point. These are optional and will default to 1,1,1.

Note with AutoCAD: If the block does not reside on the current DWG file then a full path to a external DWG can be used in the Name attribute (e.g. Name="c:\libs\MyBlockDME.dwg").

Example XML for a Symbol:

<Create_SYMBOL Layer="CTXML_Symbol" Colour="RED" LineStyle="Continuous" LineWeight="1" X1="44.8116" Y1="25.6476" Z1="0" Name="MySymbol" Rotation="0" ScaleX="2" ScaleY="2" ScaleZ="2" />


This will allow the user to create a TEXT graphical object in the CAD system.


TextLiteral - This is the value of the text graphical object
Justification - This is the justification to be used when displaying the text, this can be BR, BC, BL, MR, MC, CC, ML, TR, TC, TL, C, L, R
Rotation - Angle in degrees that the text will be rotated around the XY axis.
Height - The height of the text in CAD units.

Example XML for a Text:

<Create_TEXT Layer="Conical_Contour" Colour="Green" LineStyle="Continuous" LineWeight="1" X1="722860.680583627" Y1="5747178.03929946" Z1="95" TextLiteral="95m" Justification="CC" Rotation="14.6749771644996" Height="50" />

Jump to Top of Page

Wanted: New Suggestions

If you require or have an idea for a new method or property, please contact CADology with details. If your suggestion is included, then the latest version will be shipped free of charge.

Jump to Top of Page

Technical Support

Latest Software Version

The latest version of ctXML (software, revision history and this manual) can be found and downloaded from the CADology website (


For technical support, please contact CADology.

Jump to Top of Page