Bangalore, India
The Teigha (TX) development platform is perhaps the least know or understood API for BricsCAD. It is not a very popular one, and provided only to maintain compatibility with C++ code written for Teigha-based CAD.
The Teigha API Works with BricsCAD (Windows) Classic, Pro and Platinum, BricsCAD (Linux) Classic, Pro and Platinum. What sets Teigha apart from other APIs is that it is the only C++ API for BricsCAD Classic.
Before we proceed further, some backgound information about Teigha.
Teigha: A library provided by the Open Design Alliance (www.opendesign.com), to read and write DWG files, generate graphic display objects of DWG entities, fire database related reactors, etc... BricsCAD is based on this library. The full library is only available for ODA founding members, such as Bricsys.
Teigha (TX) SDK: A free C++ SDK, consisting of the headers and libs of the Teigha library, and provided by the Open Design Aliance. The runtime dlls are not included in this SDK. Those are installed with the BricsCAD product. This SDK can be downloaded freely on the public section of the ODA website (www.opendesign.com). BricsCAD V14 is based on a Bricsys-adapted version of the Teigha libraries, as a consequence BricsCAD V13 is NOT compatible with the ODA version of the TX SDK.
Bricsys TX SDK: The Bricsys-adapted version of the TX SDK, available for BricsCAD V13 and V14. To get access to this SDK, please contact Bricsys Support.
Bricsys is working closely with the ODA to merge away all code differences in the foreseeable future. When this is accomplished, BricsCAD will provide compatibility with the official TX SDK as distributed by the ODA.
Teigha applications:
The Bricsys Teigha eXtension (TX) SDK enables to produce C++ based TX module files, which can be loaded to run in BricsCAD V12, V13 & V14. Typically, such modules have the extension ".tx".
Note: In versions prior to BricsCAD V12 these modules where called .drx. A drx file can no longer be loaded in the current BricsCAD version; the source code needs to be recompiled to *.tx using the latest TX SDK.
Note: Earlier TX modules compiled for Bricscad V12, will not run in BricsCAD V13 or V14 and need to be recompiled with the present Bricsys TX SDK version.
Note: If you consider to work with the TX SDK, please read the following sections carefully. This documentation is intended to help you make the best decision for your application strategy, in particular the choice of API.
TX and ARX compared: similarities and differences
There might be some confusion, about how exactly TX and Teigha relate to ObjectARX. In this section, we hope to give you a clear view on this subject.
At first sight, the TX classes, methods and functions look very similar to the ones found in ObjectARX. If you look at the help files or headers delivered with the TX SDK, you will recognize a lot of things when you have some experience in ARX development.
However, there are a number of fundamental differences that can be summarized as followed:
- The TX SDK enforces the use of smart pointers in client code. The way of constructing and destructing objects is different from ARX.
- A major part of the error handling is based on exceptions thrown by the Teigha libraries, that need to be caught by the client code. As a consequence, the control flow of error handling will be different in ARX and TX applications.
- The TX SDK contains only a subset of functionality that is available in ObjectARX. This is logical, since the Teigha library can not be compared to a full CAD application. Important editor related ARX interfaces, such as AcEdJig, AcApDocument, AcApDocManager, AcEdInputPointMonitor, AcUi and AdUi interfaces, ... will not be found in the TX SDK.
- The way certain basic operations are done, such as retrieving the active database instance, opening entities, ... is often different from ARX.
- Although minor, there are some differences in the class hierarchy of objects.
To illustrate this, please compare following code samples. The objective of the sample is simple: add a new line entity to the active drawing.
How it's done in ARX: |
How it's done in TX:Note: The differences with the corresponding ARX code are added as comments in the code. |
void createLine() |
//difference: command function needs command context argument. |
//2. get active database |
//2. get active database |
//3. get model space BTR |
//3. get model space BTR |
//4. create new line entity |
//4. create new line entity |
//5. append entity to model space |
//5. append entity to model space |
//6. close all objects |
//6. close all objects |
Conclusion: even for a simple operation, such as adding a line to a drawing, there are differences in nearly each line of code, which can not be worked around. As a consequence, maintaining an ARX and TX version of your application, will require two separate sets of source code!
The better alternative recommended by Bricsys is BRX
To overcome the differences explained above, Bricsys has developed another C++ API that is fully code compatible with ObjectARX. This API is called "BRX", the BricsCAD Runtime eXtension.
We strongly recommend to use this API for C++ client applications. The advantages compared to TX can be of major influence for reducing the time and resources spent to bring your application to the BricsCAD platform:
- no need to rewrite and convert existing ARX code to TX code
- no need to maintain 2 source code sets of your application: by simply recompiling your existing code with the BRX SDK, you can run your application on BricsCAD. By maintaining one source code set that is ARX based, you can serve both CAD platforms AutoCAD and BricsCAD.
- guaranteed binary compatibility for your BRX modules within the same major release cycle.
For more information, please check the BRX section of this developer reference. In case you do prefer to work with the TX SDK, please find some important information listed in the following paragraphs.
Compatibility between BricsCAD and the TX SDK
Bricsys is a founding member of the Open Design Alliance (ODA), and therefore has access to all the source code of the Teigha libraries. In order to bring BricsCAD to the level of high quality CAD platform it represents today, some parts of the Teigha libraries were adjusted or extended by Bricsys, for different purposes:
- increased performance, on different aspects such as graphic update, entity selection, undo mechanism, multi-core support, ...
- reduced memory usage
- full support for advanced geometric functions (OdGe category in Teigha)
- increased compatibility
In all of this, it was not possible to keep the Teigha runtime libraries that are installed with BricsCAD 100% binary compatible with the TX SDK as provided by the ODA. The most affected categories are OdGi and OdGs. Therefore, Bricsys distributes its own version of the TX SDK that is fully compatible with BricsCAD.
Downloading the Bricsys TX SDK
The SDK is not available for download on the Bricsys website. To get access, please contact Bricsys Support.
Compatibility within the V14 release cycle:
BricsCAD is expected to undergo multiple updates of the Teigha libraries within the V14 release cycle. Each update will unavoidably break compatibility with compiled TX modules.
Tip: The version number of the Teigha runtime dlls that are installed with BricsCAD, can be seen in the names of those dlls. By looking into the BricsCAD install folder, you will find dll's such as:
TD_Ave_3.09_10.tx
TD_ColladaExport_3.09_10.tx
TD_ColladaImport_3.09_10.tx
TD_Dwf7Import_3.09_10.tx
TD_DwfUnderlay_3.09_10.tx
TD_DynBlocks_3.09_10.tx
TD_FtFontEngine_3.09_10.tx
TD_PdfExport_3.09_10.tx
TD_PdfImportVI_3.09_10.tx
TD_RasterExport_3.09_10.tx
TD_Sm_3.09_10.tx
TD_STLExport_3.09_10.tx
TD_SvgExport_3.09_10.tx
In this naming, "3.09" indicates the Teigha version, suffix "_10" indicates that the dll's were built with VC10 (Visual Studio 2010).
Note: For BRX based modules, binary compatibility will be maintained throughout the whole V14 release cycle.
Teigha Manual
A detailed manual and reference guide can be downloaded from the public section of the ODA website, (www.opendesign.com).
Samples: Some sample TX modules are included in the TX SDK.
Extensions useful for TX and SDS applications
In the API folder that is installed with BricsCAD, you can find some header files that contain useful extensions to the TX interfaces. As explained above, these are mainly extensions required to provide access to some important functions of the editor environment of the CAD platform:
- od_doc_man.h : MDI interfaces OdApDocManager, OdApDocManagerReactor, OdApDocument, OdApDocumentIterator.
- od_ed_input.h: input point processing interfaces: OdEdInputPointManager, OdEdInputPointMonitor, OdEdInputContextReactor
- od_db_doubleclickedit: OdDbDoubleClickEdit
- od_db_osnap.h: dDbCustomOsnapInfo, OdDbCustomOsnapMode, OdDbCustomOsnapManager
- od_ed_ssget_filter.h: OdEdSSGetFilter, OdEdSSGetFilter2
- od_ed_uicontext.h: OdEdUIContext
- od_gi_glyph.h: OdGiGlyph
Modules that make use of the extensions, should link with odapi.lib which can be found in the same API folder.
Compiler requirements:
- On Windows, developer should compile with Visual Studio 2010 (SP1 recommended).
- The preprocessor symbol _TOOLKIT_IN_DLL_ must be defined, this instructs your module to be linked dynamically with the Teigha runtime dll's.
Follow us on Twitter: http://www.twitter.com/rakesh_rao
Discover BricsCAD, discover GeoTools-AutoCAD , GeoTools-BricsCAD, CADPower-AutoCAD, CADPower-BricsCAD, discover TechCenter. Brand new ways to work smarter in CAD!!
Is it possible to use BRX SDK and TX SDK in the same plugin? What I want is the read face underlying surface geometric info like degree, knots, etc and all the face boundary data. Is it possible with BRX SDK or TX SDK?
thank you
Posted by: Northwind | November 02, 2019 at 16:43
Hello Northwind,
Unfortunately, I do not know anything about BRX and Teigha TX.
Please post a support request to Bricsys developer support to get an answer.
Best Regards
Rakesh Rao
Posted by: Rakesh Rao | November 03, 2019 at 07:19