Continue to Site

Welcome to MCAD Central

Join our MCAD Central community forums, the largest resource for MCAD (Mechanical Computer-Aided Design) professionals, including files, forums, jobs, articles, calendar, and more.

Error when getting the document

kalyankm

New member
Hi Everyone,


I need some help with the following macro. When I run it, it fails when GetItem("ManufacturingProgram.1") is being executed. Any help is greatly appreciated.


Thanks,


Kalyan





Language="VBSCRIPT"


Sub CATMain()


Dim processDocument1 As Document
Set processDocument1 = CATIA.ActiveDocument


Dim manufacturingAPTGenerator1 As CATBaseDispatch
Set manufacturingAPTGenerator1 = processDocument1.GetItem("Manufacturing Program.1")


manufacturingAPTGenerator1.InitFileGenerator "APT", "D:\Users\kal\Misc\CATIA\Process1_Manufacturing_Program_2.ap tsource", manufacturingGeneratorData1


manufacturingAPTGenerator1.RunFileGenerator manufacturingGeneratorData1


manufacturingGeneratorData1.ResetAllModalValues


End Sub
 

Sponsor

Articles From 3DCAD World

Back
Top