TurboCAD Forums

The Ultimate Resource for TurboCAD Knowledge

Register
 
The purpose of these forums is to discuss TurboCAD.  Please keep the discussion of other products to compatibility issues or how the other software’s can be used with TurboCAD.


accessing workplane
Read 555 times
* March 27, 2017, 05:26:27 PM
Hi,
since there seems to be no board for general questions on the SDK I'll try here:

Is it possible to access the workplane from an external script or program?

TIA,
KG

Logged


* June 19, 2017, 02:01:08 AM
#1
dwg.UCS.GetEntry seems to work.
Here is some sample code:
Sub GetUCS()
Dim app As IMSIGX.Application
Dim dwg As IMSIGX.Drawing
Dim myMatrix(0 To 3, 0 To 3) As Double
Dim i%, j%
Dim msg$

' Fill myMatrix with the Identity Matrix
For i% = 0 To 3: myMatrix(i%, i%) = 1: Next

Set app = GetObject(, "TurboCAD.Application")
Set dwg = app.ActiveDrawing
    'msg$ = dwg.UCS.GetEntries(myMatrix)
   
For i% = 0 To 3
    For j% = 0 To 3
        msg$ = msg$ & dwg.UCS.GetEntry(i%, j%) & ", "
    Next j%
    msg$ = msg & vbCrLf
Next i%
MsgBox (msg$)

' Release memory
Set dwg = Nothing
Set app = Nothing
End Sub

Logged
Gray