TurboCAD Forums

The Ultimate Resource for TurboCAD Knowledge

When replying to a specific statement be sure to quote the previous post.

Coding for relative coordinates in TCad 19.2
Read 3833 times
* July 09, 2013, 08:21:05 AM
Hey all,

Noob coder here, apologies in advance if I have my thinking or terminology bass-ackwards.  ;D

I'm drudging my way through the SDK and attempting my first custom tool for Tcad v19.  In all the examples I've studied and information discovered in the SDK, when drawing an object using code (line, arc, poly... etc) it appears there is only the option to input absolute coordinates. The samples are very informative BTW, great job Kevan and Co.

For example: If the code is drawing a multiline it is told to start at (0,0,0) for 1st vertex, move to (1,0,0) for the second vertex, (1,1,0) for the third, and so on, until the code tells it to end/finish/close.

I'm trying to build a tool that will begin drawing the multiline from a mouse click (which I found in this thread: Detect Mouse Clicks ) and use relative coordinates to draw the shape. Meaning the first vertex is at MouseClick X,Y,Z, second vertex is at 1 inch 0 degrees away, and third vertex is 1 inch 90 degrees from second vertex.

Is this possible? If so, hints or examples of what objects or functions in the SDK I need to read up on would be much appreciated.


Ben Stegemoller

* July 09, 2013, 11:28:39 AM
Hello Ben
my solution is written in VB6. Maybe it helps.
Change the mouseclick into worldcoordinate. Then add what you want to add.

Set app = IMSIGX.Application
Set vi = app.ActiveDrawing.ActiveView
Set vvi = app.ActiveDrawing.ActiveView
vi.GetMouseClick xclick, yclick
vi.ViewToWorld xclick, yclick, 0, xworld, yworld, zworld



* July 10, 2013, 05:19:23 AM
Thank you very much, Bernd. I'll give the proposed solution a shot and let you know if it worked.

Ben Stegemoller