Hallo zusammen,
ich habe folgenden VBA-Code, den ich in CATIA verwende:
Sub Positionieren(productToMove As Product, XCoord() As Double, YCoord() As Double, ZCoord() As Double, Position() As Variant)
Dim move1 As Move
Dim arrayOfVariantOfDouble1(11)
'1 Richtung X
arrayOfVariantOfDouble1(0) = XCoord(0)
arrayOfVariantOfDouble1(1) = XCoord(1)
arrayOfVariantOfDouble1(2) = XCoord(2)
'2 Richtung Y
arrayOfVariantOfDouble1(3) = YCoord(0)
arrayOfVariantOfDouble1(4) = YCoord(1)
arrayOfVariantOfDouble1(5) = YCoord(2)
'1 Richtung Z
arrayOfVariantOfDouble1(6) = ZCoord(0)
arrayOfVariantOfDouble1(7) = ZCoord(1)
arrayOfVariantOfDouble1(8) = ZCoord(2)
'Translation in Richtung x
arrayOfVariantOfDouble1(9) = Position(0)
'Translation in Richtung Y
arrayOfVariantOfDouble1(10) = Position(1)
'Translation in Richtung Z
arrayOfVariantOfDouble1(11) = Position(2)
productToMove.Position.SetComponents arrayOfVariantOfDouble1
End Sub
Beim Ausführen der Zeile: productToMove.Position.SetComponents arrayOfVariantOfDouble1
bekomme ich die Fehlermeldung: "Function or interface marked as restricted or the function uses an automation Type not supported in Visual Bsic"
Ich habe bereits versucht, arrayOfVariantOfDouble1 als Variant zu deklarieren, aber leider ohne Erfolg.
Frage:
Hat jemand eine Idee, woran dieser Fehler liegen könnte?
Insbesondere interessiert mich, wie ich die SetComponents-Methode korrekt verwenden kann. Gibt es vielleicht einen speziellen Datentyp oder ein Format, das hier erforderlich ist?
Vielen Dank im Voraus für jede Hilfe!
Von Ralf Tide am 10.06. aus dem Dokumente-Forum hierher verschoben...
Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP