cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X

VB API get the text from a drawing table cell

AlexCote
7-Bedrock

VB API get the text from a drawing table cell

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?

1 ACCEPTED SOLUTION

Accepted Solutions

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 !!!

View solution in original post

1 REPLY 1

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 !!!

Top Tags