hexagon logo

How to access the hits that comprise a feature?

I've tried the following basic code (generated by the OldBasic converter).

Sub main

Dim i, j, k As Integer ' working vars
Dim tpoint As Object
Set tpoint = CreateObject("PCDLRN.PointData")

Dim AutoApp As Object
Set AutoApp = CreateObject("PCDLRN.Application")
Dim AutoPart As Object
Set AutoPart = AutoApp.ActivePartProgram
Dim AutoOldBasicOb As Object
Set AutoOldBasicOb = AutoPart.OldBasic
i = AutoOldBasicOb.StartGetFeatPoint("CIR1",PCD_MEAS, PCD__BALLCENTER)
For j = 1 To i
msgbox i & " - " & j
AutoOldBasicOb.GetFeatPoint( tpoint, j)
msgbox "Got past the GetFeatPoint call"
Next j
End Sub

The circle ("C1") has four points, which the call to AutoOldBasicObStartGetFeatPoint returns correctly.

However, the call to AutoOldBasicOb.GetFeatPoint( tpoint, j) has two problems:

1. It won't run if I attempt to assign the result of this funtion to an integer (e.g. k = AutoOldBasicOb.GetFeatPoint( tpoint, j) ) I get a type mismatch error, which indicates that the function is not returning an integer as indicated in the manual.

2. Once executed, the program blows up without an error, and ceases to run. That is, I'll never get to the second MSGBOX call.

Is there another way to get at the basic hit data for this circle? I can find non-OldBasic objects that let me get at the dimensions of it, but not the individual hits themselves. This is more than a little exasperating...
Parents Reply Children
No Data