TurboCAD Forums

The Ultimate Resource for TurboCAD Knowledge

Register
 
When posting a problem be sure to include which version you are using.  Give as much information as possible.  If the problem is with a specific file be sure to attache it to your post.

accessing workplane
Read 1013 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