CATScript - An Object-Oriented Programming Approach

Table of Content: OOP What is it good for? Let’s give it a trial Supported or not supported ? CustomMessenger - a practical example Here is the code For education purpose only: An Object-Oriented Programming Approach with CATScript Object-oriented programming (OOP) is not commonly used in CATScript macros, or at least, there is not so much information and sample-code available on the web or in various books and documentation I looked at. Continue reading...

Notepad++ "Function List" for CATScript (and VBS)

Purpose This is how to get the “Function List” in n++ up and running when editing CATScript source code files. I am using the Notepad++ text editor for quite a while and was not aware about the “Function List”, which is quite handy to navigate through the source. The “Function List” when activated, works seamlessly for most of the known languages. Unfortunately, after selecting “Visual Basic” as programming language, the “Function List” window initially is kept empty and does not show any of the language specific functions. Continue reading...

Delete all unused Details

Delete all unused Details Purpose: This CATScript macro for Catia can be used to delete all unused details which are currently available in one of the available detail sheet(s). An unused detail hereby is a detail which is not referenced in any of the available drawing views in a CATDrawing. Description: Take a look at the source code: Usage of the macro: The macro can be used as is, no pre-configuration is needed. Continue reading...

CATSkript - Voronoi Mesh Generator

Mesh Generator als Catia-Makro Demo 1 Demo 2 Demo 3 -- Vorwort: Der Mesh Generator erzeugt automatisch eine Voronoi Struktur. Als Eingabe dient dabei ein Sketcher (Catia) mit einer 2D-Punktewolke. Die Punktewolke kann dabei regelmäßig (auskonstruiert) oder scheinbar regellos sein. Die Reihenfolge der Punkte spielt für die Generierung der Struktur (Mesh) keine Rolle. Punkte können beliebig ergänzt oder entfernt werden. Continue reading...

Export Binary STL

Export Binary STL Purpose: This script can be used to save the actual catpart as a binary STL file. You can easily create STL files with the “Catia SaveAs..” native dialog. The only drawback is that Catia by default creates STL in plain text format. The benefit of a binary STL file format: file size is abut factor 5 smaller so you can save quite a lot of space on the file server, Continue reading...

Rename Partname to Filename

Rename Partname to Filename The script can be used to ensure that the part name (inside the CAD-Model) is the same as the given file name. The script recursively scans a given directory and takes any “.CATPart” + “.CATProduct” model into account. Once this is done, the file name of each catia file is used to re-define each individual model’s partname (if required) and the current file is saved back to disk. Continue reading...

Delete Empty Part Bodies

Delete Empty Part Bodies A utility CATScript macro for CatiaV5 to clean up a all empty PartBodies in a CATPart. Desciption: Source-Code: Usage: Assuming that one needs to clean e.g. a CATAllPart from all unnecessary geometry. After the clean operation (by selecting geometry visually on the screen rather than in the object tree) a lot of empty PartBodies might remain. In such a case, executing the macro is much faster than going through the object tree to manually select and delete those empty PartBodies. Continue reading...

Export All Drawings 2 PDF

Export All Drawings 2 PDF Purpose This utility CATScript macro for CatiaV5 can be used to create PDF documents for all CATDrawing files which are stored in a directory structure. Starting from a given directory, the function recursively searches all sub-directories, trying to find every drawing document down below the directory tree. Remark The Macro does not modify any data, CAD models are opened and closed without modification. Continue reading...

Product To Step Export

Product To Step Export Purpose: A CATScript macro for CatiaV5 which allows to export all individual 3D models which belong to the current product to STEP format. Using this macro could be a real time saver, especially if the models are very big, or if there are a lot of 3D models which needs to be exported. .hint.info { border-left-color: #6bf; background-color: rgba(102,187,255,.1) } .hint.warning { border-left-color: #fd6; background-color: rgba(255,221,102,. Continue reading...

Customized Save

Customized Save Purpose: The purpose of this CATIA macro is to make sure that a model is saved in a standardized way. During the design, a model is usually saved “on the fly” and in its current design state. This means the object tree is expanded to a certain level, there are wire-frame and surfaces in shown, the model might contain useless or obsolete or inactive geometry, etc… Once a design is finished and it needs to pass the checking an release procedure, it is important to guarantee a set of common save conditions. Continue reading...