SolidWorksMakroprogrammierung

Methode · TableAnnotation

SetCellTextFormat-Methode (TableAnnotation)

Setzt das Textformat einer Zelle einer Tabelle, oder stellt es auf die Vorgabe des Dokuments zurück.

Syntax

Function SetCellTextFormat( _
   ByVal Row As Long, _
   ByVal Column As Long, _
   ByVal UseDoc As Boolean, _
   ByVal TextFormat As TextFormat _
) As Boolean
bErfolg = swTable.SetCellTextFormat(Row, Column, UseDoc, TextFormat)

Parameter

RowLongByVal
Zeile der Zelle, beginnend bei 0.
ColumnLongByVal
Spalte der Zelle, beginnend bei 0.
UseDocBooleanByVal
True: Format aus dem Dokument. False: TextFormat gilt.
TextFormatTextFormatByVal
Das neue Textformat (TextFormat).

Rückgabewert

True, wenn das Format gesetzt wurde, sonst False.

Beispiel

' swTable ist eine Tabelle (TableAnnotation) mit Kopf in Zeile 0.
Dim swTextFormat As SldWorks.TextFormat
Dim j As Long
For j = 0 To swTable.ColumnCount - 1
    Set swTextFormat = swTable.GetCellTextFormat(0, j)
    swTextFormat.Bold = True
    swTable.SetCellTextFormat 0, j, False, swTextFormat
Next j

Bemerkungen

Was bei UseDoc = True für TextFormat übergeben werden soll, sagt die Hilfe hier nicht. Bei Annotation.SetTextFormat nennt sie dafür Nothing. Für die ganze Tabelle gibt es TableAnnotation.SetTextFormat.

Siehe auch

Verfügbarkeit

SOLIDWORKS 2004

Englisches Original: ITableAnnotation::SetCellTextFormat in der SOLIDWORKS API-Hilfe ↗ (dort mit dem .NET-Namen)

Fragen zu diesem Befehl oder ein Befehl fehlt? Frag im Discord.