What are CAD apps written in, and how are they organized? [closed]
Asked Answered
I

4

14

What are CAD applications (Rhino, Autocad) of today written in and how are they organized internally ?

I gave as an example, Autocad and Rhino, although I would love to hear of other examples as well. I'm particularly interested in knowing what is their backend written in (multilanguage ?) and how is it organized, and how do they handle their frontend (GUI) in real time ? Do they use native windows API's or some libraries of their own, since I imagine, as good as may be, the open source solutions on today's market won't cut it. I may be wrong ...

As most of you who have used them know, they handle amongs other things relatively complex rotational operations in realtime (shading is not interesting me). I've been doing some experiments with several packages recently, and for some larger models found that there is considerable difference in speed in, for example, programed rotation (big full ship models) amongst some of them (which I won't name). So I'm wondering about their internals ...

Also, if someone knows of some book on the subject, I'd be interested to hear of it.

Inhuman answered 22/4, 2009 at 23:17 Comment(0)
I
10

As my company is a registered developer for AutoCAD, I know for certain that its written in C++. It exposes a COM interface, as well as a .Net wrapper. Also, it graphics display is componentized and could be possibly replaced. Way back in its history it used be cross-platform. However its been Windows only for about 10 years and now takes advantage every Windows feature I've seen. You may be interested in the Open Design Alliance.

Ichnite answered 23/4, 2009 at 0:47 Comment(0)
W
11

3D Mechanical CAD software such as CATIAv5, Pro/Engineer and Solidworks are mostly written in C++, sometimes with a thin COM interface for publishing basic API to customers.

Since these applications are really huge and are being developped by several teams, they rely on large scale C++ design principles, such as Interface/Implementation patterns to insulate the modules from changes.

They are composed of several subsystems such as:

  • a base framework to provide abstraction from the underlaying OS
  • a framework for GUI, dialogs and user interaction
  • a 3D renderer (mostly using OpenGL with some custom scene graph layer)
  • a geometric kernel, with a tessellation module (so that geometry can be displayed in the renderer)
  • a parametric modeler build upon the geometric kernel
  • and a lot specific modelers targeted at different domains (Mechanical, Drafting, Simulation, ...)
Waldrup answered 20/3, 2010 at 20:40 Comment(0)
I
10

As my company is a registered developer for AutoCAD, I know for certain that its written in C++. It exposes a COM interface, as well as a .Net wrapper. Also, it graphics display is componentized and could be possibly replaced. Way back in its history it used be cross-platform. However its been Windows only for about 10 years and now takes advantage every Windows feature I've seen. You may be interested in the Open Design Alliance.

Ichnite answered 23/4, 2009 at 0:47 Comment(0)
C
6

AutoLISP is a flavor of lisp that has been used for years to program AutoCAD. Very powerful, not at all friendly. AutoCAD (and most verticals) have had VBA built-in for about 10 years. Kind of powerful, very friendly. VBA projects are stored in a separate file that is loaded by a mechanism internal to the host program. The latest version (currently 2010) no longer includes VBA by default. You must install a separate VBA enabler. This is to put us on notice that VBA (VB6 for that matter) will at some point be a thing of the past. The .NET platform is currently the preferred choice. VB.NET, C#.NET, C++ are commonly used. Some have experimented with other .NET languages like F# and IronPython.

Castorena answered 4/5, 2009 at 21:49 Comment(6)
Interesting. In your opinion, what will be the future scripting option within acad ? As you said, they'll probably be leaving vba, do you think the same will happen to lisp ? For now there are two versions "auto" and "visual" ...Inhuman
I have heard Autodesk's response to that question many times: "There is a tremendous amount of legacy lisp code out there that our customers depend on." I'm guessing, but I don't think they will abandon lisp for many many years. As far as VBA going away, I don't that will happen for many years for the same reason. Who knows, maybe VSTA is a future option. (.NET version of VBA) For now it seems to be .NET with a leaning towards C#.Castorena
AutoCAD 2010 shippied without VBA (you can download it separately). VSTA is the future for CAD add-ins. They change the binary format every 3 years so you need to re-compile against your target version(s).Lorenza
The AutoDesk Developer Network site states that VBA will be completely unsupported from AutoCAD 2011. Additionally, it states that VSTA is likely to be removed as well. This leaves only Visual Studio and AutoLisp.Wendalyn
VBA is still available as an after-the-fact download in v 2011. I wouldn't get too attached to it though.Lorenza
Microsoft stopped offering distribution licenses for VBA for new customers. AutoCAD and others that had VBA built-in are left to decide what to do. There is a TON of VBA code out there and I think there will be an outcry if and when Autodesk decides to cut ties with VBA. Interestingly MS removed VBA from it's own Office Mac some years back and then put it back in when customers let them know it was needed. Also, a word of caution, AutoCAD VBA on a 64 bit system has problems, not the least of which is that it is much slower than 32 bit.Castorena
U
4

The open source project BRL-CAD might interest you.

Uneducated answered 22/4, 2009 at 23:29 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.