Deelip.com

Monday, March 23, 2009

OpenCAD - My First Book

I have been making noise about the Open Design Alliance on this blog for some time now. Most of the noise has been about the misconceptions surrounding the ODA and its technologies. And now to justify the noise that I have been making, I have gone ahead and written a book about it. The 92 page book is titled "OpenCAD - A Step by Step Guide to Developing a Professional CAD Application". I think the best way to explain what the book is all about is to simply list its Introduction here.


Introduction

Ever since the Open Design Alliance (formerly the OpenDWG Alliance) was founded, it has been busy reverse engineering the DWG file format as and when Autodesk changed it. Due to this the ODA came to be known as the "hackers group" who give nothing but pain to Autodesk by offering their members libraries to read and write DWG files. Autodesk already has a library called RealDWG which reads and writes DWG files, but they are known not to license it to their business rivals. Hence the need for an organization such the ODA grew and the ODA delivered every time Autodesk changed the DWG file format.

My company, SYCODE (www.sycode.com), is a member of the Autodesk Developer Network (ADN) as well as a member of the ODA. I have been keeping a close eye on the cat and mouse game between Autodesk and ODA for quite some time now. In all the confusion, law suits and out-of-court settlements, there is one important aspect of the ODA that has gone completely unnoticed. And the purpose and motivation for me to write this book is to shed some light on that particular and very interesting aspect.

Every time the ODA reverse engineered the DWG file format, they improved their technology, not surprisingly, by cloning that of Autodesk. One thing led to another and they finally ended up cloning Autodesk's ObjectARX SDK, the very foundation on which AutoCAD has been built. The ODA called their clone DWGdirect and needless to say, ODA members started using DWGdirect to read and write DWG files. And that is the problem which I hope to address by means of this book. DWGdirect is not just a SDK to read and write DWG files. It actually offers a full blown framework that can be used to develop a professional CAD application, complete with plug-in architecture and all. Applications built using the DWGdirect SDK are called DWGdirect hosted applications. The not yet released IntelliCAD 7 is one of them. Bricsys rewrote Bricscad as a DWGdirect hosted application in V8 itself.

This book is my attempt to show that the ODA offers far more than libraries to read and write DWG files. We will create the framework of a professional CAD application (which I have called OpenCAD) using nothing but Visual C++ 2005 and a bunch of ODA libraries. You will also learn how to create plug-ins that extend OpenCAD using the ODA's free DRX SDK. And of course, OpenCAD will be able to read and write DWG files as well.

This book is divided into two sections. Section I deals with creating the basic OpenCAD application, wiring it up with required ODA libraries and adding features to make it a full blown professional DWG viewer. Section II deals with adding plug-in architecture to OpenCAD and developing a plug-in that converts it into a DWG editor. We will also see how the plug-in developed for OpenCAD loads and runs in Bricscad V9 as well.

If you are an ODA member then you already have access to the DWGdirect SDK and you can start building OpenCAD or your own DWGdirect hosted application by following the instructions in Section I of this book. If you are not an ODA member you can download the OpenCAD source code and binaries from www.open-cad.com and start developing plug-ins for it or any other DWGdirect hosted application by following the instructions in Section II of this book.

The point of the OpenCAD software and this book is not to develop a full blown free CAD application. Rather my intention is to showcase the various technologies offered by the ODA, apart from reading and writing DWG files. We will first create OpenCAD as a DWG viewer and then add features as we proceed.

OpenCAD is not open source for the simple reason that the DWGdirect SDK is not open source. However, all the C++ source code used to build OpenCAD and its plug-ins are available free of cost at www.open-cad.com. I have also organized the source code by chapter. So if you want to skip a chapter or two you can do so.

I have used Microsoft Visual C++ 2005 and DWGdirect version 2.06 to develop OpenCAD and its plug-in. The ODA offers libraries for other compilers as well and you can very well use another compiler.

I write software for a living, not books. So I am not quite sure how this book is going to turn out. I am going to need all the criticism that I can get - good, bad and ugly. Please do give it to me.

If this book ends up helping you in any way or gives you a better understanding of the technologies offered by the ODA, do let me know. It will make me happy ;-)

So let's get right to it.


The book is available as a perfectly bound paperback book ($99) as well as a PDF eBook ($49). It comes with complete C++ source code which you can use to make a professional CAD application that makes you a whole lot more money than you spent on purchasing the book. The book also serves as a good primer on developing DRX plug-ins that work with DWGdirect hosted applications like Bricscad V9, which will also help you earn money. So you see, its all about spending some money to make a whole lot more money ;-)

For more details on this book visit www.open-cad.com.

And now, thanks to this book, you can henceforth respectfully refer to me as Author.



Front Cover




Back Cover

11 Comments:

  • I think the real use of a 2D CAD framework (and thus your book on ODA SDK) is for vertical applications (such as electrical schematic and control cabinet design), not to make yet another AutoCAD clone.

    --Tony

    By Anonymous Anonymous, At 3:35 AM, March 24, 2009  

  • I agree. If someone wants to create another AutoCAD clone, they might as well join the InteliCAD Technology Consortium. The ITC has used the same approach in writing the new IntelliCAD as I did in writing OpenCAD. IntelliCAD and OpenCAD share the same genetics - the DWGdirect SDK.

    The point of this book is to highlight the technologies offered by the ODA as well as assist in the creation of DWGdirect hosted applications. At SYCODE, we are rewriting our standalone products as DWGdirect hosted applications so that we can add DRX plug-in architecture to them, among other things. None of our products will be AutoCAD clones.

    By Blogger Deelip Menezes, At 11:14 AM, March 24, 2009  

  • Do I have to join the Open Design Alliance to get the ODA libraries you use? Even ODA Associate Membership will cost me $250 :-(

    By Anonymous Anonymous, At 1:24 AM, March 25, 2009  

  • Yes. The DWGdirect SDK is available to members only. I can assure you, membership is well worth it.

    However, the DRX SDK used to build plug-ins for DWGdirect hosted applications is available free of charge to everyone.

    By Blogger Deelip Menezes, At 7:26 AM, March 25, 2009  

  • Thanks for providing valuable information about CAD systems on your blog. I'm beginning to think that I should start up a blog in another discipline. I've been looking at purchasing a CAD system for personal use. I do alot of visualization and I tend to run numbers in EXCEL or Quattro Pro depending on the application. However, I'm now running into 3D imagery problems that can only be solved with autocad or something similar.

    I'd like to purchase a decent autocad program without paying $3000.00 Canadian for it. I'm looking at ITC right now but I haven't used it yet. What do you recommend?

    By Anonymous quantumdesigner, At 1:20 AM, April 06, 2009  

  • With an exception of Bricscad, I think all the other IntelliCAD, run the same old IntelliCAD 6 code. Although, I know that some ITC members have meddled with the original ITC code. I suggest you keep some time aside to test a few IntelliCAD's with your data and then decide for yourself.

    By Blogger Deelip Menezes, At 10:04 AM, April 06, 2009  

  • sir
    i am folllowing ur book...its really nice and easy to understand..
    but i stoped at a point
    in chapter 2..you have referred to add few .cpp files names: exsystemservices.cpp,exhostappservices.cpp,odfilebuff.cppand exundocontroller.cpp
    i am not able to find these files...
    i have bought ur book with the source code..but still not able to find these file..
    can u help me in this concern..
    i will be helpful for your precious guidance...

    thankyou.

    By Anonymous Anonymous, At 5:39 PM, February 24, 2010  

  • You will need the DWGdirect SDK from the Open Design Alliance (www.opendesign.com)

    By Anonymous Anonymous, At 12:07 AM, February 25, 2010  

  • i have downloaded DWGdirectSDK 2.06...
    but still having the same propblem..

    By Anonymous Anonymous, At 11:43 AM, February 25, 2010  

  • Are you sure you have downloaded the DWGdirect SDK or the free DRX SDK? You need to me a member of the ODA to get the DWGdirect SDK.

    By Blogger Deelip Menezes, At 1:18 PM, February 25, 2010  

  • THE ERRORS TAHT ARE COMMING OUT ARE AS:

    1>OpenCAD.cpp

    1>c:\sdk\opendesign\dwgdirect\2.06\include\dd_packpop.h(3) : warning C4161: #pragma pack(pop...) : more pops than pushes

    1>c:\opencad\opencad\opencad.cpp(171) : error C2664: 'odInitialize' : cannot convert parameter 1 from 'COpenCADApp *const ' to 'OdDbSystemServices *'

    1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast

    1>c:\sdk\opendesign\dwgdirect\2.06\include\dd_packpop.h(3) : warning C4161: #pragma pack(pop...) : more pops than pushes

    1>c:\opencad\opencad\opencaddoc.cpp(44) : error C2039: 'createDatabase' : is not a member of 'COpenCADApp'

    1> c:\opencad\opencad\opencad.h(20) : see declaration of 'COpenCADApp'

    1>c:\opencad\opencad\opencaddoc.cpp(88) : error C2039: 'readFile' : is not a member of 'COpenCADApp'

    1> C:\opencad\opencad\opencad.h(20) : see declaration of 'COpenCADApp'

    1>ExHostAppServices.cpp
    1>c:\sdk\opendesign\dwgdirect\2.06\include\odplatform.h(339) : error C3861: 'ODA_ASSUME': identifier not found




    1>c:\sdk\opendesign\dwgdirect\2.06\include\smartptr.h(185) : error C2061: syntax error : identifier 'OdRxObjMod'

    1> c:\sdk\opendesign\dwgdirect\2.06\include\smartptr.h(407) : see reference to class template instantiation 'OdSmartPtr' being compiled

    1>c:\sdk\opendesign\dwgdirect\2.06\include\smartptr.h(190) : error C2535: 'OdSmartPtr::OdSmartPtr(const T *)' : member function already defined or declared

    1> c:\sdk\opendesign\dwgdirect\2.06\include\smartptr.h(185) : see declaration of 'OdSmartPtr::OdSmartPtr'

    1>c:\sdk\opendesign\dwgdirect\2.06\include\smartptr.h(201) : error C2061: syntax error : identifier 'OdRxObjMod'

    1>c:\sdk\opendesign\dwgdirect\2.06\include\smartptr.h(214) : error C2143: syntax error : missing ',' before '&'

    1>c:\sdk\opendesign\dwgdirect\2.06\include\rxobject.h(735) : error C2653: 'OdDb' : is not a class or namespace name

    1>c:\sdk\opendesign\dwgdirect\2.06\include\rxobject.h(735) : error C2146: syntax error : missing ';' before identifier 'getClassVersion'

    1>c:\sdk\opendesign\dwgdirect\2.06\include\rxobject.h(735) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

    1>c:\sdk\opendesign\dwgdirect\2.06\include\rxobject.h(736) : error C2653: 'OdDb' : is not a class or namespace name

    1>c:\sdk\opendesign\dwgdirect\2.06\include\rxobject.h(736) : error C2061: syntax error : identifier 'MaintReleaseVer'

    1>c:\sdk\opendesign\dwgdirect\2.06\include\rxobject.h(736) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

    1>c:\sdk\opendesign\dwgdirect\2.06\include\rxobject.h(736) : warning C4183: 'getClassVersion': missing return type; assumed to be a member function returning 'int'




    AND MANY MORE LIKE THESE...
    I WILL PRRECIATE IF U COULD HELP ME PLEASE..

    THANKU....

    By Anonymous Anonymous, At 3:20 PM, February 25, 2010  

Post a Comment

Subscribe to Post Comments [Atom]



<< Home