Celebrating our 20 year anniversary

Thmyl-catia-v5 Link

Dim faceRef As Reference Set faceRef = sel.Item(1).Value

' Create a hole Dim hybridBodies As HybridBodies Set hybridBodies = part.HybridBodies Dim hb As HybridBody Set hb = hybridBodies.Add() Dim factory2D As Factory2D Set factory2D = hb.HybridShapeFactory

Dim hole As HybridShapeHole Set hole = factory2D.AddNewHole(faceRef, 10#, 0#, 20#, 0#, 0#, 0#) hb.AppendHybridShape hole part.Update thmyl-catia-v5

1. Introduction: What is THMYL-CATIA V5? THMYL-CATIA V5 refers to a collection of scripts, macros, tutorials, and best practices – often shared within engineering communities – designed to automate repetitive tasks, enforce design standards, and extend CATIA V5’s native capabilities. The acronym THMYL might stand for a personal brand, a company internal code (e.g., “Thiết kế Mô hình Yếu tố Lắp ráp” – Vietnamese for Design Model Assembly Factors), or a forum username. Regardless, it represents a practical, code-first approach to mastering CATIA V5 through VBA (Visual Basic for Applications), CAA (Component Application Architecture), or Knowledgeware.

MsgBox "THMYL Hole created successfully" End Sub THMYL sometimes includes Knowledgeware (.CATRule) files that enforce design standards. Example: Dim faceRef As Reference Set faceRef = sel

Wall thickness must be between 2mm and 5mm for injection-molded parts.

| Category | Example Function | THMYL Script Snippet (VBA) | |----------|----------------|----------------------------| | | Create a parametric gear | Set sketch = part.Sketches.Add(plane) Call sketch.OpenEdition() | | Assembly | Auto-mate bolted connections | product.Products.AddNewComponent("Part","Bolt") | | Drawing | Batch PDF export | drawing.ExportDrawing "C:\output.pdf", "PDF" | | Analysis | Check for unconstrained sketches | sketch.GetStatus("IsoConstraint") | Note: Actual THMYL scripts are often longer and include error handling. 4. Sample THMYL-Style Macro: Automatic Hole Series Below is a simplified version of what a THMYL macro might do – create a pattern of holes on a selected face. The acronym THMYL might stand for a personal

Sub THMYL_CreateHolePattern() Dim CATIA As Object Set CATIA = GetObject(, "CATIA.Application") Dim partDoc As PartDocument Set partDoc = CATIA.ActiveDocument Dim part As Part Set part = partDoc.Part ' Select a planar face Dim sel As Selection Set sel = partDoc.Selection sel.Clear() MsgBox "Select a planar face, then press OK" sel.SelectElement2(, "Planar face", True)