Showing posts with label Macro in CATIA. Show all posts
Showing posts with label Macro in CATIA. Show all posts

Saturday, 10 June 2017

Catia run by VBScript

If you want to start/run CATIA by VBScript then it's easy by this program.
Just copy this program and save in ".vbs" format.

Program


Dim CATIA
Set CATIA = WScript.CreateObject("CATIA.Application")
CATIA.Visible=True

  
      




Download VBScript File- Click Here

                                Video Tutorial




Sunday, 2 April 2017

How to Wright my program in CATIA Macro.

Wright our requireded Program by Visual Basic Editor 


If you are going to use Visual Basic Editor first time then follow steps.

1- Go on Tools and select it.


2- Select Visual Basic Editor.



3- It will ask from you to use saved file or create new file for macro.
       Select "Yes".



4-Selection of Macro Libraries, In which you can edit in existing macro file or can create new macro file.
Select Create New Library if you want to create new file.

 

5- When you Select "Create New Library then of provides you to save your life at any perticular location with a specific name.
Press OK after given location and name to file.




and it will add in Macro Library.and Double click on File/library to open for edit.

6- Graphics of Visual Editor in this pics.



7- For Wright your own program-open the module in Visual Basic Editor and it can be open by two ways.
            A- Go in "Insert" Option-> Module.
           B- Right Click on project-> Inset-> Module.
*Module provides you plateform to wright your program and run it.




8- Rename your module and on white screen you can wright your program.
For Run/Play your program/Macro Press on Play Botton or Press fn+f5.



9- I wrote a simple msg in program which will come on screen when i will start this program, but you can wright your own program which type of operation you want.
Output-


For programs/Macro in CATIA -Click Here
youtube Channel tutorials- Click Here

Friday, 31 March 2017

Save as CATIA File by Macro

Program

To Save As  Active CATIA File at other location with new name by Macro in CATIA.

*A-Drive partition name. Ex- C
*B-Folder name in Which you want to save. Ex- New Folder
*C-File Name by which you want to save as your file. Ex- my test file


Sub main()

CATIA.ActiveDocument.saveAs ("A:\B\C")

End Sub
 

Save File by Macro in CATIA

Program

To Save Active CATIA File by Macro in CATIA.



Sub main()

CATIA.ActiveDocument.save

End Sub

Thursday, 30 March 2017

To know opened windows/files in CATIA by Macro

Program

For print/msg/Know windows open in CATIA by Macro.



Sub main()

MsgBox CATIA.Windows.count

End Sub

To Close Active file in CATIA by Macro

Program

For Active Window/file close in CATIA by Macro.
*Atleast one must be open.


Sub main()

CATIA.ActiveDocument.Close

End Sub

Find location of saved file in CATIA Macro.

Program

For print/msg/Know the file location where active file is saved in CATIA Macro.
*File must be saved first.


Sub main()

MsgBox CATIA.ActiveDocument.Path

End Sub

Sunday, 26 March 2017

Find Name of Catia File name by Macro (API)

Program

For print/msg/Know the file name of CATIA.


Sub main()

MsgBox CATIA.ActiveDocument.Name

End Sub

Macro (API) Start in CATIA

Introduction

A set/Single instruction which works automatically for done many task to perform.
Format- *.Catvba*




How to Start Macro in CATIA.

1st-For Starting macro in CATIA go on Tools Option.


2nd- After selecting tool option you will get macro option.


3rd- In Macro you will get more option.
         A- Macros:- This option allows to run/play/start macro which is already made/saved/programed and also provides to edit the macro program by the help of Visual Basic Editor.

        B- Start Recording:- This Option Allows you to record your macro.

        C- Stop Recording:- This option give the permission to stop the recording at the time of recording. Means this option works when you are recording macro.

       D- Visual Basic Editor:- This Editor used to edit your program/Macro as per your need/ Requirement and also provides you many advance feature for Automation.