Create a Rectangle in CATScript - Catscript Typing CST Test
Loading…
Create a Rectangle in CATScript — Catscript Code
Draws a rectangle by creating four lines connecting points.
Dim partDoc As PartDocument
Set partDoc = CATIA.ActiveDocument
Dim part As Part
Set part = partDoc.Part
Dim factory As ShapeFactory
Set factory = part.ShapeFactory
Dim p1, p2, p3, p4 As HybridShapePointCoord
Set p1 = factory.AddNewPointCoord(0, 0, 0)
Set p2 = factory.AddNewPointCoord(10, 0, 0)
Set p3 = factory.AddNewPointCoord(10, 5, 0)
Set p4 = factory.AddNewPointCoord(0, 5, 0)
factory.AddNewLine(p1, p2)
factory.AddNewLine(p2, p3)
factory.AddNewLine(p3, p4)
factory.AddNewLine(p4, p1)
part.UpdateCatscript Language Guide
CatScript is a lightweight, interpreted scripting language designed for creative coding, educational purposes, and playful programming projects. It emphasizes simplicity, fun, and accessibility for beginners while supporting modular scripts and animations.
Primary Use Cases
- ▸Teaching programming to beginners
- ▸Simple animations and games
- ▸Interactive storytelling
- ▸Prototyping creative apps
- ▸Educational coding platforms
Notable Features
- ▸Simple syntax with minimal boilerplate
- ▸Event-driven programming support
- ▸Built-in animation and drawing functions
- ▸Interactive console for immediate feedback
- ▸Modular script support for reusability
Origin & Creator
CatScript was developed by indie developers and educators seeking a playful scripting language to teach programming concepts to beginners and hobbyists.
Industrial Note
While not industrial-grade, CatScript is popular in educational tools, coding workshops, and creative coding communities where ease-of-use and rapid experimentation are more important than performance or safety-critical guarantees.