Look up exact rules and syntax

Exact syntax, commands, and configuration options for LogiDraft.

Functions

Expression Operators

  • + - * / %
  • == != > < >= <=
  • && ||

Lookup Tables

  • Structure: column-based
  • Queries: exact key lookup, numeric range lookup

Math And Trig

  • ABS
    ABS(number)
    Example: ABS(-5)
  • ACOS
    ACOS(number)
    Example: ACOS(0.5)
  • ASIN
    ASIN(number)
    Example: ASIN(0.5)
  • ATAN
    ATAN(number)
    Example: ATAN(1)
  • CEILING
    CEILING(number, significance, [mode])
    Example: CEILING(12.2, 5)
  • COS
    COS(angle)
    Example: COS(RADIANS(60))
  • DEGREES
    DEGREES(radians)
    Example: DEGREES(PI()/2)
  • FLOOR
    FLOOR(number, significance)
    Example: FLOOR(12.9, 5)
  • HYPOT
    HYPOT(x, y, ...)
    Example: HYPOT(Width, Height)
  • LN
    LN(number)
    Example: LN(10)
  • LOG
    LOG(number, base)
    Example: LOG(1000, 10)
  • MAX
    MAX(value1, value2, ...)
    Example: MAX(Width, Height)
  • MIN
    MIN(value1, value2, ...)
    Example: MIN(Width, Height)
  • MOD
    MOD(dividend, divisor)
    Example: MOD(Index, 2)
  • PI
    PI()
    Example: PI()
  • POW
    POW(base, exponent)
    Example: POW(2, 3)
  • RADIANS
    RADIANS(degrees)
    Example: RADIANS(45)
  • ROUND
    ROUND(number, [digits])
    Example: ROUND(Length / 25.4, 2)
  • SIN
    SIN(angle)
    Example: SIN(RADIANS(30))
  • SQRT
    SQRT(number)
    Example: SQRT(Area)
  • TAN
    TAN(angle)
    Example: TAN(RADIANS(45))
  • EXP
    EXP(number)
    Example: EXP(1)
  • SIGN
    SIGN(number)
    Example: SIGN(Offset)

Logic And Aggregates

  • IF
    IF(test, value_if_true, value_if_false)
    Example: IF(Motor_Qty == 2, 250, 150)
  • AND
    AND(a, b, ...)
    Example: AND(Width > 0, Height > 0)
  • OR
    OR(a, b, ...)
    Example: OR(State == "A", State == "B")
  • NOT
    NOT(value)
    Example: NOT(IsHidden)
  • SWITCH
    SWITCH(expression, value1, result1, [value2, result2, ...], [default])
    Example: SWITCH(Size, "S", 100, "M", 150, "L", 200, 0)
  • SUM
    SUM(a, b, ...)
    Example: SUM(Width, Height, Depth)
  • AVERAGE
    AVERAGE(a, b, ...)
    Example: AVERAGE(A, B, C)
  • COUNT
    COUNT(a, b, ...)
    Example: COUNT(A, B, C)
  • SUMIF
    SUMIF(range, criteria, [sum_range])
    Example: SUMIF([1,2,3], ">1")
  • COUNTIF
    COUNTIF(range, criteria)
    Example: COUNTIF([1,2,3], ">1")

Text

  • CONCATENATE
    CONCATENATE(text1, text2, ...)
    Example: CONCATENATE("P-", PartNo)
  • LEN
    LEN(text)
    Example: LEN(Label)
  • LOWER
    LOWER(text)
    Example: LOWER(Code)
  • REPLACE
    REPLACE(old_text, start_num, num_chars, new_text) | REPLACE(text, find_text, new_text)
    Example: REPLACE("MTR-100", "100", "125")
  • UPPER
    UPPER(text)
    Example: UPPER(Tag)

Lookup Tables

  • LUT_EXACT
    LUT_EXACT(tableName, outColumn, keyColumn, keyValue, ...)
    Example: LUT_EXACT("Sizes", "Width", "Code", "A")
    Additional key pairs continue as keyColumn, keyValue, keyColumn, keyValue.
  • LUT_RANGE
    LUT_RANGE(tableName, outColumn, keyColumn, keyValue, mode)
    Example: LUT_RANGE("Sizes", "Width", "Length", Length, "floor")
    Valid mode values are "floor" and "ceil".

Injection Syntax

Syntax

  • {Name}
    Example: {Width}
  • text with {Name}
    Example: Panel {PanelCode} - {Voltage}
  • =expression
    Evaluated formula.
    Example: =IF({Motor_Qty} == 2, 250, 150)

Parameters

  • Types: number, string, boolean
  • Value forms: literal, =expression, {Name}

Evaluation

  • {Name} resolves a scoped value.
  • =expression evaluates a formula result.

Injectable Fields

  • Geometry
    line.length, circle.radius, circle.rotation, arc.radius, arc.startAngle, arc.endAngle, ellipse.radiusX, ellipse.radiusY, ellipse.rotation, polyline.segments[].length, spline.segments[].length, point.size
  • Dimensions And Text
    dimension.lineOffset, dimension.textOffsetX, dimension.textOffsetY, dimension.textRotation, dimension.textHeightMm, dimension.arrowSize, dimension.precision, dimension.radius, dimension.startAngle, dimension.endAngle, dimension.text, text.text, text.textHeightMm, text.fontSize, text.rotation, hatch.fill
  • Block References
    blockRef.insertionPoint.x, blockRef.insertionPoint.y, blockRef.scale.x, blockRef.scale.y, blockRef.rotation, blockRef.params
  • Directives
    moveDirective.offset.dx, moveDirective.offset.dy, moveDirective.length, moveDirective.angle, rotateDirective.angle, scaleDirective.factor, arrayDirective.offset, arrayDirective.copies, arrayDirective.angle, arrayDirective.offset2, arrayDirective.copies2, insertDirective.visible

Directives

Supported Directive Types

  • Move
    type: "moveDirective"
    Translates target primitives by dx/dy in cardinal mode or by length/angle in polar mode.
    Example: mode: "polar", length: "=Run", angle: 90
    Properties: base, offset.dx, offset.dy, length, angle, mode, targetIds, tag.
  • Rotate
    type: "rotateDirective"
    Rotates targets around the directive base point.
    Example: angle: "{RotationAngle}"
    Properties: base, angle, targetIds, tag.
  • Scale
    type: "scaleDirective"
    Scales targets around the directive base point. Zero scale is sanitized away.
    Example: factor: "=IF(IsLarge, 2, 1)"
    Properties: base, factor, targetIds, tag.
  • Array
    type: "arrayDirective"
    Creates additional translated copies. It supports 1D arrays and optional 2D rows.
    Example: offset: 100, copies: 3, angle: 0, twoD: true, offset2: 50, copies2: 2
    Properties: base, offset, copies, angle, twoD, offset2, copies2, targetIds, hideTargets, tag.

    copies and copies2 are additional copies, not total instance counts.
  • Insert
    type: "insertDirective"
    Controls visibility of targeted primitives through the visible property.
    Example: visible: "{ShowAccessory}"
    Properties: base, visible, targetIds, tag.
  • Authoring Commands
    addMoveDirective, addRotateDirective, addScaleDirective, addArrayDirective, and addInsertDirective.
  • setMoveTargets <directiveId>, setRotateTargets <directiveId>, setScaleTargets <directiveId>, setArrayTargets <directiveId>, and setInsertTargets <directiveId>.
  • reorderDirectives <directiveId> ...

CLI Commands

  • Tab: autocomplete
  • Ctrl+C: copy
  • Ctrl+V: paste
  • Delete: delete

Drawing And Annotation

  • line
    line [x1 y1 x2 y2]
    Creates a line. Without full coordinates it runs interactively.
    Example: line 0 0 100 0
  • polyline
    polyline [x1 y1 x2 y2 ...]
    Creates a polyline from typed points or pointer input.
    Example: polyline
  • spline
    spline [points...]
    Creates a spline interactively from clicked or typed points.
    Example: spline
  • rectangle
    rectangle [x1 y1 x2 y2]
    Creates a rectangle from corner points.
    Example: rectangle 0 0 200 100
  • polygon
    polygon [interactive]
    Creates a polygon interactively.
    Example: polygon
  • circle
    circle [interactive]
    Creates a circle interactively from center and radius input.
    Example: circle
  • arc
    arc [interactive]
    Creates an arc interactively.
    Example: arc
  • ellipse
    ellipse [interactive]
    Creates an ellipse interactively.
    Example: ellipse
  • point
    point [x y]
    Places a point marker.
    Example: point 0 0
  • text
    text [interactive]
    Places text with interactive prompts.
    Example: text
  • dimension
    dimension [interactive]
    Creates a linear dimension.
    Example: dimension
  • angularDimension
    angularDimension [interactive]
    Creates an angular dimension.
    Example: angularDimension
  • hatch
    hatch [p|s] x1 y1 x2 y2 x3 y3 ...
    Creates a closed hatch boundary. p or polyline uses polyline mode, s or spline uses spline mode.
    Example: hatch p 0 0 100 0 100 50 0 50

Selection And Modify

  • select
    select
    Starts click-or-drag selection. Shift adds and Ctrl removes.
    Example: select
  • move
    move [x1 y1 x2 y2]
    Moves the current selection. Supports typed coordinates or interactive points.
    Example: move 0 0 50 0
  • copy
    copy [interactive]
    Copies the current selection with interactive placement.
    Example: copy
  • paste
    paste [interactive]
    Pastes clipboard content and places it in the current workspace.
    Example: paste
  • rotate
    rotate [interactive]
    Rotates the current selection.
    Example: rotate
  • scale
    scale [interactive]
    Scales the current selection.
    Example: scale
  • mirror
    mirror [interactive]
    Mirrors the current selection. This is a modify command, not a directive type.
    Example: mirror
  • trim
    trim [interactive]
    Trims selected geometry against cutting edges.
    Example: trim
  • extend
    extend [interactive]
    Extends selected geometry to a boundary.
    Example: extend
  • delete
    delete [id ...]
    Deletes the current selection or explicit primitive ids.
    Example: delete
  • gripEdit
    gripEdit [interactive]
    Edits grip positions for supported primitives.
    Example: gripEdit
  • convertPolylineToSpline
    convertPolylineToSpline [interactive]
    Converts selected polyline geometry to spline geometry.
    Example: convertPolylineToSpline
  • pl2spline
    pl2spline [interactive]
    Alias for convertPolylineToSpline.
    Example: pl2spline

Blocks And Block Instances

  • block
    block [name] [x y]
    Creates a block from the current selection. If no base point is provided it prompts for one.
    Example: block MotorMount 0 0
  • insert
    insert <block> [x y] | insert g <globalBlock> [x y]
    Inserts a local block or a copied global block. Tab toggles local/global selection while prompting.
    Example: insert Valve 100 200
  • bedit
    bedit [blockId]
    Opens block editor for the given block id or for the selected block reference.
    Example: bedit blk_123
  • saveBlock
    saveBlock
    Saves the current local or global block editor definition.
    Example: saveBlock
  • renameBlock
    renameBlock <newName>
    Renames the block currently open in block editor.
    Example: renameBlock MotorMount
  • manageBlockEntity
    manageBlockEntity <param|var|state> <action> ...
    Adds, renames, deletes, duplicates, or reorders block parameters, variables, and states.
    Example: manageBlockEntity param add Width
    Actions vary by entity: add, rename, delete, reorder, duplicate.
  • updateBlockParam
    updateBlockParam <blockRefId> <paramId> <value>
    Updates one block reference parameter, resolves inherited and injected values, and recomputes logic.
    Example: updateBlockParam ref_12 param_width =IF(UseAlt, 200, 100)
  • updateBlockParamsBatch
    updateBlockParamsBatch <jsonIds> <paramId> <value>
    Applies the same parameter update to multiple block references.
    Example: updateBlockParamsBatch ["ref_1","ref_2"] param_width 250
  • updateBlockRefState
    updateBlockRefState <blockRefId> <stateId>
    Forces a block reference to a specific state id.
    Example: updateBlockRefState ref_12 state_alt
  • setEditingBlockState
    setEditingBlockState <stateId>
    Switches the active state inside block editor and loads that state primitives.
    Example: setEditingBlockState state_2
  • updateBlockSelectionFormula
    updateBlockSelectionFormula <formula>
    Updates the block selection formula used for automatic state selection.
    Example: updateBlockSelectionFormula IF(Size > 100, "Large", "Small")
  • updateBlockDefaultState
    updateBlockDefaultState <stateId>
    Sets the block default state id.
    Example: updateBlockDefaultState state_default

Directive Authoring

  • addMoveDirective
    addMoveDirective
    Adds a move directive marker in block editor.
    Example: addMoveDirective
  • addRotateDirective
    addRotateDirective
    Adds a rotate directive marker in block editor.
    Example: addRotateDirective
  • addScaleDirective
    addScaleDirective
    Adds a scale directive marker in block editor.
    Example: addScaleDirective
  • addArrayDirective
    addArrayDirective
    Adds an array directive marker in block editor.
    Example: addArrayDirective
  • addInsertDirective
    addInsertDirective
    Adds an insert visibility directive marker in block editor.
    Example: addInsertDirective
  • setMoveTargets
    setMoveTargets <directiveId>
    Selects targets for a move directive.
    Example: setMoveTargets dir_move_1
  • setRotateTargets
    setRotateTargets <directiveId>
    Selects targets for a rotate directive.
    Example: setRotateTargets dir_rot_1
  • setScaleTargets
    setScaleTargets <directiveId>
    Selects targets for a scale directive.
    Example: setScaleTargets dir_scale_1
  • setArrayTargets
    setArrayTargets <directiveId>
    Selects targets for an array directive.
    Example: setArrayTargets dir_array_1
  • setInsertTargets
    setInsertTargets <directiveId>
    Selects targets for an insert visibility directive.
    Example: setInsertTargets dir_insert_1
  • reorderDirectives
    reorderDirectives <directiveId> ...
    Applies a full new directive id order. The argument list must include every directive id exactly once.
    Example: reorderDirectives dir_a dir_b dir_c

Block Definition Metadata

  • updateLocalParameter
    updateLocalParameter <paramId> <value>
    Updates a local block parameter default value.
    Example: updateLocalParameter param_width 100
  • updateLocalParameterOptions
    updateLocalParameterOptions <paramId> <optionsArray>
    Sets parameter option values from an array payload.
    Example: updateLocalParameterOptions param_mode ["A","B","C"]
  • updateLocalParameterType
    updateLocalParameterType <paramId> <number|string|boolean>
    Changes the local parameter type.
    Example: updateLocalParameterType param_width number
  • updateLocalVariableDefault
    updateLocalVariableDefault <varId> <value>
    Updates a variable fallback default value.
    Example: updateLocalVariableDefault var_total 0
  • updateLocalVariableFormula
    updateLocalVariableFormula <varId> <formula>
    Updates a local variable formula.
    Example: updateLocalVariableFormula var_total =Width*Height
  • updateLocalVariableType
    updateLocalVariableType <varId> <number|string|boolean>
    Changes the local variable type.
    Example: updateLocalVariableType var_total number

Primitive And Dimension Utilities

  • updatePrimitive
    updatePrimitive <id> <property> <value>
    Updates one primitive property. The value is parsed from JSON first, then number, then string.
    Example: updatePrimitive prim_1 rotation 90
  • updatePrimitiveBatch
    updatePrimitiveBatch <jsonIds> <property> <value>
    Applies one primitive property update to multiple ids.
    Example: updatePrimitiveBatch ["p1","p2"] layer "Default"
  • setDimensionRef
    setDimensionRef <dimensionId> <start|end|center>
    Binds a dimension endpoint or center to another primitive grip.
    Example: setDimensionRef dim_1 start

Document, Sheet, Import, Export, And System

  • saveSheet
    saveSheet
    Writes current workspace primitives and view back into the active sheet definition.
    Example: saveSheet
  • renameSheet
    renameSheet <sheetId> <newName>
    Renames a sheet definition and notifies workspace UI.
    Example: renameSheet sheet_12 Layout-A
  • deleteSheet
    deleteSheet <sheetId>
    Deletes the target sheet definition.
    Example: deleteSheet sheet_12
  • exportDxf
    exportDxf
    Exports the active workspace as flattened DXF.
    Example: exportDxf
  • exportLogiDraft
    exportLogiDraft
    Exports the current document as a LogiDraft .ldoc file.
    Example: exportLogiDraft
  • importDxf
    importDxf
    Opens a file picker, imports DXF, creates a new sheet, and loads imported blocks and layers.
    Example: importDxf
  • importLogiDraft
    importLogiDraft
    Shows the Dashboard-only .ldoc import route.
    Example: importLogiDraft
  • settings
    settings snap <grid|object|tolerance|snapType> <value>
    Updates snap settings. Snap types are endpoint, midpoint, center, geometricCenter, node, quadrant, and intersection.
    Example: settings snap tolerance 12
  • undo
    undo [steps]
    Undoes one or more history steps. Default is 1.
    Example: undo 2
  • redo
    redo [steps]
    Redoes one or more history steps. Default is 1.
    Example: redo 2

Artifacts Reference

Output Format

  • flat: CSV file
  • hierarchical: JSON file

Templates

  • blank
  • parts-list
  • schedule

Scope

  • document
  • sheets

Common Options

  • resolvedMode: raw, resolved, both
  • includeNested
  • maxDepth
  • fileLabel
  • sheetIds[] when scope is sheets

Resolved Mode

  • raw
  • resolved
  • both

Fields

  • Groups: Meta, Params, Vars, Resolved Params, Resolved Vars
  • Meta fields: sheetName, sheetId, defName, defId, refId, refName
  • Source kinds: meta, param, var, resolvedParam, resolvedVar
  • Column keys: key, header, source

Grouping

  • grouping.enabled
  • grouping.groupBy[]
  • grouping.aggregates[]
  • Aggregate ops: count, sum

Filters

  • Operators: contains, equals, not equals, greater than, greater or equal, less than, less or equal
  • Filter joins: AND, OR