SolidWorksMakroprogrammierung

Methode · DisplayDimension

AddDisplayText-Methode (DisplayDimension)

Zeigt vorübergehend eigenen Text an Stelle des Maßtexts.

Syntax

Function AddDisplayText( _
   ByVal Text As String, _
   ByVal Position As Variant, _
   ByVal Format As Object, _
   ByVal Attachment As Integer, _
   ByVal WidthFactor As Double _
) As Boolean
bErfolg = swDispDim.AddDisplayText("Ersatz", vPos, swTextFormat, swTextJustificationLeft, 1)

Parameter

TextStringByVal
Der Text.
PositionVariantByVal
Array mit drei Double-Werten X, Y, Z.
FormatObjectByVal
Das TextFormat.
AttachmentIntegerByVal
Ausrichtung, ein Wert aus swTextJustification_e.
WidthFactorDoubleByVal
Breitenfaktor des Texts, 1 für normal.

Rückgabewert

True, wenn es geklappt hat, sonst False.

Beispiel

' swDispDim ist eine DisplayDimension, etwa aus Feature.GetFirstDisplayDimension oder der Auswahl.
Dim swAnn As SldWorks.Annotation
Set swAnn = swDispDim.GetAnnotation
If False = swDispDim.AddDisplayText("siehe Tabelle", swAnn.GetPosition, swAnn.GetTextFormat(0), swTextJustificationLeft, 1) Then Debug.Print "Nicht gesetzt"

Bemerkungen

Der Text ist vorübergehend: Sobald jemand die Bemaßung ändert, erscheint sie wieder normal. Dauerhaft ändert man den Text mit DisplayDimension.SetText.

Siehe auch

Verfügbarkeit

SOLIDWORKS 2001

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

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