Hello,
I am trying to learn Macro's in CATIA and attempted by
starting to record VBA Macros in Advanced Machining for a simple
operation.
I am trying to save the video result of the operation but
when I run the recorded Macro I get an error stating that "The
method GetItem failed.
This is the code and the error is thrown in Set
manufacturingProgram1 =
processDocument1.GetItem("Program1") as highlighted in
red.
Thanks for any help or suggestions.
Language = "VBSCRIPT"
Sub CATMain()
Set settingControllers1 = CATIA.SettingControllers
Set visualizationSettingAtt1 = settingControllers1.Item("CATVizVisualizationSettingCtrl")
Dim boolean1
boolean1 = visualizationSettingAtt1.NoZBufferSelectionMode
visualizationSettingAtt1.NoZBufferSelectionMode = False
Set specsAndGeomWindow1 = CATIA.ActiveWindow
Set viewer3D1 = specsAndGeomWindow1.ActiveViewer
Set viewpoint3D1 = viewer3D1.Viewpoint3D
Dim manufacturingGeneratorData1
' No resolution found for the object manufacturingGeneratorData1...
Dim processDocument1
Set processDocument1 = CATIA.ActiveDocument
Dim manufacturingProgram1
Set manufacturingProgram1 = processDocument1.GetItem("Program.1")
Set cATMfgPrismaticActivity1 = manufacturingProgram1.GetItem("Operation.1")
manufacturingGeneratorData1.SetLastObjectToGenerate cATMfgPrismaticActivity1
Set manufacturingAPTGenerator1 = processDocument1.GetItem("Program.1")
manufacturingAPTGenerator1.RunFileGenerator manufacturingGeneratorData1
Set specsAndGeomWindow2 = CATIA.ActiveWindow
Set viewer3D2 = specsAndGeomWindow2.ActiveViewer
Set viewpoint3D2 = viewer3D2.Viewpoint3D
End Sub