Routine OperationsFrom Planimate Knowledge BaseThis page lists all of the routine operations available in Planimate as of 5.32f. The operations all link to pages with their name but most of these pages will not exist. Where an operation warrants further discussion, these links can be followed and the pages created. This page is automatically created. Please do not edit it.
ArithmeticAdd ( + )Add two values/rows/columns/tables $R = $1 + $2 $R = Result $1 = Value 1 $2 = Value 2 ClearSet the target value to its initialising value $R = CLEAR $R = Clear Dec ( -= )Decrement first value/row/column/table by second value $R -= $1 $R = Result $1 = Decr. by Div ( / )Divide values/rows/columns/tables $R = $1 / $2 $R = Result $1 = Value 1 $2 = Value 2 Inc ( += )Increment first value/row/column/table by second value $R += $1 $R = Result $1 = Incr. by InterpolateValueInterpolates a value between value1 and value2 based on ratio (0.0 gives value1, 1.0 gives value2) $R = InterpolateValue($1,$2,$3) $R = Result $1 = Value1 $2 = Value2 $3 = Ratio Mul ( * )Multiply values/rows/columns/tables $R = $1 * $2 $R = Result $1 = Value 1 $2 = Value 2 Scale ( *= )Scale first value/row/column/table by second value $R *= $1 $R = Result $1 = Scale by Set ( = )Assign a value/row/column/table to another of the same type and size $R = $1 $R = Result $1 = Set To Sub ( - )Subtract two values/rows/columns/tables $R = $1 - $2 $R = Result $1 = Value 1 $2 = Value 2 ControlBREAKLOOPImmediately exits an ITERATE loop BREAKLOOP CASETests a condition and if true, executes the code following until another CASE or DEFAULT is reached CASE ($F) $F = CASE CONTINUEImmediately processes the next iteration in a loop/while, skipping the rest of the code CONTINUE DEFAULTMarks code that should be executed if no CASES match in a SELECT block DEFAULT ELSEEnables an alternate block of code to execute if an IF test fails to be true ELSE ENDIFMarks the end of an IF block ENDIF ENDLOOPMarks the end of an ITERATE block ENDLOOP ENDSELECTMarks the end of a SELECT block ENDSELECT ENDWHILEMarks the end of a WHILE block ENDWHILE IFExecutes lines following only if the condition is true IF ($F) $F = IF ITERATERepeats a block of routine lines, incrementing an attribute over a range ITERATE $R FROM $1 TO $2 $R = Index Using $1 = First Value $2 = Last Value ITERATEROWSIterate Row Index over all the rows in the table ITERATEROWS $R OVER $1 $R = Row Index $1 = Table RETURNReturns from the routine RETURN REVERSEITERATEIterate the result attribute over the given range in descending order REVERSEITERATE $R FROM $1 TO $2 $R = Index Using $1 = First Value $2 = Last Value SELECTStarts a block where CASEs can be used to execute different code for conditions tested SELECT WHILERepeats a block of lines until the condition is false; the condition is tested first WHILE ($F) $F = WHILE DisplayAnimateAnimate a model object to a new screen position Animate($1,$2,$3) $1 = Object $2 = X Pos $3 = Y Pos ChooseColorShows the color palette selector dialog $R = ChooseColor($1) $R = Result $1 = Selection Color ColorPaletteEntryReturns the RGB color for a given color index in the Planimate color palette $R = ColorPaletteEntry($1) $R = Result $1 = Palette Index FitPanelToAreaFits the panel to the area of its contents with a margin FitPanelToArea($1,$2) $1 = Target Panel $2 = Margin ForceRepaintRepaints all windows; use with care, it can cause slowdown ForceRepaint ForceRepaintPanelRepaints the specified panel ForceRepaintPanel($1) $1 = Panel GetSystemColorRGBReturns the RGB color for a given color in the Windows system color palette $R = GetSystemColorRGB($1) $R = Result $1 = Value GetViewportScrollXGet the x scroll of a viewport on a given panel $R = GetViewportScrollX($1,$2) $R = Result $1 = Panel With Viewport $2 = Panel Inside Viewport GetViewportScrollYGet the y scroll of a viewport on a given panel $R = GetViewportScrollY($1,$2) $R = Result $1 = Panel With Viewport $2 = Panel Inside Viewport GetViewportZoomGet the zoom factor of a viewport on a given panel $R = GetViewportZoom($1,$2) $R = Result $1 = Panel With Viewport $2 = Panel Inside Viewport GraphXOffsetRead the offset of a graph view for a table on the given panel $R = GraphXOffset($1,$2) $R = Target $1 = Table $2 = Panel GraphXWidthRead the width of a graph view for a table on the given panel $R = GraphXWidth($1,$2) $R = Target $1 = Table $2 = Panel HidePanelHides any popup for the given panel HidePanel($1) $1 = Target Panel HideTableEditorClose any open table editor for the given table HideTableEditor($1) $1 = Table MakeVisibleMakes the specified panel the active panel on the main window MakeVisible($1) $1 = Target Subsystem PanelWindowLeftReturns the left window co-ordinate of a popup panel $R = PanelWindowLeft($1) $R = Result $1 = Panel PanelWindowTopReturns the top window co-ordinate of a popup panel $R = PanelWindowTop($1) $R = Result $1 = Panel PrintPanelQueues the nominated panel for printing; additional panels can be printed by intercepting the _Panel Printed broadcast PrintPanel($1) $1 = Target Subsystem RepaintObjectsForces a repaint of dynamic objects only; faster than a full force repaint RepaintObjects SetActivityStringSets text in the status bar activity area SetActivityString($1) $1 = Activity Text SetColorPaletteEntrySets the RGB color for a given color in the Planimate color palette SetColorPaletteEntry($1,$2) $1 = Palette Index $2 = RGB Value SetGraphXOffsetSet the offset of a graph view for a table on the given panel SetGraphXOffset($1,$2,$3) $1 = Table $2 = Panel $3 = Value SetGraphXWidthSet the width of a graph view for a table on the given panel SetGraphXWidth($1,$2,$3) $1 = Table $2 = Panel $3 = Value SetIconRemoteSet icon for an item somewhere else in the model. Location can be a portal or object id containing the item. If its 0 the entire model is searched, this is potentially very slow. Icon Name should not include any extention, PL will search DBs for it. SetIconRemote($1,$2,$3) $1 = Item ID $2 = Location $3 = Icon Name SetPanelColorSets the background color of a panel SetPanelColor($1,$2) $1 = Panel $2 = Color SetPanelTransparencyEnables the use of transparency for a panel, value 0..254 or 255 to disable transparency SetPanelTransparency($1,$2) $1 = Panel $2 = Transparency SetPortalIconSets icon for portal's current state. SetPortalIcon($1,$2) $1 = Portal ID $2 = Icon Name SetStatusItemAreaStringSets the text in the status bar area where item class names are displayed during editing SetStatusItemAreaString($1) $1 = Item Area Text SetViewportScrollSet the x and y scroll of a viewport on a given panel SetViewportScroll($R,$1,$2,$3) $R = Panel With Viewport $1 = Panel Inside Viewport $2 = X Offset $3 = Y Offset SetViewportTargetSet the target of a viewport. Current Panel identifies the viewport and can be zero of the containing panel only has 1 viewport. New Panel sets the new panel to display, 0 makes the viewport hidden in user mode. SetViewportTarget($1,$2,$3) $1 = Panel With Viewport $2 = Current Panel Inside Viewport $3 = New Panel Inside Viewport SetViewportZoomSet the zoom factor of a viewport on a given panel SetViewportZoom($R,$1,$2) $R = Panel With Viewport $1 = Panel Inside Viewport $2 = Zoom Value ShowPopupPanelOpens the given panel in a separate window at the specified window co-ordinates ShowPopupPanel($1,$2,$3) $1 = Target Panel $2 = X Position $3 = Y Position ShowTableEditorOpen table editor for the given table ShowTableEditor($1) $1 = Table SwapPopupPanelSwaps which panels are visible in a popup panel without closing/reopening it SwapPopupPanel($1,$2) $1 = Target Panel $2 = Replace With LabelAddLabelDialogShow a dialog so the user can add a label to the given label list AddLabelDialog($R) $R = Result AddSubLabelMakes the new sublabel for the parent label $1 (if it doesn't exist) and returns its index as a sublabel AddSubLabel($R,$1) $R = Result $1 = Label ClearLabelListRemoves all labels from a label list ClearLabelList($1) $1 = Clear Label List CreateLabelListCreates a label list with the given name and formats the result attribute to reference it CreateLabelList($R,$1) $R = Format Result $1 = List Name CreateLabelListFromColUses the provided column to provide text for creating a new label list CreateLabelListFromColumn($R,$1) $R = Target List $1 = Source Column CreatePanelPortalLabelCreates a panel label for the subsystem of the given portal object label $R = CreatePanelPortalLabel($1) $R = New Panel Label $1 = Portal Object Label CreateSubLabelListCreates an empty sub label list of an existing label list and formats an attribute to reference it CreateSubLabelList($R,$1,$2) $R = Format Result $1 = List Name $2 = Parent List CreateSubsystemObjectLabel$R = CreateSubsystemObjectLabel() $R = New Object Label DeleteLabelDeletes the given label from its labellist DeleteLabel($1) $1 = Label GetLabelListPropertyRetrieves a property of a label list $R = GetLabelListProperty($1,$2) $R = Result $1 = LabelList $2 = Property LabelCountReturns how many labels in the given label list $R = LabelCount($1) $R = Result $1 = Label Count MaxLabelIndexReturns the highest allocated label index in the given label list $R = MaxLabelIndex() $R = Result MinLabelIndexReturns the lowest allocated label index in the given label list $R = MinLabelIndex() $R = Result NextLabelIndexThe next allocated label index for the list or -1 if none $R = NextLabelIndex($1) $R = Result $1 = Label Index PrevLabelIndexThe previous allocated label index for the list or -1 if none $R = PrevLabelIndex($1) $R = Result $1 = Label Index RedirectLabelListGlobally changes all references to label list 'from' to point to list 'to'. Lists are referenced by name. RedirectLabelList($1,$2) $1 = From Name $2 = To Name ReIndexLabelListRe-indexes all members in a label list so they have ascending and continuous index values ReIndexLabelList($1) $1 = Re-index Label List ReIndexLabelsRemaps labels in the given list using 2 columns of matching from and to values ReIndexLabels($1,$2,$3) $1 = Re-index List $2 = From Values (Col) $3 = To Values (Col) RemoveSubLabelRemoves the sublabel as a member of the sublabel list RemoveSubLabel($1) $1 = Label SetLabelListPropertySets a property of a label list SetLabelListProperty($1,$2,$3) $1 = LabelList $2 = Property $3 = Value TestLabelIndexTests whether an index has been used in a label list $R = TestLabelIndex($1,$2) $R = Result $1 = Index Value $2 = Label List Label StringAppendToLabelAppend text to an existing label AppendToLabel($R,$1) $R = Result $1 = Source CreateLabelAliasCreates a label alias from 'Text' and adds it to the 'Target Label' which must be a label from a label list. Returns non zero if there was a problem creating the alias because 'Text' is already assigned to another label index. $R = CreateLabelAlias($1,$2) $R = Error Result $1 = Text $2 = Target Label CreatePasswordHashUses the 3 text sources to create an unpredictable hash string $R = CreatePasswordHash($1,$2,$3) $R = Result $1 = Text-1 $2 = Text-2 $3 = Text-3 CropToCharactersCrop a label to a subset of its text CropToCharacters($R,$1,$2) $R = Result $1 = From Char $2 = To Char ExtractFileExtentionCreate a label in the target label list which is the file extention of the path/file text ExtractFileExtention($R,$1) $R = Result $1 = Path/File ExtractFileNameCreate a label in the target label list which is the file name from a full path/file text ExtractFileName($R,$1) $R = Result $1 = Path/File ExtractIntoFormatExtracts a substring from a formatted value/label and interprets it in the format of the target. If the target is a label list, it gets added as a label if its not already in that list. $R = ExtractIntoFormat($1,$2,$3) $R = Result $1 = Label $2 = From Char $3 = To Char ExtractPathNameCreate a label in the target label list which is the file name from a full path/file text ExtractPathName($R,$1) $R = Result $1 = Path/File FilesInFolderReturns how many files matching a wildcard in the given folder $R = FilesInFolder($1) $R = Target List $1 = Path/File FilesInHierarchyRetrieve how many files in a file folder (including subfolders) $R = FilesInHierarchy($1) $R = Target List $1 = Path/File FormatIntoLabelCreate a new label with the formatted text of the source FormatIntoLabel($R,$1) $R = Result $1 = Source FormatIntoLabelIndexCreates a label from the text of source and using the provided index $R = FormatIntoLabelIndex($1,$2) $R = Result $1 = Source $2 = Index FormatNameIntoLabelCreates a label from the name of the given object $R = FormatNameIntoLabel($1) $R = Result $1 = Source FormattedLabelIndexDetermines if the source text is a label and returns its index if it is $R = FormattedLabelIndex($1) $R = Result $1 = Source FormattedWidthReturns how many characters the referenced data has when it is formatted for display $R = FormattedWidth($1) $R = Target $1 = Width Of FormatTitleIntoLabelCreates a label from the title text of the given object $R = FormatTitleIntoLabel($1) $R = Result $1 = Source GetAppDataNameGet a full documents and settings/Application Data path/file including a subfolder and a filename. Sets s.LastAccessedDataFilePath and returns non zero if the folder was created/verified writeable. $R = GetAppDataName($1,$2) $R = Result $1 = Folder $2 = Filename GetCharacterExtracts a character from the formatted value provided and returns the ascii code $R = GetCharacter($1,$2) $R = Target $1 = String $2 = Character GetMyDocumentsNameGet a full My Documents path/file including a subfolder and a filename. Sets s.LastAccessedDataFilePath and returns non zero if the folder was created/verified writeable. $R = GetMyDocumentsName($1,$2) $R = Result $1 = Folder $2 = Filename GetProgramNameGet the folder containing the running Planimate EXE and append a filename. Sets s.LastAccessedDataFilePath. GetProgramName($1) $1 = Filename RemapNameUses the model ini file remapping to remap text, typically used for filenames. Multiple components can be combined with | separating them. $R = RemapName($1) $R = Result $1 = Source Text RemoveFileExtentionCrop label to remove trailing dot and text RemoveFileExtention($R) $R = Result RenameLabelChange the text of a label RenameLabel($R,$1) $R = Result $1 = Source SetFreeTextTitleSets title of free text editor dialog SetFreeTextTitle($1) $1 = Title Text LogicalBitANDTreat values as integers and bitwise AND them (limited to 14 bits of precision) $R = BitAND($1,$2) $R = Result $1 = Value 1 $2 = Value 2 BitORTreat values as integers and bitwise OR them (limited to 14 bits of precision) $R = BitOR($1,$2) $R = Result $1 = Value 1 $2 = Value 2 BitXORTreat values as integers and bitwise XORs them (limited to 14 bits of precision) $R = BitXOR($1,$2) $R = Result $1 = Value 1 $2 = Value 2 ConditionEvaluate a condition specified in a dialog $R = Condition($F) $R = Result $F = Set using EQ ( == )Determines if 2 values are numerically close to each other $R = $1 == $2 $R = Result $1 = Value 1 $2 = Value 2 GE ( >= )Determines if the first value is greater than or equal to the second $R = $1 >= $2 $R = Result $1 = Value 1 $2 = Value 2 GT ( > )Determines if the first value is significantly greater than the second value $R = $1 > $2 $R = Result $1 = Value 1 $2 = Value 2 LE ( <= )Determines if the first value is less than or equal to the second $R = $1 <= $2 $R = Result $1 = Value 1 $2 = Value 2 LT ( < )Determines if the first value is significantly less than the second value $R = $1 < $2 $R = Result $1 = Value 1 $2 = Value 2 NEQ ( != )Determines if 2 values are not numerically close to each otherclose to each other $R = $1 != $2 $R = Result $1 = Value 1 $2 = Value 2 MessageBroadcastSends a broadcast to the entire model, optionally including the item's attributes Broadcast($1,$2) $1 = Broadcast Index $2 = With Item Info BroadcastScopedSends a broadcast to a specified dynamic panel and all under it, optionally including the item's attributes BroadcastScoped($1,$2,$3) $1 = Broadcast Index $2 = With Item Info $3 = Send To Subsystem BroadcastToPanelSends a broadcast to a specified dynamic panel, optionally including the item's attributes BroadcastToPanel($1,$2,$3) $1 = Broadcast Index $2 = With Item Info $3 = Send To Subsystem ImmediateMessageSend a message whilst the item waits at the change object ImmediateMessage($1) $1 = Message Target ImmediateMessageNamedSend a message to a specified portal with a specific name whilst the item waits at the change object ImmediateMessageNamed($1,$2) $1 = Message Target $2 = Message Name ReleaseWaitingItemUsed to signal a waiting dispatcher on the target panel that a given item should be released $R = ReleaseWaitingItem($1,$2) $R = Result $1 = Item Index $2 = Scope Panel ReverseItemDirectionSearches spatial links for the item and if found, reverses the direction of the item $R = ReverseItemDirection($1,$2) $R = Result $1 = Item Index $2 = Scope Panel NumericabsMagnitude of a value, without the sign $R = abs($1) $R = Result $1 = Value 1 ConvolvePerforms a convolution between two columns into a preallocated result column. This is useful for combining distributions.” Convolve($R,$1,$2) $R = Result $1 = Column 1 $2 = Column 2 fmodFloating point modulus of $1 over base $2 $R = fmod($1,$2) $R = Result $1 = Value 1 $2 = Value 2 maxDetermines the greater of 2 values $R = max($1,$2) $R = Result $1 = Value 1 $2 = Value 2 minDetermines the lesser of 2 values $R = min($1,$2) $R = Result $1 = Value 1 $2 = Value 2 modInteger modulus of $1 over base $2 $R = mod($1,$2) $R = Result $1 = Value 1 $2 = Value 2 NormaliseRescales data in column so they add up to 1 Normalise($1) $1 = Column randomRandom value between 0 and 1 $R = random($F) $R = Result $F = Set to roundInteger closest to the value $R = round($1) $R = Result $1 = Round Value RoundToNRound value to the specified number of digits of precision $R = RoundToN($1,$2) $R = Result $1 = Round Value $2 = Sig. Digits truncInteger equal or lower than the value $R = trunc($1) $R = Result $1 = Truncate PaintCopyPaintObjectEnables a paint object to be copied, optionally keeping it inherited from the given master $R = CopyPaintObject($1,$2,$3) $R = New Paint Label $1 = Original Paint Label $2 = Destination Panel $3 = Inherit The Copy CopyPaintPropertiesCopies the graphical properties between paint objects CopyPaintProperties($1,$2) $1 = Paint Object To Update $2 = Original Paint Object DeleteAllPaintObjectsDelete all paint objects on the given panel DeleteAllPaintObject($1) $1 = Target Panel DeleteInheritedPaintObjectsRemoves all paint objects which inherit from a given panel DeleteInheritedPaintObjects($1,$2) $1 = Target Pane $2 = Un Inherit Panel DeletePaintObjectDeletes a paint object DeletePaintObject($1,$2) $1 = Paint Label $2 = With Inherited GetPaintPropertyRead a property of a paint object $R = GetPaintProperty($1,$2) $R = Result $1 = Paint Object Label $2 = Property Label InheritPaintObjectsEnables a panel to be populated with paint objects from another panel InheritPaintObjects($1,$2) $1 = Target Panel $2 = Inherit From Panel InterpolateColorInterpolates an RGB color between color1 and color2 based on ratio (0.0 gives color1, 1.0 gives color2) $R = InterpolateColor($1,$2,$3) $R = Result $1 = Color1 $2 = Color2 $3 = Ratio LongLatToXYUsing the Map paint object, Longitude/Latitude co-ordinates are translated to panel X/Y points. Table must contain columns _Long, _Lat, _X and _Y LongLatToXY($1,$2) $1 = Paint Map Label $2 = Table RepaintPaintObjectRepaint a single paint object. Useful if the object's contents have changed but it hasn't moved or changed size. RepaintPaintObject($1) $1 = Paint Label SetLongLatXYSets paint map to show the given co-ordinate as close as possible to the panel (x,y) point. SetLongLatXY($1,$2,$3,$4,$5) $1 = Paint Map Label $2 = Longitude $3 = Latitude $4 = X $5 = Y SetNoteVisibleShows or hides an RTF note SetNoteVisible($1,$2) $1 = Paint Object Label $2 = Visibility SetPaintImageSets the image of a paint object SetPaintImage($1,$2) $1 = Paint Object Label $2 = Set Image To SetPaintPositionMoves a paint object to a new position SetPaintPosition($1,$2,$3) $1 = Paint Object Label $2 = X Pos (lower left) $3 = Y Pos (lower left) SetPaintPropertySet a property of a paint object directly SetPaintProperty($1,$2,$3) $1 = Paint Object Label $2 = Property Label $3 = Property Value SetPaintTextSets the text of a paint object SetPaintText($1,$2,$3) $1 = Paint Object Label $2 = Set Text/File To $3 = For All States SetPaintTipSets the tool tip text of a paint object SetPaintTip($1,$2,$3) $1 = Paint Object Label $2 = Set Tip To $3 = For All States XYToLongLatUsing the Map paint object, screen X/Y points are translated to Longitude/Latitude co-ordinates. Table must contain columns _Long, _Lat, _X and _Y XYToLongLat($1,$2) $1 = Paint Map Label $2 = Table PipeAddPipeCreates a pipe between From and To if one doesn't exist and allocates an object label for the new pipe, which is returned. If Copy Pipe is a valid pipe object label then its properties are copied. $R = AddPipe($1,$2,$3) $R = New Pipe $1 = From $2 = To $3 = Copy Pipe RemovePipeRemoves any pipe between portals From and To (non directional). If From is a pipe label then it is used and To is ignored. RemovePipe($1,$2) $1 = From $2 = To RouteAddTrackCreates a track between From and To if one doesn't exist and an object label is created and returned for the new track section. $R = AddTrack($1,$2,$3) $R = New Track $1 = From $2 = To $3 = Track Type AssignRouteSets an item's track route from a route table AssignRoute($1) $1 = Timetable Source CancelLoopEntryDelayCancels a loop entry delay which is initiated for any item that may dwell at a location and is normally cancelled only if the item leaves the location immediately. This enables just a loop exit delay to occur without an associated loop entry delay. CancelLoopEntryDelay() ClearRouteClear an item's routing database ClearRoute() EnableTrackCheckNextUsed during lookahead, this enables a modeller to signal objects downstream of a lookahead that the current lookahead is for track capacity purposes and wont be taken immediately. It automatically resets when lookahead unwinds behind the routine. EnableTrackCheckNext() FillRouteStepsFills in all intermediate portals and loops in an item's track route FillRouteSteps($1) $1 = Include Loops (1=yes) GenerateTrackTableUpdates the Track Network Details table for the panel inside portal Location. This can change the rows in the track table. Result is non zero if an error occured. $R = GenerateTrackTable($1) $R = Result $1 = Location HoldSectionRoadPlaces the road of a track section into waiting for an item state, preventing any other item using it. HoldSectionRoad($1,$2) $1 = SectionID $2 = Road# InsertRouteStepInsert a track route step into an item's internal routing database InsertRouteStep($1,$2) $1 = Route Step $2 = Route Location ReadRouteReads an item's track route into a table ReadRoute($R) $R = Timetable Target RegisterBlockedTrainRegister the item (train) into the track blocked list RegisterBlockedTrain() RemoveTrackRemoves any track between portals From and To. If From is a track label then it is used and To is ignored. RemoveTrack($1,$2) $1 = From $2 = To ResetLoopDelayTimeResets the loop entry time for an item, useful for enabling some time to be spent in a track location without a loop exit delay being triggered. This does not affect any loop entry delay under way, it will complete at its scheduled time. ResetLoopDelayTime() RoadsInTrackSectionReturns how many roads a given track section has been configured for $R = RoadsInTrackSection($1) $R = Target $1 = Section SectionRoadAvailReturns where a track section road is available for an item/train to use $R = SectionRoadAvail($1,$2) $R = Result $1 = SectionID $2 = Road# SetRoadCheckFilterThis will use road #'s specified by the column starting at a given cell to determine roads to test in lookahead on a track. It stops on a zero cell. SetRoadCheckFilter($1) $1 = Start Cell TrackSectionTypeReturns the type of a track section (_section_types label list) $R = TrackSectionType($1) $R = Target $1 = Section UnblockTrainAttempt unblock of specific train id or all blocked trains if id is 0 UnblockTrain($1) $1 = Item ID UpdateLoopEntryDelaySets the loop entry delay to a new value. This can be performed when a train enters a location. The delay is measured from when the original loop delay started. If no loop delay is active, the operation does nothing. UpdateLoopEntryDelay($1) $1 = Loop Delay Row/ColumnAverageDetermines the average of values in a row or column $R = Average($1,$2,$3) $R = Result $1 = Average of $2 = From $3 = To MaxIndexDetermines the index of the highest value in a row or column $R = MaxIndex($1,$2,$3) $R = Result $1 = Max of $2 = From $3 = To MinIndexDetermines the index of the lowest value in a row or column $R = MinIndex($1,$2,$3) $R = Result $1 = Min of $2 = From $3 = To StdDevDetermines the Standard Deviation of values in a row or column $R = StdDev($1,$2,$3) $R = Result $1 = StdDev of $2 = From $3 = To SumDetermines the sum of values in a row or column $R = Sum($1,$2,$3) $R = Result $1 = Sum of $2 = From $3 = To SumSquaredDetermines the sum of squares of values in a row or column $R = SumSquared($1,$2,$3) $R = Result $1 = Sum/Sqr of $2 = From $3 = To ScientificarccosInverse cosine function, returns radians $R = arccos($1) $R = Result $1 = Value arcsinInverse sine function, returns radians $R = arcsin($1) $R = Result $1 = Value arctanInverse tan function, returns radians $R = arctan($1) $R = Result $1 = Value atan2Determines angle (in radians) given x and y displacement $R = atan2($1,$2) $R = Result $1 = Numerator (Y) $2 = Denominator (X) cosCosine function, value in radians $R = cos($1) $R = Result $1 = Value DegToRadConverts degrees to radians $R = DegToRad($1) $R = Result $1 = Value expCalculates $1 to the power of E $R = exp($1) $R = Result $1 = Value hypotHypotenuse of right angled triangle with given sides $R = hypot($1,$2) $R = Result $1 = X Value $2 = Y Value log10Calculates the decimal logarithm of the value $R = log10($1) $R = Result $1 = Value logNCalculates the natural logarithm of the value $R = logN($1) $R = Result $1 = Value powCalculates $1 to the power of $2 $R = pow($1,$2) $R = Result $1 = Value $2 = Power RadToDegConverts radians to degrees $R = RadToDeg($1) $R = Result $1 = Value sinSine function, value in radians $R = sin($1) $R = Result $1 = Value sqrValue multiplied by itself $R = sqr($1) $R = Result $1 = Value sqrtSquare root of value $R = sqrt($1) $R = Result $1 = Value tanTan function, value in radians $R = tan($1) $R = Result $1 = Value Spatial LinkAddBendPointAdds a bend point to a spatial link between the two objects specified AddBendPoint($R,$1,$2,$3) $R = From Object $1 = To Object $2 = X Position $3 = Y Position AddDirectionalLinkAdds a spatial link between objects which can only be traversed in the forward direction $R = AddDirectionalLink($1,$2) $R = Link ID $1 = From Object $2 = To Object AddSpatialLinkAdd a spatial link between the two objects labels specified $R = AddSpatialLink($1,$2) $R = Link ID $1 = From Object $2 = To Object ClearSpatialCacheInstructs Planimate to update spatial link information after links are created or objects are moved ClearSpatialCache() CopySpatialLinkCreates a spatial link between objects, copying an existing link's properties $R = CopySpatialLink($1,$2,$3) $R = Link ID $1 = From Object $2 = To Object $3 = Copy Link DeletePanelSpatialLinksDeletes all spatial links on a given panel DeletePanelSpatialLinks($1) $1 = Panel GetBendPointsReads bend points into table Bend Table. Link Type determines the type of link acted on. Bend Table Columns: from, to, x, y. Link Type: from _link_types label list. GetBendPoints($1,$2,$3) $1 = Bend Table $2 = Panel $3 = Link Type GetNextLinkObjectReturns the next portal object index that an item will travel to on a spatial link given the item starting at 'from' and target 'to'. Returns 0 if none. $R = GetNextLinkObject($1,$2) $R = Location $1 = From Portal $2 = To Portal QueryLinkItemsSets table to rows describing every item on the link. Required columns are ItemID, TotalTime, Ratio, Direction and Stopped. Ratio corresponds to the position on the link, 0 being the start of the link and 1 being the end. Direction is 0 for forward and 1 for reverse. QueryLinkItems($1,$2) $1 = Table $2 = Link RemoveSpatialLinkRemoves any spatial links from and to the specified object labels (directional) RemoveSpatialLink($1,$2) $1 = From Object $2 = To Object SetBendPointsDeletes all bend points and recreates them from the Bend Table. Link Type determines the type of link acted on. Bend Table Columns: from, to, x, y. Link Type: from _link_types label list. SetBendPoints($1,$2,$3) $1 = Bend Table $2 = Panel $3 = Link Type SetItemTransitTargetSets the destination an item will look for once it enters a spatial link SetItemTransitTarget($1) $1 = To Target SetItemTransitTimeSets the time an item will take to reach its destination once it enters a spatial link SetItemTransitTime($1) $1 = To Time SetLinkColorSets the color of a spatial link between 2 given objects SetLinkColor($1,$2,$3) $1 = From Object $2 = To Object $3 = Color SetLinkCostSets the link cost of a spatial link (normally computed from the link's distance) SetLinkCost($1,$2,$3) $1 = From Object $2 = To Object $3 = Cost SetSpatialLinkWidthSets the width of a spatial link between two objects SetSpatialLinkWidth($1,$2,$3) $1 = From Object $2 = To Object $3 = Width UpdateLinkItemsUpdates the spatial link items according to the settings in the table. Columns are ItemID, TotalTime, Ratio, Direction and Stopped. Ratio corresponds to the position on the link, 0 being the start of the link and 1 being the end. Direction is 0 for forward and 1 for reverse. Stopped enables just that item to be suspended on the link. If ItemID is -1 the row is ignored. If Ratio is -1, the items position is retained. If TotalTime is -1, the current total time for the item is retained. UpdateLinkItems($1,$2) $1 = Table $2 = Link Special---| Only During Move |---Enables the modeller to specifically mark that the following routine lines do not execute during lookahead Only During Move |---||----- Following Only During Move -----| BREAKPOINTIFIf the parameter is true, this interrupts the routine and displays a debugging dialog enabling inspection of the models state BREAKPOINTIF ($1) $1 = Enable Break CallDLLEnables a Planimate compatible DLL to be called $R = CallDLL($F) $R = Result $F = Set to CallRoutineCalls a subroutine CallRoutine($F) $F = Call Comment (//)A comment line Comment CopyFontCopies the font properties between cells and columns CopyFont($R,$1) $R = Format Result $1 = Format From CopyFormatCopies the format/unit type/label reference between cells, columns and attributes CopyFormat($R,$1) $R = Format Result $1 = Format From CopyPortalMakes a copy of a portal and places it on Panel. If the name text is not “-” or an empty string, the new portal uses that name. $R = CopyPortal($1,$2,$3,$4,$5) $R = New Portal $1 = Original Portal $2 = New Panel $3 = X $4 = Y $5 = New Name DescribeRoutineDataDescribe the data accessed by a change object routine DescribeRoutineData($1,$2,$3) $1 = Routine Panel $2 = Object Name $3 = Output Filename EncodeRGBEncodes red, green and blue components (0..255) into a single value used to specify any color $R = EncodeRGB($1,$2,$3) $R = Result $1 = Red Value $2 = Green Value $3 = Blue Value FormatForListFormats the result object to reference a label list with the given name FormatForList($R,$1) $R = Format Result $1 = List Name GetFormatReturns the value format of the data $R = GetFormat($1) $R = Result $1 = Data To Test GetFormatListNameCreates a new label with the name of the label list the target is formatted to. If no list, no change to the target is made GetFormatListName($R,$1) $R = Result $1 = Data To Test ListRoutineCodeWrite a change object routine code to a file ListRoutineCode($1,$2,$3) $1 = Routine Panel $2 = Object Name $3 = Output Filename LoadDataSetInitiates loading of a given data set from a file name specified by a label LoadDataSet($1,$2) $1 = Data Set # $2 = File Name LoadDataSet2Load a version 2 dataset $R = LoadDataSet2($1,$2,$3) $R = Result $1 = Definition Table $2 = File Name $3 = Pass Phrase ObjectTypeReturns the type of the object that the object label refers to $R = ObjectType($1) $R = Result $1 = Object QueryNetworkSets table to rows describing every link on Panel between portals (track,spatial,pipe). 4 columns are required; From, To, Type and ID. From and To are the object Ids of the portals at the end points. Type is the type of link and is formatted to the “_link_type” label list. ID is the object id of the link. QueryNetwork($1,$2) $1 = Table $2 = Panel RealTimeCallBackThis will schedule a _Real Time Tick broadcast at a given real interval, in milliseconds. Note that any previous event is cancelled when this is re-invoked. Interval can be between 10 and 5000ms. RealTimeCallBack($1) $1 = Interval (ms) SaveDataSetInitiates saving of a given data set to a file name specified as a label SaveDataSet($1,$2) $1 = Data Set # $2 = File Name SaveDataSet2Save a version 2 dataset $R = SaveDataSet2($1,$2,$3) $R = Result $1 = Definition Table $2 = File Name $3 = Pass Phrase SetDirectorySets the working directory for the model. Use only for compiled applications. Returns non zero on failure $R = SetDirectory($1) $R = Result $1 = Path SetFormatSets format of $1 to mode $2, with $3 being the label list name if its a label format SetFormat($1,$2,$3) $1 = Data To Set $2 = Format $3 = List Name SetLastDataFileSets the last data filename, optionally visible in the titlebar SetLastDataFile($1) $1 = Name ShowHelpOpen a HTML help window. Help File can be empty for default. ShowHelp($1,$2) $1 = Help File $2 = Section StartScheduledEntriesSignals that scheduled entries should start (if options deferred them starting when the model was run) StartScheduledEntries StringSetText ( $= )Set a free text attribute or table cell to another text attribute, literal text or a the formatted text of a value $R $= $1 $R = Result $1 = Set To TableAdvancedSortPerforms a sort on a table using another table to define the sort criteria AdvancedSort($R,$1) $R = Target $1 = Sort Info AllocateTableRowMemoryEnables memory to be reserved for a table which is expected to grow to a large number of rows AllocateTableRowMemory($R,$1) $R = Target Table $1 = Allocate Rows AppendColAppend a column to a table AppendColumn($R) $R = Target AppendRowAppend a row to the table AppendRow($R) $R = Target BinarySearchPerform a binary search over the range First Index to Last Index. Assumes the data compared is sorted ascending and the comparison is for equality. Multiple comparisons can be combined only with AND. Returns 1 + last index or 0 if Zero On Fail is set. $R = BinarySearch($F,$1,$2,$3) $R = Result $1 = First Index $2 = Last Index $3 = Zero On Fail $F = Condition BlockMoveBlock copy a range of cells to another table BlockMove($R,$1,Range[$2][$3]) $R = Result $1 = Source $2 = # of Rows $3 = # of Cols CopyToClipboardCopy table to clipboard using its clipboard settings and the option modifiers CopyToClipboard($R,$1) $R = From Table $1 = Options CountIFMatchCounts rows where Match Column matches Match Key $R = CountIFMatch($1,$2) $R = Result $1 = Match Column $2 = Match Key CreateSortIndexCreates an ordered list of row numbers if the given column was sorted alphabetically CreateSortIndex($R,$1) $R = Target Column $1 = Column To Sort DeleteColDelete a range of columns from a table DeleteColumn($R,$1,$2) $R = Target Table $1 = First Col $2 = Col Count DeleteRowDelete a number of rows starting at a given row in a table DeleteRow($R,$1,$2) $R = Target Table $1 = First Row $2 = Row Count EnableColumnEditingControls whether a given table column can be edited EnableColumnEditing($R,$1) $R = Target Column $1 = Edit Control FindColumnLabelSearches columns in table $1 for one with a label which matches formatted $2 and returns the index or 0 if none found $R = FindColumnLabel($1,$2) $R = Result $1 = Table $2 = Find String FindColumnTitleSearches columns in table $1 for one with a title which matches formatted $2 and returns the index or 0 if none found $R = FindColumnTitle($1,$2) $R = Result $1 = Table $2 = Find String GetColSecondTitleSets the target to a label of the second title row for the given column GetColumnSecondTitle($R,$1) $R = Result $1 = Column GetColumnPropertyRead a property of a table column $R = GetColumnProperty($1,$2) $R = Result $1 = Table Column $2 = Property Label InsertColInsert columns into a table with the option of copying formatting from another column InsertColumn($R,$1,$2,$3) $R = Target Table $1 = Insert Pos. $2 = Col Count $3 = Copy Format InsertRowInsert a number of rows at a given row in a table InsertRow($R,$1,$2) $R = Target Table $1 = Insert Pos. $2 = Row Count MaxIndexIFMatchReturns first row with maximum Data Column value for rows where Match Column matches Match Key. Returns 0 if no rows match. $R = MaxIndexIFMatch($1,$2,$3) $R = Result $1 = Match Column $2 = Match Key $3 = Data Column MinIndexIFMatchReturns first row with minimum Data Column value for rows where Match Column matches Match Key. Returns 0 if no rows match. $R = MinIndexIFMatch($1,$2,$3) $R = Result $1 = Match Column $2 = Match Key $3 = Data Column OutOfScopeWriteEnable writing to item table reference $1 even if it is not in scope OutOfScopeWrite($1) $1 = Item Table Ref PasteFromClipboardPaste the clipboard into the table using its clipboard options and the modifiers PasteFromClipboard($R,$1) $R = Target Table $1 = Configure PurgeDuplicateRowsRemoves any identical rows from the given table PurgeDuplicateRows($R) $R = Target ReverseSearchDecrement the result attribute from first to last until the condition is true. If the search fails, returns ast_index – 1 or 0 if 'Zero On Fail' is true. $R = ReverseSearch($F,$1,$2,$3) $R = Result $1 = First Index $2 = Last Index $3 = Zero On Fail $F = Condition SearchIncrement the result attribute from first to last until the condition is true. If the search fails, returns 1 + last_index or 0 if 'Zero On Fail' is true. $R = Search($F,$1,$2,$3) $R = Result $1 = First Index $2 = Last Index $3 = Zero On Fail $F = Condition SetCellFreeTextSets the free text (not bound by label text rules) for a table cell SetCellFreeText($R,$1) $R = Target Cell $1 = Source Cell SetColAlignmentEnables a column's text alignment to be changed SetColumnAlignment($R,$1) $R = Target Column $1 = Align Mode SetColSecondTitleSets the text of the second title row for the given column SetColumnSecondTitle($R,$1) $R = Target Column $1 = Title Text SetColTitleSet the title text of a table column SetColumnTitle($R,$1) $R = Target Column $1 = Title Text SetColTupleNameSets the name used to internally identify a column SetColumnTupleName($R,$1) $R = Target Column $1 = Tuple Text SetColumnPropertySet a property of a table column SetColumnProperty($1,$2,$3) $1 = Table Column $2 = Property Label $3 = Property Value SetColumnTipSets the tool tip of a table column SetColumnTip($R,$1) $R = Column $1 = Tip Text SetColWidthSets the formatting width of a table column SetColWidth($R,$1) $R = Target Column $1 = Column Width SetTableRowHeightSets the height of table rows SetTableRowHeight($1,$2) $1 = Target Table $2 = Row Height SetTableTitleSet the title text of the table from the label SetTableTitle($R,$1) $R = Target Table $1 = Title Text ShiftColShift the columns in a table ShiftColumn($R,$1,$2) $R = Result $1 = Source $2 = Shift <+ -> ShiftRowShift the rows in a table ShiftRow($R,$1,$2) $R = Result $1 = Source $2 = Shift ^+ -v SortSort table by up to 3 columns Sort($R,$1,$2,$3) $R = Target $1 = Primary Col. $2 = Second Col. $3 = Third Col. SumIFMatchSums values in Data Column for rows where Match Column matches Match Key $R = SumIFMatch($1,$2,$3) $R = Result $1 = Match Column $2 = Match Key $3 = Data Column TableReferenceSetReturns non zero if the reference resolves to a table $R = TableReferenceSet($1) $R = Result $1 = Item Table Ref TableSortDialogEnables the user to set up and perform a sort using the table sort dialog TableSortDialog($R) $R = Target Table ViewClearFilterClear filter settings for a table view ClearFilter($1,$2) $1 = Table $2 = Panel CopyAllFromViewCopies the entire contents of a table view. Any current selection is ignored and left intact. CopyAllFromView($1,$2) $1 = Table $2 = Panel CopyFromViewCopies the current cell or selection from a specified table view just as if CTRL-C was pressed CopyFromView($1,$2) $1 = Table $2 = Panel GetColumnFilterGets any active column filter for a table view $R = GetColumnFilter($1,$2) $R = Text/Label $1 = Column $2 = Panel GetFilteredRowsRetrieves the filter mapping of view rows to actual rows into the list table GetFilteredRows($1,$2,$3) $1 = Filter List $2 = Table $3 = Panel GetTableViewRead columns of a table view into another table GetTableView($1,$2,$3) $1 = View Table $2 = View Panel $3 = Config Table GetViewPropertyRetrieves a property of a view of a table on a given panel $R = GetViewProperty($1,$2,$3,$4) $R = Result $1 = Table $2 = Panel $3 = Property $4 = View Type PasteIntoViewPastes the system clipboard into a table view starting at the specified Top Left cell. Returns zero on success $R = PasteIntoView($1,$2,$3,$4,$5,$6,$7) $R = Error Result $1 = Table $2 = Panel $3 = TL Row $4 = TL Col $5 = Options $6 = Rows Read $7 = Cols Read ReFilterTableViewReapply any active filters to the current data in the table ReFilterTableView($1,$2) $1 = Table $2 = Panel SetColumnFilterSets a column filter text for a table view. The filter needs to be reapplied once all the columns have been set. SetColumnFilter($R,$1,$2) $R = Column $1 = Text $2 = Panel SetTableViewSet columns that a table view will display SetTableView($1,$2,$3) $1 = View Table $2 = View Panel $3 = Config Table SetTableViewColScrollSets the column scroll of a view for a table on a given panel SetTableViewColScroll($1,$2,$3) $1 = Table $2 = Panel $3 = Value SetTableViewRowScrollSets the row scroll of a view for a table on a given panel SetTableViewRowScroll($1,$2,$3) $1 = Table $2 = Panel $3 = Value SetViewFilterRowsSets the rows that a table view on a panel will display. Filter List is a column of row numbers. SetViewFilterRows(($1,$2,$3) $1 = Filter List $2 = Table $3 = Panel SetViewPropertySets a property of a view of a table on a given panel SetViewProperty($1,$2,$3,$4,$5) $1 = Table $2 = Panel $3 = Property $4 = Value $5 = View Type TableViewColScrollReads the column scroll of a view for a table on a given panel $R = TableViewColScroll($1,$2) $R = Target $1 = Table $2 = Panel TableViewRowsReads the number of rows in a table view. If a filter is set, this may differ from the number of rows in the table $R = TableViewRows($1,$2) $R = Target $1 = Table $2 = Panel TableViewRowScrollReads the row scroll of a view for a table on a given panel $R = TableViewRowScroll($1,$2) $R = Target $1 = Table $2 = Panel TableViewVisibleColsReads the number of visible columns in a table view $R = TableViewVisibleCols($1,$2) $R = Target $1 = Table $2 = Panel TableViewVisibleRowsReads the number of visible rows in a table view $R = TableViewVisibleRows($1,$2) $R = Target $1 = Table $2 = Panel TimeDayOfMonthReturns the day of the month, starting at 1 $R = DayOfMonth($1) $R = Result $1 = Time DayOfWeekReturns the day of the week, starting at 1 for Sunday $R = DayOfWeek($1) $R = Result $1 = Time DaysInDateMonthReturns how many days in the month of the absolute time $R = DaysInDateMonth($1) $R = Result $1 = Time FormDateComputes the absolute time representing midnight on the given date $R = FormDate($1,$2,$3) $R = Result $1 = Date $2 = Month $3 = Year GetDateExtracts the date from a date/time $R = GetDate($1) $R = Result $1 = Date/Time HourOfDayReturns the hour into the current day of the time, starting at 0 $R = HourOfDay($1) $R = Result $1 = Time HourOfDay+1Returns the hour into the current day of the time, starting at 1 instead of 0 $R = HourOfDay_1($1) $R = Result $1 = Time IncrementByMonthsIncrements the date by one or more months, attempting to keep the same day of month IncrementByMonths($R,$1) $R = Result $1 = # of months MonthOfYearReturns the month of the year, starting at 1 for January $R = MonthOfYear($1) $R = Result $1 = Time TimeOfDayReturns the number of seconds into the current day of the time $R = TimeOfDay($1) $R = Result $1 = Time WeekOfYearReturns the week of the year, starting at 1 $R = WeekOfYear($1) $R = Result $1 = Time YearOfDateReturns the year of the given calendar time $R = YearOfDate($1) $R = Result $1 = Time TupleDecodeMultiLabelToTupleExtracts the fields of a multi-label to item attributes with names matching the label lists in the multi-label DecodeMultiLabelToItem($R) $R = Target EncodeItemToMultiLabelCombines item attributes to form a multi-label, for item attributes with names matching the label lists in the multi-label EncodeItemToMultiLabel($R) $R = Target MatchedCopyRowCopy rows between tables where the column names match MatchedCopyRow($R,$1) $R = Result $1 = Set To TupleAppendFromCarriedAppend a row to the table and for it, set table columns from a carried item's attributes with the same name TupleAppendFromCarried($R,$1) $R = Table $1 = Carried Index TupleAppendFromItemAppend a row into the table and for it, set table columns from item attributes with the same name TupleAppendFromItem($R) $R = Table TupleCarriedToRowFor the specified row, set table columns from a carried item's attributes with the same name TupleCarriedToRow($R,$1) $R = Row $1 = Carried Index TupleDecrementToRowFor the specified row, decrement cells with the values of item attributes with matching names TupleDecrementFromRow($R) $R = Row TupleExtractToCarriedFor the specified row, set a carried item's attributes from table columns with the same name then delete the row TupleExtractToCarried($R,$1) $R = Row $1 = Carried Index TupleExtractToItemFor the specified row, set item attributes from table columns with the same name then delete the row TupleExtractToItem($R) $R = Row TupleIncrementToRowFor the specified row, increment cells with the values of item attributes with matching names TupleIncrementToRow($R) $R = Row TupleInsertFromCarriedInsert a row into the table and for it, set table columns from a carried item's attributes with the same name TupleInsertFromCarried($R,$1) $R = Row $1 = Carried Index TupleInsertFromItemInsert a row into the table and for it, set table columns from item attributes with the same name TupleInsertFromItem($R) $R = Row TupleItemToRowFor the specified row, set table columns from item attributes with the same name TupleItemToRow($R) $R = Row TupleRowToCarriedFor the specified row, set a carried item's attributes from table columns with the same name TupleRowToCarried($R,$1) $R = Row $1 = Carried Index TupleRowToItemFor the specified row, set item attributes from table columns with the same name TupleRowToItem($R) $R = Row UIAddListToMenuAppends a new menu to the modeller custom menu bar AddListToMenu($1,$2) $1 = Menu Name $2 = Item List BrowseFileBrowse for a file. Returns non zero if one chosen. FileName sets an initial file, Options can combine:1 to enable a save-style dialog (default is load) and 2 to enable stay in directory (default is to return to working directory). Use s.LastAccessedDataFile and s.LastAccessedDataFilePath to access the file and full path spec of the file selected. $R = BrowseFile($1,$2) $R = File Chosen $1 = FileName $2 = Options ClearCustomMenubarRemoves all menu items from the modeller custom menu bar ClearCustomMenubar DialogShow a dialog box for the user to interact with $R = Dialog($F) $R = Result $F = Dialog HandlePopupMenuInterprets columns in table as depth/name/index and generates a popup menu. Returns index of selected item or 0 if cancelled $R = HandlePopupMenu($1) $R = Result $1 = Table InitiateFieldEditStarts editing attribute/cell views on a panel, as if the user clicked on the first one InitiateFieldEdit($1) $1 = Target Panel SetMenuBarInterprets columns in table as depth/name/index and builds a custom menu bar SetMenuBar($1) $1 = Table |
