SolidWorksMakroprogrammierung

Methode · SafeArrayUtility

GetByte-Methode (SafeArrayUtility)

Liest ein Byte aus einem Variant-SafeArray mit Bytes.

Syntax

Function GetByte( _
   ByVal VariantArray As Variant, _
   ByVal Index As Long _
) As Byte
nWert = swUtil.GetByte(vWerte, nIndex)

Parameter

VariantArrayVariantByVal
Das Variant-SafeArray mit Bytes.
IndexLongByVal
Die Stelle des Bytes, ab 0.

Rückgabewert

Das Byte an der Stelle Index.

Beispiel

' swUtil ist das SafeArrayUtility-Objekt, swModel das aktive Dokument (ModelDoc2),
' swObj das ausgewählte Objekt.
Dim vId As Variant
Dim nAnzahl As Long, nTyp As Long, i As Long
vId = swModel.Extension.GetPersistReference3(swObj)
If IsEmpty(vId) Then Exit Sub
swUtil.GetInfo vId, nAnzahl, nTyp
For i = 0 To nAnzahl - 1
    Debug.Print swUtil.GetByte(vId, i);
Next i

Bemerkungen

So liest das C++-Beispiel „Get Object's Persistent Reference ID“ die persistente ID aus ModelDocExtension.GetPersistReference3.

Siehe auch

Verfügbarkeit

SOLIDWORKS 2015

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

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