Reply
Solved! Go to solution

Problems with the BendTable Object Methods

Hello to all Users,

Customizing an example found in SDK documentation I 've got some problems with the BendTable Object Methods:

 

Code below get no errors but it does not delete anything too

            If objBendTable.ColumnCount > 6 Then
                    For I = objBendTable.ColumnCount to 7 Step -1
                    ' Delete all user defined columns
                    Call objBendTable.DeleteColumn(I)
                Next I
            Else
                MsgBox("No user defined Columns to delete")
            End If

SetColumnDataOptions method works only in adding columns but not in editing existing ones, even though they were inserted as EditableList=True as shown below. Is that right?

Call objBendTable.SetColumnDataOptions(Colonna_Coltello, DispEntry1, True, 2, EntryData)

Running the code below, GetBendDataEx method works fine but calling SetBendUserData gets "E_INVALIDARG" (although Variables type is correct)

For I = 1 To objBendTable.BendCount
   Call objBendTable.GetBendDataEx(I, featureName, BendRadius, BendAngle, BendDirection, BendIncludeAngle)
      PZL = (BendRadius * 1000 + NeutralFactor * MatThck) * BendAngle
      INTSZ = 2 * ((BendRadius * 1000 + MatThck) / Math.Tan(BendIncludeAngle / 2))
      AccTrumpf = PZL - INTSZ 
   Call objBendTable.SetBendUserData(I, 10, AccTrumpf)
Next

Can Anybody help me?
Thank you!

1 REPLY
Solution
Solution
Accepted by topic author POLARIA_Fil
‎09-22-2016 04:01 AM

Re: Problems with the BendTable Object Methods

Finally I've found the bugs (my mistakes ...) by myself:

 

the "Index" required by DeleteColumn and SetBendUserData methods is not the "position" displayed on screen in the Bend Table dialog (.psm) but the "serial" given by the program vhen the column was created. The match between "Index" (or "Id") of a column and its position in the Bend Table could be obtained (API) with the property ColumnId(N), where N=position.
SetColumnDataOptions method works only in editing option list and not in editing displayed value. To do that you must use the SetBendUserData method.

 

So the correct codes are:

 

If objBendTable.ColumnCount > 6 Then
   For I = objBendTable.ColumnCount to 7 Step -1
ColumnId = objBendTable.ColumnId(I) ' get internal ColumnId by position Call objBendTable.DeleteColumn(ColumnId) ' Delete all user defined columns
Next I
Else
MsgBox("No user defined Columns to delete")
End If
For I = 1 To objBendTable.BendCount
    Call objBendTable.GetBendDataEx(I, featureName, BendRadius, BendAngle, BendDirection, BendIncludeAngle)
        PZL = (BendRadius * 1000 + NeutralFactor * MatThck) * BendAngle
        INTSZ = 2 * ((BendRadius * 1000 + MatThck) / Math.Tan(BendIncludeAngle / 2))
        AccTrumpf = PZL - INTSZ 
ColumnId = objBendTable.ColumnId(I) ' get internal ColumnId by position
Call objBendTable.SetBendUserData(ColumnId, 10, AccTrumpf)
Next