2. The CNC Editor
Code Regions
Code regions are special editor features that enable collapsible sections within CNC code.
Overview
The special editor codes #region and #endregion are used to create collapsible regions in the text.
Syntax
#region Region Name
G00 X0 Y0 Z10
G01 Z-5 F100
G01 X50 Y50
G00 Z10
#endregion
Functionality
Collapsing Regions
You can click the minus (-) symbol adjacent to the #region command to hide the section.
Expanding Regions
Clicking the plus (+) sign next to three dots will reveal a collapsed region.
Preview Feature
Hovering the mouse cursor over the three dots displays a preview of the hidden content without fully expanding it.
Practical Application
Note: SimCam automatically generates these commands for initial simulator settings, so that they can be easily hidden during a simulation.
Code regions are useful for:
- Organizing long programs into logical sections
- Hiding initial configurations during simulation
- Improving code readability
- Grouping related operations
