Look up exact rules and syntax

Exact syntax, commands, fields, and configuration options for LogiDraft.

Jump to: Functions, Injection, Directives, Commands, Primitives, Block References, Artifacts, Constraints

Functions

  • Used in block logic and injection expressions.
  • Expressions are evaluated as JavaScript expressions with Formula.js functions available.
  • * / %
  • + -
  • == === != !== > >= < <=
  • && || !
  • Ternary: condition ? a : b
  • Arrays are supported: [1,2,3]
  • Boolean literals: TRUE, FALSE, true, false are supported.
  • The listed functions are the primary supported set. Additional Formula.js functions may be available but are not guaranteed.
Math And Trig
  • ABS
    ABS(number)
    Absolute value.
    Example: ABS(-5)
  • ACOS
    ACOS(number)
    Inverse cosine in radians.
    Example: ACOS(0.5)
  • ASIN
    ASIN(number)
    Inverse sine in radians.
    Example: ASIN(0.5)
  • ATAN
    ATAN(number)
    Inverse tangent in radians.
    Example: ATAN(1)
  • CEILING
    CEILING(number, significance, [mode])
    Rounds up to the nearest multiple.
    Example: CEILING(12.2, 5)
  • COS
    COS(angle)
    Cosine for a radian angle.
    Example: COS(RADIANS(60))
  • DEGREES
    DEGREES(radians)
    Converts radians to degrees.
    Example: DEGREES(PI()/2)
  • FLOOR
    FLOOR(number, significance)
    Rounds down to the nearest multiple.
    Example: FLOOR(12.9, 5)
  • HYPOT
    HYPOT(x, y, ...)
    Returns sqrt(x^2 + y^2 + ...).
    Example: HYPOT(Width, Height)
  • LN
    LN(number)
    Natural logarithm.
    Example: LN(10)
  • LOG
    LOG(number, base)
    Logarithm in the requested base.
    Example: LOG(1000, 10)
  • MAX
    MAX(value1, value2, ...)
    Largest value.
    Example: MAX(Width, Height)
  • MIN
    MIN(value1, value2, ...)
    Smallest value.
    Example: MIN(Width, Height)
  • MOD
    MOD(dividend, divisor)
    Division remainder.
    Example: MOD(Index, 2)
  • PI
    PI()
    Pi constant.
    Example: PI()
  • POW
    POW(base, exponent)
    Exponentiation.
    Example: POW(2, 3)
  • RADIANS
    RADIANS(degrees)
    Converts degrees to radians.
    Example: RADIANS(45)
  • ROUND
    ROUND(number, [digits])
    Rounds to decimal places.
    Example: ROUND(Length / 25.4, 2)
  • SIN
    SIN(angle)
    Sine for a radian angle.
    Example: SIN(RADIANS(30))
  • SQRT
    SQRT(number)
    Square root.
    Example: SQRT(Area)
  • TAN
    TAN(angle)
    Tangent for a radian angle.
    Example: TAN(RADIANS(45))
  • EXP
    EXP(number)
    e raised to number.
    Example: EXP(1)
  • SIGN
    SIGN(number)
    Returns -1, 0, or 1.
    Example: SIGN(Offset)
Logic And Aggregates
  • IF
    IF(test, value_if_true, value_if_false)
    Conditional return.
    Example: IF(Motor_Qty == 2, 250, 150)
  • AND
    AND(a, b, ...)
    True when all inputs are true.
    Example: AND(Width > 0, Height > 0)
  • OR
    OR(a, b, ...)
    True when any input is true.
    Example: OR(State == "A", State == "B")
  • NOT
    NOT(value)
    Logical negation.
    Example: NOT(IsHidden)
  • SWITCH
    SWITCH(expression, value1, result1, [value2, result2, ...], [default])
    Strict match against value/result pairs.
    Example: SWITCH(Size, "S", 100, "M", 150, "L", 200, 0)
  • SUM
    SUM(a, b, ...) | SUM([a, b, ...])
    Sum of values.
    Example: SUM(Width, Height, Depth)
  • AVERAGE
    AVERAGE(a, b, ...)
    Arithmetic mean.
    Example: AVERAGE(A, B, C)
  • COUNT
    COUNT(a, b, ...)
    Count of numeric values.
    Example: COUNT(A, B, C)
  • SUMIF
    SUMIF(range, criteria, [sum_range])
    Conditional sum.
    Example: SUMIF([1,2,3], ">1")
  • COUNTIF
    COUNTIF(range, criteria)
    Conditional count.
    Example: COUNTIF([1,2,3], ">1")
Text
  • CONCATENATE
    CONCATENATE(text1, text2, ...)
    Joins text fragments.
    Example: CONCATENATE("P-", PartNo)
  • LEN
    LEN(text)
    String length.
    Example: LEN(Label)
  • LOWER
    LOWER(text)
    Lowercase conversion.
    Example: LOWER(Code)
  • REPLACE
    REPLACE(text, find_text, new_text) | REPLACE(old_text, start_num, num_chars, new_text)
    Text replacement by match or by position.
    Example: REPLACE("MTR-100", "100", "125")
    3-arg form replaces all occurrences.

    4-arg form uses 1-based indexing.
  • UPPER
    UPPER(text)
    Uppercase conversion.
    Example: UPPER(Tag)
Lookup
  • LUT_EXACT
    LUT_EXACT(tableName, outColumn, keyColumn, keyValue, ...)
    Exact lookup by one or more column/value pairs.
    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)
    Numeric range lookup using floor or ceil matching.
    Example: LUT_RANGE("Sizes", "Width", "Length", Length, "floor")
    Valid mode values are "floor" and "ceil".

Injection Syntax

Used in block fields

Syntax

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

Rules

  • {Name} resolves params first, then vars.
  • Token names are expected to be identifier-like in user workflows, for example {Width}.
  • Nested {{...}} is not supported.
  • Invalid values do not throw errors; values default and diagnostics are recorded internally.
  • Primitive booleans may accept 1/0; parameters require true/false.
  • Block instance parameters are edited individually; the params object is not edited as a whole.

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, per-parameter block instance fields
  • 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

Used in block definitions

Directive Types
  • Move
    type: "moveDirective"
    Moves target primitives.
    Example: mode: "polar", length: "=Run", angle: 90
    Properties:

    base

    offset.dx

    offset.dy

    length

    angle

    mode

    targetIds

    tag
  • Rotate
    type: "rotateDirective"
    Rotates targets around base.
    Example: angle: "{RotationAngle}"
    Properties:

    base

    angle

    targetIds

    tag
  • Scale
    type: "scaleDirective"
    Scales targets around base.
    Example: factor: "=IF(IsLarge, 2, 1)"
    Properties:

    base

    factor

    targetIds

    tag
  • Array
    type: "arrayDirective"
    Creates translated copies of targets.
    Example: offset: 100, copies: 3, angle: 0, twoD: true, offset2: 50, copies2: 2
    Properties:

    base

    offset

    copies

    angle

    twoD

    offset2

    copies2

    targetIds

    hideTargets

    tag
  • Insert
    type: "insertDirective"
    Controls visibility by switching between true and false target sets.
    Example: visible: "{ShowAccessory}"
    Properties:

    base

    visible

    targetIds

    falseTargetIds

    tag

Commands

  • Injection resolves before directives; directives execute in stored order.
  • targetIds and insert directive falseTargetIds are assigned through selection workflows, not manual entry.
  • addMoveDirective, addRotateDirective, addScaleDirective, addArrayDirective, addInsertDirective
  • setMoveTargets <directiveId>, setRotateTargets <directiveId>, setScaleTargets <directiveId>, setArrayTargets <directiveId>, setInsertTargets <directiveId>, setInsertFalseTargets <directiveId>
  • reorderDirectives <directiveId> ...

CLI Commands

  • CLI parsing is whitespace-based and does not support full quoting.
  • Block names with spaces are not reliably supported in CLI insert.
  • Tab: autocomplete
  • Ctrl+C: copy
  • Ctrl+V: paste
  • Delete: delete
Drawing And Annotation
  • line
    line [x1 y1 x2 y2]
    Creates a line.
    Example: line 0 0 100 0
  • polyline
    polyline [x1 y1 x2 y2 ...]
    Creates a polyline.
    Example: polyline
  • spline
    spline [points...]
    Creates a spline.
    Example: spline
  • rectangle
    rectangle [x1 y1 x2 y2]
    Creates a rectangle as a closed polyline.
    Example: rectangle 0 0 200 100
  • polygon
    polygon <sides> [centerX centerY] [radius [rotationDeg]]
    Creates a polygon as a closed polyline.
    Example: polygon 6 0 0 100 0
  • circle
    circle [interactive]
    Creates a circle.
    Example: circle
  • arc
    arc [x1 y1 x2 y2 x3 y3] | arc [interactive]
    Creates an arc.
    Example: arc 0 0 50 50 100 0
  • ellipse
    ellipse [interactive]
    Creates an ellipse.
    Example: ellipse
  • point
    point [x y]
    Places a point marker.
    Example: point 0 0
  • text
    text [x y [height] content...] | text [interactive]
    Places text.
    Example: text 0 0 12 LABEL
  • 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 hatch boundary.
    Example: hatch p 0 0 100 0 100 50 0 50
Selection And Modify
  • select
    select
    Starts selection mode.
    Example: select
  • move
    move [x1 y1 x2 y2]
    Moves the current selection.
    Example: move 0 0 50 0
  • copy
    copy [interactive]
    Copies the current selection.
    Example: copy
  • paste
    paste [interactive]
    Pastes clipboard content.
    Example: paste
  • rotate
    rotate [baseX baseY angleDeg] | rotate [interactive]
    Rotates the current selection.
    Example: rotate 0 0 90
  • scale
    scale [baseX baseY] factor | scale [interactive]
    Scales the current selection.
    Example: scale 0 0 2
  • mirror
    mirror x1 y1 x2 y2 [yes|no] | mirror [interactive]
    Mirrors the current selection.
    Example: mirror 0 0 100 0 no
  • trim
    trim [x y] | trim [interactive]
    Trims line geometry.
    Example: trim 50 0
  • extend
    extend [x y] | extend [interactive]
    Extends line geometry.
    Example: extend 50 0
  • delete
    delete [id ...]
    Deletes the current selection or explicit ids.
    Example: delete
  • gripEdit
    gripEdit [interactive]
    Edits supported grips.
    Example: gripEdit
  • convertPolylineToSpline
    convertPolylineToSpline [interactive]
    Converts selected polylines to splines.
    Example: convertPolylineToSpline
  • pl2spline
    pl2spline [interactive]
    Alias for convertPolylineToSpline.
    Example: pl2spline
Blocks
  • block
    block [name] [x y]
    Creates a block from the current selection.
    Example: block MotorMount 0 0
  • insert
    insert <block> [x y] | insert g <globalBlock> [x y]
    Inserts a local or global block.
    Example: insert Valve 100 200
  • bedit
    bedit [blockId]
    Opens the Definition tab for a block id or selected block reference.
    Example: bedit blk_123
  • saveBlock
    saveBlock
    Saves the active definition.
    Example: saveBlock
  • renameBlock
    renameBlock <newName>
    Renames the active definition.
    Example: renameBlock MotorMount
Directive Authoring
  • addMoveDirective
    addMoveDirective [x y]
    Adds a move directive in the active definition.
    Example: addMoveDirective
  • addRotateDirective
    addRotateDirective [x y]
    Adds a rotate directive in the active definition.
    Example: addRotateDirective
  • addScaleDirective
    addScaleDirective [x y]
    Adds a scale directive in the active definition.
    Example: addScaleDirective
  • addArrayDirective
    addArrayDirective [x y]
    Adds an array directive in the active definition.
    Example: addArrayDirective
  • addInsertDirective
    addInsertDirective [x y]
    Adds an insert visibility directive in the active definition.
    Example: addInsertDirective
  • setMoveTargets
    setMoveTargets <directiveId>
    Selects move directive targets.
    Example: setMoveTargets dir_move_1
  • setRotateTargets
    setRotateTargets <directiveId>
    Selects rotate directive targets.
    Example: setRotateTargets dir_rot_1
  • setScaleTargets
    setScaleTargets <directiveId>
    Selects scale directive targets.
    Example: setScaleTargets dir_scale_1
  • setArrayTargets
    setArrayTargets <directiveId>
    Selects array directive targets.
    Example: setArrayTargets dir_array_1
  • setInsertTargets
    setInsertTargets <directiveId>
    Selects insert directive targets shown when visible is true.
    Example: setInsertTargets dir_insert_1
  • setInsertFalseTargets
    setInsertFalseTargets <directiveId>
    Selects insert directive targets shown when visible is false.
    Example: setInsertFalseTargets dir_insert_1
  • reorderDirectives
    reorderDirectives <directiveId> ...
    Applies a full directive order.
    Example: reorderDirectives dir_a dir_b dir_c
Project And System
  • saveSheet
    saveSheet
    Writes the active workspace back to the current sheet.
    Example: saveSheet
  • renameSheet
    renameSheet <sheetId> <newName>
    Renames a sheet definition.
    Example: renameSheet sheet_12 Layout-A
  • deleteSheet
    deleteSheet <sheetId>
    Deletes a sheet definition.
    Example: deleteSheet sheet_12
  • exportDxf
    exportDxf
    Exports flattened DXF.
    Example: exportDxf
  • exportLogiDraft
    exportLogiDraft
    Exports the current Project as a .ldoc file; UI export may be subscription-gated.
    Example: exportLogiDraft
  • importDxf
    importDxf
    Imports DXF into a new sheet.
    Example: importDxf
  • importLogiDraft
    importLogiDraft
    Redirects users to the Dashboard-only .ldoc import flow.
    Example: importLogiDraft
  • settings
    settings snap <grid|object|tolerance|snapType> <value>
    Updates snap settings.
    Example: settings snap tolerance 12
  • undo
    undo [steps]
    Undoes history steps.
    Example: undo 2
  • redo
    redo [steps]
    Redoes history steps.
    Example: redo 2

Primitives

  • rectangle and polygon commands create polyline primitives.
Primitive Types
  • line
    type: "line"
    Fields: start, end, length.
    Injectable: length.
  • circle
    type: "circle"
    Fields: center, radius, rotation.
    Injectable: radius, rotation.
  • arc
    type: "arc"
    Fields: center, radius, startAngle, endAngle, sweepDirection.
    Injectable: radius, startAngle, endAngle.
  • ellipse
    type: "ellipse"
    Fields: center, radiusX, radiusY, rotation.
    Injectable: radiusX, radiusY, rotation.
  • polyline
    type: "polyline"
    Fields: points, segments, keepAngles, closed.
    Injectable: segments[].length.
  • spline
    type: "spline"
    Fields: points, tension, segments, closed.
    Injectable: segments[].length.
  • point
    type: "point"
    Fields: position, size, shape.
    Injectable: size.
  • dimension
    type: "dimension"
    Fields: start, end, text, offsets, rotation, text sizing, arrows, precision, refs, dimensionType, center, angles, radius, sweepDirection.
    Injectable: lineOffset, textOffsetX, textOffsetY, textRotation, textHeightMm, arrowSize, precision, radius, startAngle, endAngle, text.
  • hatch
    type: "hatch"
    Fields: boundary, fill, spline.
    Injectable: fill.
  • text
    type: "text"
    Fields: position, text, fontSize, textHeightMm, fontFamily, align, vAlign, style, rotation, mirrored, scaleX, scaleY.
    Injectable: text, textHeightMm, fontSize, rotation.
  • blockRef
    type: "blockRef"
    Fields: blockDefinitionId, refName, insertionPoint, stateId, params, paramVals, vars, scale, rotation, mirrored.
    Injectable: insertionPoint.x, insertionPoint.y, scale.x, scale.y, rotation, per-parameter fields.

Block References

Stored Fields
  • blockDefinitionId
    string
    Referenced block definition id.
  • refName
    string | undefined
    Optional reference label.
  • insertionPoint
    { x: number; y: number }
    Instance insertion point.
  • stateId
    string | undefined
    Active state id when explicitly stored or logic-selected.
  • params
    Record<paramId, string | number | boolean> | undefined
    Per-instance parameter overrides.
    Keys are parameter IDs, not parameter names.
  • scale
    { x: number; y: number } | undefined
    Instance scale.
  • rotation
    number | undefined
    Instance rotation.
  • mirrored
    boolean | undefined
    Instance mirror flag.
Runtime Fields
  • paramVals
    Record<paramId, any> | undefined
    Resolved parameter values after parameter evaluation.
    Read-only evaluation result; not directly editable.
  • vars
    Record<varId, any> | undefined
    Resolved variable values after logic evaluation.
    Read-only evaluation result; not directly editable.

Artifacts Reference

Artifact Types

  • Flat (CSV) - tabular output
  • Hierarchical (JSON) - structured output

What Artifacts Operate On

  • Block instances
  • Parameters (resolved values)
  • Variables (evaluated logic)
  • Document structure

Capabilities

  • Presets
  • Preset import/export
  • Field selection
  • Labels (file naming)
  • Filter builder (UI)
  • Preview

Output Behavior

  • Reflects evaluated system (logic + injection applied)
  • Includes nested block data where applicable
  • Excludes primitives on hidden layers

Notes

  • Artifacts reflect user-visible behavior, not the full internal engine.

Constraints

  • Array directive output is limited to 200 generated copies total.
  • Injection does not support nested {{...}}.
  • DXF import size limit: 50MB.
  • PDF export is disabled.
  • trim and extend operate only on line primitives.
  • Invalid formulas, injections, and coercions do not throw errors; values default and diagnostics are recorded internally.

Docs

How formulas, lookups, injection, and state selection work.