Use AHK to control CATIA about ComObjArray issue

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
chenyjay
Posts: 2
Joined: 19 Apr 2023, 10:19

Use AHK to control CATIA about ComObjArray issue

Post by chenyjay » 19 Apr 2023, 10:26

Hello, everyone

Code: Select all

#Requires AutoHotkey v2.0
CATIA := ComObjActive("Catia.Application")
parDoc := CATIA.ActiveDocument
par := parDoc.Part
gset := par.HybridBodies.Item(1)
point := gset.HybridShapes.Item(1)
xyz := ComObjArray(12, 3)
xyz[0] := 200
xyz[1] := 250
xyz[2] := 350
point.SetCoordinates(xyz)
par.Update

xyz0 := ComObjArray(12, 3)
point.GetCoordinates(xyz0)
MsgBox xyz[0]
Sub SetCoordinates is work OK, But GetCoordinates is not enabled. The code is not reported wrong, but xyz[0] is empty string, What's the problem ?

Return to “Ask for Help (v2)”