VB API how to set the text font / text style in a table using vb api.
Hi All,
I have a VB program who does connect to creo and modify an existing table.
The problem is that it does not use the text font already set in the table.
My font is set to a TTF font "consolas" and height set to 0.09375"
when the program run it change the height to 0.15625" I dont get why!!!!
here is a breif section of the code.
Dim drwTableCell As IpfcTableCell 'ICpfcTableCell
Dim drwTable As IpfcTable = Nothing
Dim cellTxt As String
Dim lines As New Cstringseq
Dim drawing As IpfcDrawing
Dim drwTables As IpfcTables
Dim i As Integer
Dim asyncConnection As IpfcAsyncConnection = Nothing
Dim connSession As IpfcBaseSession
Dim model As IpfcModel
Try
'**** Connexion en cours
asyncConnection = (New CCpfcAsyncConnection).Connect(Nothing, Nothing, Nothing, Nothing)
model = asyncConnection.Session.CurrentModel
If model Is Nothing Then
Throw New Exception("Pas de modele")
End If
connSession = asyncConnection.Session
'**** recuperer l'extension
exten = Mid(model.FileName, Len(model.FileName) - 2, 3)
If exten <> "drw" Then
Throw New Exception("Modele doit être un dessin")
End If
drawing = model
drwTables = drawing.ListTables()
'**** trouver la table des révisions ID9
For i = 0 To drwTables.Count - 1
drwTable = drwTables(i)
tblName = drwTable.id.ToString
If tblName = "9" Then Exit For
Next
cellTxt = "some text"
drwTableCell = (New CCpfcTableCell).Create(2, 1)
lines.Insert(0, cellTxt)
drwTable.SetText(drwTableCell, lines)
Catch ex As Exception
MsgBox(ex.Message.ToString + Chr(13) + ex.StackTrace.ToString)
End Try
Thanks for any help
This thread is inactive and closed by the PTC Community Management Team. If you would like to provide a reply and re-open this thread, please notify the moderator and reference the thread. You may also use "Start a topic" button to ask a new question. Please be sure to include what version of the PTC product you are using so another community member knowledgeable about your version may be able to assist.

