TurboCAD Forums

SDK Corner => SDK Tips and Tricks => Topic started by: Ken Garoo on March 27, 2017, 05:26:27 PM

Title: accessing workplane
Post by: Ken Garoo on 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
Title: Re: accessing workplane
Post by: grayfin on June 19, 2017, 02:01:08 AM
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