Skip to main content
1-Visitor
December 19, 2019
Solved

VB API get the text from a drawing table cell

  • December 19, 2019
  • 1 reply
  • 2371 views

Hi,

... I also posted this in "Assembly Design" group on an old thread revival (link)

I get into a problem with the VB API and I cannot figure out, using this code:

 

	Private Function GetCellText(TheTable As IpfcTable, rIdx As Integer, cIdx As Integer) As String
		Try
			Debug.Print("Number of lines in table: " & TheTable.GetRowCount)
			Debug.Print("Number of columns in table: " & TheTable.GetColumnCount)

			Dim MyCell As IpfcTableCell = (New CCpfcTableCell).Create(rIdx, cIdx)
			Dim MyText As Cstringseq = TheTable.GetText(MyCell, 0)

			Return MyText(0).ToString

		Catch ex As Exception
			MsgBox(ex.Message & vbNewLine & vbNewLine & ex.StackTrace,, GetCurrentMethod().Name)
			Return Nothing
		End Try
	End Function

 

I get an exception from xToolkit at the line "Dim MyText As Cstringseq = TheTable.GetText(MyCell, 0)" but I can't find what I am doing wrong.

image.png

Any idea?

Best answer by AlexCote

The code I posted earlier works fine .... as long as you use the right version of Visual Studio !!!

Darn, I was using VS2017 ... now in VS2015 it works fine. I forgot about those version compatibility !!!

1 reply

AlexCote1-VisitorAuthorAnswer
1-Visitor
December 19, 2019

The code I posted earlier works fine .... as long as you use the right version of Visual Studio !!!

Darn, I was using VS2017 ... now in VS2015 it works fine. I forgot about those version compatibility !!!