CabMasterPro User Guide
In This Topic
    Built In Variables
    In This Topic

    Built-in variables are variables which are set by CabMasterPro which contain useful information from the current state.

    Name Value Possible Uses
    # The last number which appears in the name of the current section. Simplifying formulas which are for numbered sections.

    The Machinestep Sequences tutorial uses this built-in variable.
    @ The last number which appears in the name of the parent of the current section.
    _boundsminx
    _boundsminy
    _boundsminz
    System Variable

    Evaluates properties of the current section. Similar to item level but applies any hsection subtree.

    For more on the nine (9) _boundsXXX variables, see Sections Size and Pos topic.

    _boundsmaxx
    _boundsmaxy
    _boundsmaxz
    System Variable

    Evaluates properties of the current section. Relative to item nominal front-left-bottom, same as hsection versions, hence rotation independent.

    _boundssizex
    _boundssizey
    _boundssizez
    System Variable

    Evaluates properties of the current section. Relative to item nominal front-left-bottom, same as hsection versions, hence rotation independent.

    _isCustomShapeCalc System Variable

    This is a YesNo built-in variable that can be used anywhere in middleware formulas.

    It applies when machinesteps are being evaluated. A machinestep, for example, could be a circle or a polygon shape, and often the same machine step is used to define a custom shape for a section and for actual machining being output. Sometimes there are very minor differences between what we want to show as the visual shape and what we want to send to the machine. In these situations, we can use this YesNo variable in a formula, and it will evaluate differently in the two cases.

    The formula dialog has two buttons, called “Debug” and “Debug Shape” to make it easier to debug formulas in these situations. These buttons evaluate the formula showing all the steps if it is a complicated formula, and during evaluation set the variable to No or Yes respectively. This lets you see how any formula will behave in the two different situations.

    _DrillPolyShape System Variable

    When machining is being exported, drill holes in any specified layername can be replaced by polyline sequences. This swapping out is determined by evalutating the variable named _DrillPolyShape[layername] in the current context or any parent context (such as drawing properties). This substitution is available for any layername you provide (such as _DrillPolyShape[peanut]).

    See the discussion on Peanut Connectors

    allheights
    allheightssame
    Middleware Variable

    AllHeights is a special middleware variable that allows you to fetch an array of all the vertex heights for a ceiling or floor, or to set them all to the same value or formula. It is a equivalent to looping through all the vertices and looking up or setting them one at a time, like a shorthand method.

    AllHeightsSame looks at all the vertex heights for a floor or ceiling and returns a Yes/No value (Yes means these heights are all the same).

    See the discussion on Ceiling Tool

    EdgeIndex Index of currently selected Wall Edge

    When setting up wall heights and textures, the EdgeIndex combo is used to select an edge of the wall.

    This variable allows you to write formulas that use the selected EdgeIndex to calculate other properties of that wall edge. See Wall and PolyItem Edges Tutorial.

    Example

    Click here to download EdgeIndexTest.qid to view a sample drawing, which uses the EdgeIndex to adjust the wall heights and also to adjust the repeat count of the texture selected for that wall edge.

    The first edge of the wall has EdgeIndex = 1 and the formula for the wall start height is therefore 1200mm + (1 * 400mm). The second vertex which is the start of wall EdgeIndex=2 has a start height of 1200mm + (2 * 400mm). This vertex also is the end of 'Wall Edge 1' so wall edge 1 goes from 1600mm height as its start to 2000mm height at its end.

    Click to view Formula

    Click to view Formula

    NumberOfEdges


    NumberOfVertices
    The number of edges for this wall or polyitem.

    The number of vertices (edge start or endpoints) for this wall or polyitem, which is always one more than the NumberOfEdges.
    See tutorial on Wall and PolyItem Edges.
    TotalLength Sum of the lengths of item parts CappingItems and WallItems have multiple parts. For example a wall has multiple wall segments - the variable TotalLength returns the sum of the lengths of all the segments. For HPanelItems it adds up the edge lengths, taking into account whether it is an open or closed poly.

    The Creating and Editing Capping tutorial discusses this built-in variable for capping.
    FriendlyPartTree
    MachinedPartTree
    MachinedPartList
    Context variables

    Generates an array and can be used to populate a friendly page combo used to select a part.

    See the discussion on Friendly Part List

    TranslatedType
    TranslatedSubtype
    TranslatedCode
    TranslatedBasedOnCode
    Evaluate actual string (usually English) Used to always evaluate the actual (usually English) string that is used in the underlying library for Type, Subtype, Code and BasedOnCode fields.

    For example, the Type might evaluate to "Floor". If we are running with an active translation file, however, this word might be translated into another language. For example, if we are running in Spanish, the user would see "Piso" instead of "Floor".

    If you want to know the current translated string for type, you can evaluate the builtin variable "TranslatedType". In this case, type would return the string "Floor" whereas "TranslatedType" would return the string "Piso".

    See also [F10] Language