Reference Manual - ctXMLContentsIntroduction IntroductionCAD 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. License AgreementCADology 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 WarrantyctXML 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 LawThe Governing law of this Agreement shall be that of England, UK. AcknowledgementsAutoCAD, DWG, DXF, DWF and SHX are trademarks of Autodesk, Inc. Installing ctXMLMinimum ConfigurationctXML requires the following:
Installing ctXML for AutoCAD FamilyctXML 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 MicroStationTo be developed. Updating to a Newer Version of ctXMLTo update to a newer version of ctXML, you can simply visit the CADology website to see if a newer version is available. Distributing ctXML with your ApplicationYou 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. ctXML Hints and TipsThe following is a list of notes and hints that maybe helpful as a user of ctXML. ctXML XML StructureEncoding TypeThe 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 ElementsThe 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 AttributesThe <ctXML> element at the start of the XML has the following attributes that assist in the process of ctXML, these are: ApplicationThe is for user and will set to your application name. DebugThe 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. StatusXMLIf 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. UnlockKeyEach 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. VersionThis 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 AttributesAttributes 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/GeoGraphicalctXML 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 AttributesEach 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. LayerThis 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. ColourThis 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). LineStyleThis is the line style that will be assigned to the graphical object. LineWeightThis is the thickness or weight than will be assigned to the newly created graphicl object. PersistentThis 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. GUIDIf 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<Create_3DFACE>This will allow the user to create a facet graphical object in the CAD system.
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.
<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" /> <Create_ARC>This will allow the user to create a ARC graphical object in the CAD system.
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.
<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" /> <Create_CIRCLE>This will allow the user to create a CIRCLE graphical object in the CAD system.
<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" /> <Create_LINE>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.
<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" /> <Create_POLYLINE>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.
<Create_POLYLINE Layer="ctxml" Closed="false" Colour="BLUE" LineStyle="Continuous" LineWeight="1"> <Create_SYMBOL>This will allow the user to create a symbol graphical object in the CAD system:
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").
<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" /> <Create_TEXT>This will allow the user to create a TEXT graphical object in the CAD system.
<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" /> Wanted: New SuggestionsIf 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. Technical SupportLatest Software VersionThe latest version of ctXML (software, revision history and this manual) can be found and downloaded from the CADology website (www.CADology.com). ContactFor technical support, please contact CADology. |