Hi All...I created a simple VBA code to demonstrate the SendKeys command. However, when the very first camera name appears, the SendKeys {"ENTER"} command does not work. I have to manually press Enter key on the keyboard in order to have the loop to continue. SendKeys {"ENTER"} does work on 2nd camera display and after.
So, how could I make the first SendKeys {"ENTER"} command work?
-------------------------
Sub CAMERA()
'//// Display total number of cameras in active document
MsgBox CATIA.ActiveDocument.Cameras.Count
Dim oCamera3D As Camera3D
Dim CameraIdent
For CameraIdent = 1 To CATIA.ActiveDocument.Cameras.Count
Next
CATIA.StartCommand "Fit All In"
End Sub
---------------------
Your help is much appreciated.
So, how could I make the first SendKeys {"ENTER"} command work?
-------------------------
Sub CAMERA()
'//// Display total number of cameras in active document
MsgBox CATIA.ActiveDocument.Cameras.Count
Dim oCamera3D As Camera3D
Dim CameraIdent
For CameraIdent = 1 To CATIA.ActiveDocument.Cameras.Count
Set oCamera3D = CATIA.ActiveDocument.Cameras.Item(CameraIdent)
MsgBox oCamera3D.Name '//// Display camera's name
CATIA.RefreshDisplay = True
SendKeys "{ENTER}"Next
CATIA.StartCommand "Fit All In"
End Sub
---------------------
Your help is much appreciated.