CATIA Macro Writing Assistant: API Reference and Pitfalls for Writing CATIA Macros in AI Chat

Preface

In CATIA V5/V6, the common path for automating drawing annotations, part modeling, or assembly is to write CATScript, VBScript, or VBA macros, referencing the Automation API documentation for objects and methods. However, documentation is scattered, syntax differs significantly between CATScript and VBA, and online examples may not cover your specific workbench. Below is an introduction to the CATIA Macro Writing Assistant (@user_cf90b6c5/catia-marco) on SkillHub: it consolidates macro-related API descriptions, syntax limitations, and known issues into a single Skill. In environments supporting Skills like Cursor, it allows the model to generate or modify macros according to a consistent set of constraints.

What is this

The CATIA Macro Writing Assistant is a community Skill for CATIA macro development (Source: community, Category: dev-programming, Current Version: 1.0.0). It is published by SkillHub user user_cf90b6c5 and tagged with requires_api_key=false, meaning installation and use do not depend on an additional API Key.

In one sentence: It is a toolkit specifically for writing, debugging, and modifying CATIA V5/V6 automation macros. Loading it while writing macros acts like having a searchable API manual right beside you, complete with CATScript syntax boundaries and a log of past pitfalls.

Core Features

The following capabilities are based on the official SkillHub page description and can be tailored for use as needed.

Macro Language & Workbench Coverage

  • Supports macro writing and modification for CATScript / VBScript / VBA.
  • Covers scenarios such as drawing annotation, part design, and assembly (consistent with programming tasks mentioned in the intro, such as “drawing automation, dimension annotation, view and drawing sheet operations, component search”).

API & Examples

  • Built-in complete documentation for 214 CATIA API interfaces, facilitating the lookup of methods and properties.
  • Provides 10 official macro examples for direct reference or modification.

Syntax Limitations (CATScript)

Lists 11 CATScript syntax limitations to reduce instances of “code writes successfully but fails at runtime.” Official examples include:

  • Cannot use For Each
  • Cannot use Format(), etc.

Known Pitfalls

Records 12 issues encountered during actual development to avoid repetitive troubleshooting. Official examples include:

  • GetRealColor cannot read colors
  • GetPaperDimensions method does not exist

Installation & Activation

The installation method provided on the SkillHub page involves instructing the AI to pull the specified coordinates based on general installation instructions:

Please install `@user_cf90b6c5/catia-marco` according to https://skillhub.cn/install/skillhub.md.

The operation steps can be summarized as follows:

  1. In a client that supports SkillHub Skills (such as Cursor), send the above prompt to the AI, or open the skillhub installation instructions yourself and follow the documentation.
  2. Confirm the installation coordinates are @user_cf90b6c5/catia-marco; the version should be v1.0.0 (consistent with the page).
  3. Before starting a conversation related to writing or debugging CATIA macros, activate this Skill so that the model prioritizes following the included API descriptions, syntax limitations, and pitfall records.

Specific menus or commands for each client are subject to their respective documentation; if the official page does not separately list differences for Cursor / Codex CLI / Claude Code, the above coordinates and installation instructions prevail.

Typical Usage

The official materials do not include a complete line-by-line replicable macro project, but they clarify the usage method: Load this Skill during a macro development conversation and describe the goal to the AI (e.g., drawing annotation, view operations, searching for components in an assembly). The model will then generate or modify scripts based on the 214 API documentation entries, 10 examples, and 11 syntax limitations / 12 pitfalls.

Reproducible interaction example (statements must match your actual objects in CATIA):

  1. State the CATIA version (V5 or V6), macro type (CATScript / VBA, etc.), and current document type (engineering drawing, Part, Product, etc.).
  2. Describe the automation steps to be performed (e.g., batch annotation, switching drawing sheets, traversing assembly nodes).
  3. If a runtime error occurs, send the error message and relevant API names to the AI to troubleshoot against the limitations and pitfall entries within the Skill.

Through the above steps, the model should tend to avoid recorded CATScript “forbidden zones” and reduce calls to interfaces marked as problematic or non-existent in the documentation.

Use Cases & Notes

Who is it for

  • CAD secondary development, process, or drafting engineers who frequently need to write or modify CATIA macros.
  • Those hoping to reduce the time spent digging through scattered API documentation and repeatedly falling into the same types of API pitfalls.

Usage Notes

  • The Skill content is a community-maintained knowledge package; you still need to verify consistency with your local CATIA version and license modules in your local macro editor.
  • SkillHub page statistics (as of page display): Rating 100000, Downloads 1466, Installs 1; data is subject to the SkillHub detail page.
  • For complex logic, it is still recommended to maintain version control and perform step-by-step debugging within CATIA; the Skill assists in code generation but does not replace local testing.

Conclusion

The CATIA Macro Writing Assistant consolidates commonly used CATIA macro API descriptions, examples, CATScript syntax boundaries, and known API issues into a single Skill, making it suitable as a fixed context for AI pair programming. To install or check for updates, please visit the official entries:

  • API Page: https://api.skillhub.cn/user_cf90b6c5/catia-marco
  • SkillHub Page: https://www.skillhub.cn/skills/user_cf90b6c5/catia-marco
羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye