TurboCAD Forums

The Ultimate Resource for TurboCAD Knowledge

Be sure your post is relevant to the current discussion.  Create a new topic within the appropriate board if you are unsure.

C++ API object library reference
Read 8630 times
* December 01, 2009, 12:34:36 AM
Is there any API object library reference? If yes, where to look for it?


* December 15, 2009, 01:17:02 PM
There is no C++-specific API reference. You can use the existing TCSDK.chm documentation to get an idea of what objects, methods, and properties are available, but translating the VB-based examples to C++ can be sort of difficult sometimes.

I have been using the #import preprocessor instruction in Visual C++ to import the type libraries of interest (IMSIGXxx.dll, GX*.dll) to get .tlh files; then using these to find out the C++-specific names, arguments, and return types for the methods and properties.

See the sample projects in this board and in the Contributions board for more specific examples of how to use some of the API objects in Visual C++.

As I update the SDK documentation I will be adding a lot more sample snippets to demonstrate C++ usage.


* December 30, 2009, 12:43:57 PM
It would be nice to see *some* kind of a geometry creation primer. For example:
1. wireframe
     a. point
     b. line
     c. arc / circle
2. primative solids (those with analytic solutions)
     a. box
     b. cylinder
     c. cone
3. surfaces (we can even skip this category to start with)

For the each of the above, one needs to know:

I. which DLL (or DLLs) to 'import'
II. which COM objects need to be created and in what order
III. with some spelunking, one can puzzle out the boilerplate, and can extrapolate the C++ or C# syntax from the VBScript syntax:

Set tcApp = CreateObject("TurboCAD.Application")
Set tcDrawing = tcApp.ActiveDrawing ' would be nice to see the progID in a comment here
From here it gets fuzzy...

Lets say we just want to create four points with the default workplane, what is the philosophy? As in:

a) Is there a 'point' type that we instantiate and 'add' to the drawing?
b) Or do we instantiate geometry via the 'parent' drawing?
c) Or do we instantiate a 'graphic' of a 'type' and add to the parent?

Now build from here by defining four lines by connecting the four points.

From here, now build a 3D box by sweeping the four lines.

I would be happy to just see that much of a clean, simple, example.


* December 05, 2010, 09:28:11 AM
I as well would like to see some examples. I have a Pro V15 and I am interested in the SDK properties mentioned. But, I am getting no where, other than understanding that most of it seems to be in support of other systems. I haven't been able to do much with of anything with C++ or VB, not even close to what they mention is possible.