SolidWorksMakroprogrammierung

Methode · SafeArrayUtility

GetDouble-Methode (SafeArrayUtility)

Liest eine Kommazahl aus einem Variant-SafeArray mit Kommazahlen (Double).

Syntax

Function GetDouble( _
   ByVal VariantArray As Variant, _
   ByVal Index As Long _
) As Double
dWert = swUtil.GetDouble(vWerte, nIndex)

Parameter

VariantArrayVariantByVal
Das Variant-SafeArray mit Kommazahlen.
IndexLongByVal
Die Stelle der Zahl, ab 0.

Rückgabewert

Die Zahl an der Stelle Index.

Beispiel

' swUtil ist das SafeArrayUtility-Objekt, swFlaeche eine ebene Fläche (Face2).
Dim vNormale As Variant
vNormale = swFlaeche.Normal
Debug.Print swUtil.GetDouble(vNormale, 0), swUtil.GetDouble(vNormale, 1), swUtil.GetDouble(vNormale, 2)

Bemerkungen

Das C++-Beispiel „Get Spline Points“ liest so die Punkte eines Splines. In VBA bekommst du dieselbe Zahl mit vNormale(0).

Siehe auch

Verfügbarkeit

SOLIDWORKS 2015

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

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