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

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

VB API get the text from a drawing table cell

AlexCote
12-Amethyst

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?

ACCEPTED SOLUTION

Accepted Solutions
AlexCote
12-Amethyst
(To: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 !!!

View solution in original post

1 REPLY 1
AlexCote
12-Amethyst
(To: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 !!!

Announcements


Top Tags