Generate Code Automatically with Snippets

Generate Code Automatically with Snippets

Generate Code Automatically with Snippets

Arc's snippet system lets you insert battle-tested blocks of TM1 code in seconds using the auto-complete menu — no need to write repetitive code from memory.


How to Use Snippets

  1. Open a TI process or rule in Arc.

  2. In any process tab (Prolog, Metadata, Data, or Epilog), press CTRL+SPACE to open the auto-complete panel.

  3. Type part of the snippet name to filter the list (e.g. type while to see loop snippets).

  4. Select the snippet — the code block is inserted at your cursor position.


What Appears in the Auto-Complete Panel

When you press CTRL+SPACE, Arc shows:

Item Type

Description

Item Type

Description

Variables

All variables defined in the current TI process

Processes

All TM1 processes from connected instances

TM1 Functions

All TM1/Planning Analytics built-in functions

Snippets

Pre-written code blocks for common patterns


Navigating Snippet Placeholders

After inserting a snippet, use the Tab key to jump between placeholders in the code. Placeholders appear as highlighted text (e.g. ${1:dimensionName}).

Linked placeholders: If the same placeholder appears in multiple locations (e.g. a dimension name used in several functions), updating one occurrence automatically updates all others.


Example: "While Loop Through Dimension"

  1. Press CTRL+SPACE and type while

  2. Select While loop through dimension

  3. The loop structure is inserted. Press TAB to move to each placeholder and fill in the dimension name, subset name, etc.


Built-In Snippet Library

Arc ships with a large library of pre-built snippets covering:

  • Loop patterns (while loops, element iterations)

  • Hierarchy functions (HierarchyExists, HierarchyCreate, etc.)

  • Bedrock process calls

  • Error handling patterns

  • Cell manipulation (CELLGET, CELLPUT, DB functions)


Related Pages