### Common getstat Command Examples Source: https://help.autodesk.com/view/FLEXSIMIN/2026/ENU?guid=FlexSim_User_Manual_reference_processflowobjects_processflowstatistics_html Quick reference examples for retrieving current content, input, and staytime statistics. ```FlexScript getstat(delayActivity, "Content", STAT_CURRENT) ``` ```FlexScript getstat(activity, "Input", STAT_CURRENT) ``` ```FlexScript getstat(activity, "Staytime", STAT_AVERAGE) ``` -------------------------------- ### Example C# External Call Syntax Source: https://help.autodesk.com/view/FLEXSIMIN/2026/ENU?guid=FlexSim_User_Manual_reference_developeradvanceduser_connectingtoexternalcode_html The specific call format for the provided CoolStuff example. ```text external C# "CoolStuff" "CoolStuff.Methods.Add" ``` -------------------------------- ### Tree Referencing Examples Source: https://help.autodesk.com/view/FLEXSIMIN/2026/ENU?guid=FlexSim_User_Manual_reference_developeradvanceduser_guis_keyconceptsguis_html Examples of tree path expressions and their corresponding return values. ```text c ``` ```text itemcurrent(c) ``` ```text node(">itemcurrent",c) ``` ```text ownerobject(c) ``` ```text node("../../panel5/ortho12",c) ``` ```text ownerview(c) ``` ```text node("@",c) ``` ```text node("@>toolwindow",c) ``` ```text node("@/tabcontrol2/panel3/1",c) ``` ```text node("../../3/1",c) ``` ```text node("@/button8",c) ``` ```text node("@>objectfocus+",c) ``` -------------------------------- ### TASKTYPE_BREAK Usage Examples Source: https://help.autodesk.com/view/FLEXSIMIN/2026/ENU?guid=FlexSim_User_Manual_reference_tasksequences_tasktypes_html Examples demonstrating basic break, message-based break, and direct task sequence break configurations. ```FlexScript ts.addTask(TASKTYPE_BREAK, NULL, NULL) ``` ```FlexScript ts.addTask(TASKTYPE_BREAK, centerobect(current, 1), NULL) ``` ```FlexScript ts.addTask(TASKTYPE_BREAK, NULL, specificTaskSequence) ``` -------------------------------- ### Animation.start() Source: https://help.autodesk.com/view/FLEXSIMIN/2026/ENU?guid=FlexSim_User_Manual_reference_codinginflexsim_flexscriptapireference_data_animation_html Starts an animation with configurable speed and repeat settings. ```APIDOC ## Animation.start() ### Description Starts an animation. ### Signature `void start( int speedType = 0 , double speedValue = 0 , int repeatType = 0 , double repeatValue = 0 )` ### Parameters - **speedType** (int) - Optional - Defines speed manipulation. Values: SPEED_TYPE_DEFAULT (0), SPEED_TYPE_DURATION (1), SPEED_TYPE_MULTIPLIER (2). - **speedValue** (double) - Optional - Value associated with speedType. - **repeatType** (int) - Optional - Defines how the animation repeats. Values: REPEAT_TYPE_DEFAULT (0), REPEAT_TYPE_NONE (1), REPEAT_TYPE_NR_ITERATIONS (2), REPEAT_TYPE_USE_TIME (3), REPEAT_TYPE_TIME_AFTER_END (4), REPEAT_TYPE_LAST_FRAME (5). - **repeatValue** (double) - Optional - Value associated with repeatType. ### Example `current.animations["Walk"].start();` ``` -------------------------------- ### string.padStart() Source: https://help.autodesk.com/view/FLEXSIMIN/2026/ENU?guid=FlexSim_User_Manual_reference_codinginflexsim_flexscriptapireference_basic_string_html Pads the start of the string with a specified string to a target length. ```APIDOC ## string.padStart(int targetLength, string padString) ### Description Pads the start of the string with the padString to the given targetLength. ### Parameters - **targetLength** (int) - Required - The desired length of the padded string. - **padString** (string) - Optional - The string used to pad the current string (defaults to " "). ### Returns - **string** - The string padded to the specified length. ``` -------------------------------- ### string.padStart() Source: https://help.autodesk.com/view/FLEXSIMIN/2026/ENU?guid=FlexSim_User_Manual_reference_codinginflexsim_flexscriptapireference_basic_string_html Pads the start of the string with a specified string to reach a target length. ```APIDOC ## string.padStart(int targetLength, string padString = " ") ### Description Pads the start of the string with the padString to the given targetLength. If the targetLength is less than the string's length, the string will be returned unpadded. ### Parameters - **targetLength** (int) - Required - The length of the resulting string once the current string has been padded. - **padString** (string) - Optional - The string to pad the current string with. Defaults to a space. ### Example ```flexscript string s = "abc"; s.padStart(10); // " abc" s.padStart(10, "foo"); // "foofoofabc" s.padStart(6,"123465"); // "123abc" ``` ``` -------------------------------- ### Variant.padStart() Source: https://help.autodesk.com/view/FLEXSIMIN/2026/ENU?guid=FlexSim_User_Manual_reference_codinginflexsim_flexscriptapireference_data_variant_html Pads the start of a string Variant with a specified string to a given length. ```APIDOC ## Variant.padStart() ### Description Pads the start of a string Variant with the padString to the given length. Forwards to string.padStart. An exception is thrown if the Variant is not a string type. ### Parameters - **targetLength** (int) - Required - The desired length of the padded string. - **padString** (string) - Required - The string used to pad the current string. ### Returns - **string** - The string padded to the specified length. ``` -------------------------------- ### Run a Docker Container Source: https://help.autodesk.com/view/FLEXSIMIN/2026/ENU?guid=FlexSim_User_Manual_reference_developeradvanceduser_containerizingamodel_html Starts an interactive Docker container session. ```bash docker run -i my-container ``` -------------------------------- ### Example C# Method Definition Source: https://help.autodesk.com/view/FLEXSIMIN/2026/ENU?guid=FlexSim_User_Manual_reference_developeradvanceduser_connectingtoexternalcode_html A sample C# class structure that can be called from FlexSim. ```csharp namespace CoolStuff { public class Methods { public static int Add(int a, int b) { return a + b; } } } ``` -------------------------------- ### string.startsWith() Source: https://help.autodesk.com/view/FLEXSIMIN/2026/ENU?guid=FlexSim_User_Manual_reference_codinginflexsim_flexscriptapireference_basic_string_html Checks if the string starts with the specified substring. ```APIDOC ## string.startsWith(str) ### Description Checks if the string starts with the specified substring. ### Parameters - **str** (string) - Required - The substring to look for. ``` -------------------------------- ### startanimation(object, animation) Source: https://help.autodesk.com/view/FLEXSIMIN/2026/ENU?guid=FlexSim_User_Manual_using3dobjects_creatingcustomobjectsanimations_creatingcustomanimations_html Starts an animation on the specified object. ```APIDOC ## startanimation(object, animation) ### Description Starts an animation on the object. The animation parameter can be a string representing the animation name or a number representing the animation rank. ### Parameters - **object** (treenode) - The object to animate. - **animation** (string|number) - The name or rank of the animation. ``` -------------------------------- ### TableValidation.Context.startRow Source: https://help.autodesk.com/view/FLEXSIMIN/2026/ENU?guid=FlexSim_User_Manual_reference_codinginflexsim_flexscriptapireference_tablevalidation_tablevalidation_context_html Gets the starting row of the range. ```APIDOC ## TableValidation.Context.startRow ### Description Gets the starting row of the range. ### Returns - **int** - The property value. ``` -------------------------------- ### Start an animation Source: https://help.autodesk.com/view/FLEXSIMIN/2026/ENU?guid=FlexSim_User_Manual_reference_codinginflexsim_flexscriptapireference_data_animation_html Initiates an animation with optional speed and repeat configurations. ```FlexScript current.animations["Walk"].start(); ``` -------------------------------- ### Execute a Prepared Statement Source: https://help.autodesk.com/view/FLEXSIMIN/2026/ENU?guid=FlexSim_User_Manual_reference_codinginflexsim_flexscriptapireference_database_database_preparedstatement_html Example showing how to connect to a database, prepare an INSERT statement, bind values from a FlexSim table, and execute the statement. ```FlexScript Database.Connection con = Database.Connection("DBConnector1"); con.connect(); Database.PreparedStatement statement = con.prepareStatement("INSERT INTO customers (ID, FirstName, LastName) VALUES (:id, :firstName, :lastName)"); Table customers = Table("Customers"); for (int i = 1; i <= customers.numRows; i++) { statement.bindParam("id", customers[i]["ID"], Database.DataType.Int); statement.bindParam("firstName", customers[i]["FirstName"], Database.DataType.VarChar); statement.bindParam("lastName", customers[i]["LastName"], Database.DataType.VarChar); statement.execute(); } con.disconnect(); ``` -------------------------------- ### TableValidation.Context.startCol Source: https://help.autodesk.com/view/FLEXSIMIN/2026/ENU?guid=FlexSim_User_Manual_reference_codinginflexsim_flexscriptapireference_tablevalidation_tablevalidation_context_html Gets the starting column of the range. ```APIDOC ## TableValidation.Context.startCol ### Description Gets the starting column of the range. ### Returns - **int** - The property value. ``` -------------------------------- ### License Server Options File Configuration Source: https://help.autodesk.com/view/FLEXSIMIN/2026/ENU?guid=FlexSim_User_Manual_reference_developeradvanceduser_containerizingamodel_html Example configuration for a license server options file to protect licenses with a secret key. ```text TIMEOUTALL 900 PROJECT secret-key INCLUDEALL PROJECT secret-key ``` -------------------------------- ### Query Comparison Examples Source: https://help.autodesk.com/view/FLEXSIMIN/2026/ENU?guid=FlexSim_User_Manual_reference_codinginflexsim_flexscriptapireference_warehousing_storage_system_html Demonstrates the difference between direct label access and item-based property access for query performance. ```FlexScript WHERE SKU = 5 ``` ```FlexScript WHERE item.item.SKU = 5 ``` -------------------------------- ### Define Address Scheme Examples Source: https://help.autodesk.com/view/FLEXSIMIN/2026/ENU?guid=FlexSim_User_Manual_reference_tools_storagesystem_html Example string formats used for identifying slots in a warehouse address scheme. ```Text "3-5-07052", "1-1-05061" ``` -------------------------------- ### Launch FlexSim via Command Line Source: https://help.autodesk.com/view/FLEXSIMIN/2026/ENU?guid=FlexSim_User_Manual_reference_developeradvanceduser_containerizingamodel_html Basic syntax for launching FlexSim in a containerized environment using the /maintenance nogui switch. ```bash flexsim.exe path\to\model.fsm /maintenance nogui [additional args] ``` ```bash flexsim.exe path\to\model.fsm /maintenance nogui /datafile path\to\file.csv ``` -------------------------------- ### Creating a Presentation Source: https://help.autodesk.com/view/FLEXSIMIN/2026/ENU?guid=FlexSim_User_Manual_reference_codinginflexsim_flexscriptapireference_powerpoint_powerpoint_presentation_html Initialize a new, empty PowerPoint presentation. ```FlexScript PowerPoint.Presentation presentation = PowerPoint.Presentation.create(1); ``` -------------------------------- ### Constructing Class Objects Source: https://help.autodesk.com/view/FLEXSIMIN/2026/ENU?guid=FlexSim_User_Manual_reference_codinginflexsim_writinglogic_html Examples of using constructors to initialize objects like Colors and Vec3 vectors. ```FlexScript Color myColor = Color(1, 0, 0); // Makes a red color object.location = Vec3(0, 0, 0); // Sets the object's location to the origin ``` -------------------------------- ### SQL WHERE Clause Index Usage Examples Source: https://help.autodesk.com/view/FLEXSIMIN/2026/ENU?guid=FlexSim_User_Manual_reference_developeradvanceduser_sqlqueries_html Examples of various SQL WHERE clauses and whether they utilize an index based on column configuration. ```sql WHERE ID = 2 ``` ```sql WHERE ID > 1 ``` ```sql WHERE Util > RAND() ``` ```sql WHERE Util >= 15.0 ``` ```sql WHERE ID = 2 AND Name = 'Operator2' ``` ```sql WHERE ID = 2 OR Name = 'Operator3' ``` ```sql WHERE ID = 2 AND Util < 50 ``` -------------------------------- ### Set and Get Object Labels Source: https://help.autodesk.com/view/FLEXSIMIN/2026/ENU?guid=FlexSim_User_Manual_reference_codinginflexsim_flexscriptapireference_tree_treenode_html Use named properties to get or set label values on objects. If a label does not exist, it will be created. ```FlexScript current.MyLabel = 5; ``` ```FlexScript return current.MyLabel; ``` -------------------------------- ### Reference Group Members and Properties in FlexScript Source: https://help.autodesk.com/view/FLEXSIMIN/2026/ENU?guid=FlexSim_User_Manual_tutorials_tasklogic_tutorial3conditionaltasks_3_2addconditionaltasks_html Examples of accessing specific group members by index and determining the total number of members in a group. ```FlexScript Group("Destinations")[2] ``` ```FlexScript Group("Destinations")[3] ``` ```FlexScript Group("Destinations").length ``` -------------------------------- ### Conveyor.width Source: https://help.autodesk.com/view/FLEXSIMIN/2026/ENU?guid=FlexSim_User_Manual_reference_codinginflexsim_flexscriptapireference_conveyor_conveyor_html Gets the width of the conveyor. ```APIDOC ## Conveyor.width ### Description Gets the conveyor's width. ### Type double (readonly) ``` -------------------------------- ### treenode.name Source: https://help.autodesk.com/view/FLEXSIMIN/2026/ENU?guid=FlexSim_User_Manual_reference_codinginflexsim_flexscriptapireference_tree_treenode_html Gets and sets the name of the node. ```APIDOC ## treenode.name ### Description Gets or sets the string name of the treenode. ### Returns - **string** - The name of the node. ``` -------------------------------- ### Object.stopCount Source: https://help.autodesk.com/view/FLEXSIMIN/2026/ENU?guid=FlexSim_User_Manual_reference_codinginflexsim_flexscriptapireference_tree_object_html Gets the number of stops for the object. ```APIDOC ## Object.stopCount ### Description Gets the number of stops for the object. This number increases with calls to the stop method, and decreases with calls to the resume method. ### Returns - **int** - The property value. ``` -------------------------------- ### FlexSim Dockerfile Configuration Source: https://help.autodesk.com/view/FLEXSIMIN/2026/ENU?guid=FlexSim_User_Manual_reference_developeradvanceduser_containerizingamodel_html The Dockerfile instructions to set up the Windows Server Core image, install FlexSim, and configure the environment. ```dockerfile # Start with a windowsservercore image # See https://hub.docker.com/r/microsoft/windows-servercore for the latest version FROM mcr.microsoft.com/windows/servercore:ltsc2022 # Copy the install directory from the context (this folder) to an install directory on the image COPY ./install ./install # Install FlexSim RUN msiexec /i install\FlexSim__x64.msi /quiet /passive /norestart INSTALLDIR=C:\FlexSim # Copy the license file ARG programDir="C:/FlexSim/program/" COPY ./license/flexsim_server.lic $programDir # Add the programDir to the path RUN setx path "%path%;%programDir%" # Enter a secret key for licensing ENV LM_PROJECT="enter-your-secret-key-here" # Copy the test directory to make those files available COPY ./test ./test # Set the starting command of the image CMD [ "Cmd.exe" ] ``` -------------------------------- ### SQL Query Example Source: https://help.autodesk.com/view/FLEXSIMIN/2026/ENU?guid=FlexSim_User_Manual_reference_processflowobjects_warehousing_findslot_html A sample SQL query using a dynamic parameter to match a label on a token. ```sql WHERE Type == $1.Type ``` -------------------------------- ### Object.location Source: https://help.autodesk.com/view/FLEXSIMIN/2026/ENU?guid=FlexSim_User_Manual_reference_codinginflexsim_flexscriptapireference_tree_object_html Get and set the position of the object. ```APIDOC ## Object.location ### Description Accesses the position of the object as a Vec3. ### Usage ``` Object obj = Model.find("Processor1"); obj.location = Vec3(0,0,0); ``` ``` -------------------------------- ### Object.color Source: https://help.autodesk.com/view/FLEXSIMIN/2026/ENU?guid=FlexSim_User_Manual_reference_codinginflexsim_flexscriptapireference_tree_object_html Get and set the Color of the object. ```APIDOC ## Object.color ### Description Get and set the Color of the object. ### Usage `obj.color = Color.red;` ``` -------------------------------- ### Construct Agent Instance Source: https://help.autodesk.com/view/FLEXSIMIN/2026/ENU?guid=FlexSim_User_Manual_reference_codinginflexsim_flexscriptapireference_agent_agent_html Demonstrates the correct way to instantiate an Agent from an object compared to incorrect casting methods. ```FlexScript Agent agent = Agent(object); // correct Agent agent = object; // auto-downcast: incorrect Agent agent = object.as(Agent); // explicit cast: incorrect ``` -------------------------------- ### Storage.Slot.getLocation Source: https://help.autodesk.com/view/FLEXSIMIN/2026/ENU?guid=FlexSim_User_Manual_reference_codinginflexsim_flexscriptapireference_warehousing_storage_slot_html Gets a location within the slot. ```APIDOC ## Method: Storage.Slot.getLocation ### Description Gets a location within the slot. ### Returns - **Vec3** - The location within the slot. ``` -------------------------------- ### Opening a Presentation Source: https://help.autodesk.com/view/FLEXSIMIN/2026/ENU?guid=FlexSim_User_Manual_reference_codinginflexsim_flexscriptapireference_powerpoint_powerpoint_presentation_html Load an existing PowerPoint presentation from a file path. ```FlexScript PowerPoint.Presentation presentation = PowerPoint.Presentation.open(modeldir() + "\\Presentation.pptx", 1); ``` -------------------------------- ### TableValidation.Context.table Source: https://help.autodesk.com/view/FLEXSIMIN/2026/ENU?guid=FlexSim_User_Manual_reference_codinginflexsim_flexscriptapireference_tablevalidation_tablevalidation_context_html Gets the table that is currently being validated. ```APIDOC ## TableValidation.Context.table ### Description Gets table that is currently being validated. ### Returns - **Table** - The property value. ``` -------------------------------- ### FlexScript Syntax Examples Source: https://help.autodesk.com/view/FLEXSIMIN/2026/ENU?guid=FlexSim_User_Manual_reference_codinginflexsim_writinglogic_html Basic syntax conventions for strings, function calls, and comments in FlexScript. ```FlexScript "mytext" ``` ```FlexScript moveobject(object1,object2); ``` ```FlexScript // ``` ```FlexScript /* text */ ``` -------------------------------- ### PowerPoint.Presentation.slideSizeType Source: https://help.autodesk.com/view/FLEXSIMIN/2026/ENU?guid=FlexSim_User_Manual_reference_codinginflexsim_flexscriptapireference_powerpoint_powerpoint_presentation_html Gets or sets the SlideSizeType of the presentation. ```APIDOC ## PowerPoint.Presentation.slideSizeType ### Description Gets/sets the SlideSizeType of the presentation, an enumeration of PowerPoint.SlideSizeType. ### Returns - **int** - The property value. ``` -------------------------------- ### Create a Basic PowerPoint Presentation Source: https://help.autodesk.com/view/FLEXSIMIN/2026/ENU?guid=FlexSim_User_Manual_reference_codinginflexsim_flexscriptapireference_powerpoint_powerpoint_html Demonstrates opening a presentation, adding a slide, modifying shape text and colors, and saving the file. ```FlexScript PowerPoint.Presentation presentation = PowerPoint.Presentation.open(modeldir() + "\\Presentation.pptx", 1); PowerPoint.Slide Slide = Presentation.addSlide(PowerPoint.Layout.title); PowerPoint.Shape Title = Slide.shapes[1]; PowerPoint.Shape subTitle = Slide.shapes[2]; Title.text = "The Presentation's Title in Blue"; Title.color = Color.blue; subTitle.text= "The Presentation's Subtitle in Green"; subTitle.color = Color.green; Presentation.save(documentsdir() + "\\Presentation.pptx"); Presentation.close(); ``` -------------------------------- ### AGV.destination Source: https://help.autodesk.com/view/FLEXSIMIN/2026/ENU?guid=FlexSim_User_Manual_reference_codinginflexsim_flexscriptapireference_agv_agv_html Gets the current destination of the AGV. ```APIDOC ## AGV.destination ### Description Gets the current destination of the AGV. ### Returns - **Object** - The property value (readonly). ``` -------------------------------- ### treenode.up Source: https://help.autodesk.com/view/FLEXSIMIN/2026/ENU?guid=FlexSim_User_Manual_reference_codinginflexsim_flexscriptapireference_tree_treenode_html Gets the parent node of the current node. ```APIDOC ## treenode.up ### Description Retrieves the parent node (the node above) in the tree hierarchy. ### Returns - **treenode** - The parent node. ``` -------------------------------- ### Build and Run Container Demo Source: https://help.autodesk.com/view/FLEXSIMIN/2026/ENU?guid=FlexSim_User_Manual_reference_developeradvanceduser_containerizingamodel_html Commands to build the container image from the Dockerfile and run it as a detached service on port 8000. ```bash docker build -t container-demo . ``` ```bash docker run -d -p 8000:8000 container-demo ``` -------------------------------- ### treenode.prev Source: https://help.autodesk.com/view/FLEXSIMIN/2026/ENU?guid=FlexSim_User_Manual_reference_codinginflexsim_flexscriptapireference_tree_treenode_html Gets the previous node at the same level in the tree. ```APIDOC ## treenode.prev ### Description Retrieves the node immediately preceding the current node at the same level. Returns NULL if this is the first node. ### Returns - **treenode** - The previous node or NULL. ``` -------------------------------- ### treenode.next Source: https://help.autodesk.com/view/FLEXSIMIN/2026/ENU?guid=FlexSim_User_Manual_reference_codinginflexsim_flexscriptapireference_tree_treenode_html Gets the next node at the same level in the tree. ```APIDOC ## treenode.next ### Description Retrieves the node immediately following the current node at the same level. Returns NULL if this is the last node. ### Returns - **treenode** - The next node or NULL. ``` -------------------------------- ### Accessing Storage Object Bays Source: https://help.autodesk.com/view/FLEXSIMIN/2026/ENU?guid=FlexSim_User_Manual_reference_codinginflexsim_flexscriptapireference_warehousing_storage_object_html Examples for retrieving the number of bays or specific bays by their rank. ```FlexScript current.bays.length ``` ```FlexScript current.bays[1] // first bay current.bays[current.bays.length] // last bay current.bays[i] // i-th bay ``` -------------------------------- ### Variant.getLocation() Source: https://help.autodesk.com/view/FLEXSIMIN/2026/ENU?guid=FlexSim_User_Manual_reference_codinginflexsim_flexscriptapireference_data_variant_html Gets an Object Variant's location. ```APIDOC ## Variant.getLocation() ### Description Gets an Object Variant's location. Forwards to Object.getLocation. This method throws an exception if the Variant is not a treenode with Object data. ### Signature Vec3 getLocation( double xFactor , double yFactor , double zFactor ) Vec3 getLocation( Vec3 factors ) ### Parameters - **xFactor** (double) - The x value of the point on the object where the location will be measured from (0-1). - **yFactor** (double) - The y value of the point on the object where the location will be measured from (0-1). - **zFactor** (double) - The z value of the point on the object where the location will be measured from (0-1). - **factors** (Vec3) - A vector representing the point on the object where the location will be measured from (0-1). ``` -------------------------------- ### Construct DateTime Objects Source: https://help.autodesk.com/view/FLEXSIMIN/2026/ENU?guid=FlexSim_User_Manual_reference_codinginflexsim_flexscriptapireference_data_datetime_html Examples of initializing DateTime objects using different constructors, including time offsets, string parsing, and rounding. ```FlexScript DateTime theDate = DateTime(3600); ``` ```FlexScript DateTime futureDate = Model.dateTime + DateTime(340); //Add 340 seconds to the current model time ``` ```FlexScript DateTime theDate = DateTime("12/31/2019 8:00:00 AM", "%m/%d/%Y %I:%M:%S %p"); ``` ```FlexScript DateTime roundedToHour = DateTime(Model.dateTime.totalDays, Model.dateTime.hours); ``` -------------------------------- ### PowerPoint.Presentation.slideSize Source: https://help.autodesk.com/view/FLEXSIMIN/2026/ENU?guid=FlexSim_User_Manual_reference_codinginflexsim_flexscriptapireference_powerpoint_powerpoint_presentation_html Gets or sets the size of the slides in the presentation. ```APIDOC ## PowerPoint.Presentation.slideSize ### Description Gets/sets the size of the slides in the presentation. ### Returns - **Vec2** - The property value. ``` -------------------------------- ### Token.create Source: https://help.autodesk.com/view/FLEXSIMIN/2026/ENU?guid=FlexSim_User_Manual_reference_codinginflexsim_flexscriptapireference_processflow_token_html Creates a new token instance. ```APIDOC ## Token.create(treenode ownerNode, Variant activity, int start, Token parent, int labelAcess) ### Description Static method to create a new token. ### Parameters - **ownerNode** (treenode) - Required - **activity** (Variant) - Required - **start** (int) - Optional - Default 0 - **parent** (Token) - Optional - Default NULL - **labelAcess** (int) - Optional - Default 1 ``` -------------------------------- ### Table.operator [] Source: https://help.autodesk.com/view/FLEXSIMIN/2026/ENU?guid=FlexSim_User_Manual_reference_codinginflexsim_flexscriptapireference_data_table_html Gets or sets the value of a table cell. ```APIDOC ## Table.operator[](index) ### Description Gets or sets the value of a table cell using row/column index or name. ### Example Variant value = table[2]["Orders"]; table[2]["Orders"] = 5; ``` -------------------------------- ### Global Table Data Example Source: https://help.autodesk.com/view/FLEXSIMIN/2026/ENU?guid=FlexSim_User_Manual_modellogic_globaltables_usingdata_html Sample data structure for an order history table containing OrderID and ReleaseTime columns. ```text OrderID ReleaseTime 1014 3.62 1015 6.90 1016 10.78 1017 10.97 1017 11.40 1018 12.18 1019 13.31 ``` -------------------------------- ### USD.Attribute.getTimeSamples() Source: https://help.autodesk.com/view/FLEXSIMIN/2026/ENU?guid=FlexSim_User_Manual_reference_codinginflexsim_flexscriptapireference_data_usd_attribute_html Gets an Array of all the time samples for the attribute. ```APIDOC ## USD.Attribute.getTimeSamples() ### Description Gets an Array of all the time samples for the attribute. ### Returns - **Array** - An Array of time samples. ``` -------------------------------- ### Initialize AGV Customization Delegate Source: https://help.autodesk.com/view/FLEXSIMIN/2026/ENU?guid=FlexSim_User_Manual_reference_tools_agvnetworktool_agvnetwork_html Commands to prepare the customization delegate node in the FlexSim tree. ```FlexScript nodeadddata(so(), DATATYPE_SIMPLE) ``` -------------------------------- ### AGV.proximityState Source: https://help.autodesk.com/view/FLEXSIMIN/2026/ENU?guid=FlexSim_User_Manual_reference_codinginflexsim_flexscriptapireference_agv_agv_html Gets the current proximity state of the AGV. ```APIDOC ### Property: AGV.proximityState **Description**: Returns an int where 0 is unrestricted and 1 indicates the AGV is stopped due to an AGV ahead. **Example**: ```flexscript if (agv.proximityState) { // handle a stopped agv } ``` ``` -------------------------------- ### Execute FlexSim Model via Command Line Source: https://help.autodesk.com/view/FLEXSIMIN/2026/ENU?guid=FlexSim_User_Manual_reference_developeradvanceduser_containerizingamodel_html Runs a specific FlexSim model file with maintenance and license display flags. ```bash flexsim C:\test\TestLicense.fsm /maintenance nogui /showlicense 1 ``` -------------------------------- ### AGV.loadType Source: https://help.autodesk.com/view/FLEXSIMIN/2026/ENU?guid=FlexSim_User_Manual_reference_codinginflexsim_flexscriptapireference_agv_agv_html Gets or sets the load type of the AGV. ```APIDOC ## AGV.loadType ### Description Gets or sets the load type of the AGV. ### Returns - **Variant** - The property value. ``` -------------------------------- ### Array.operator [] Source: https://help.autodesk.com/view/FLEXSIMIN/2026/ENU?guid=FlexSim_User_Manual_reference_codinginflexsim_flexscriptapireference_data_array_html Gets or sets an element at a specific index. ```APIDOC ## operator [](int index) ### Description Gets or sets an element at the specified index. ### Parameters - **index** (int) - The index of an element. ### Returns - **Variant** - An element of the array. ``` -------------------------------- ### Array.length Source: https://help.autodesk.com/view/FLEXSIMIN/2026/ENU?guid=FlexSim_User_Manual_reference_codinginflexsim_flexscriptapireference_data_array_html Gets or sets the number of elements in the array. ```APIDOC ## Array.length ### Description The number of elements in the array. Can also be used to set the size of the array. ### Returns - **int** - The property value. ``` -------------------------------- ### Create a Token in a Process Flow Source: https://help.autodesk.com/view/FLEXSIMIN/2026/ENU?guid=FlexSim_User_Manual_reference_codinginflexsim_flexscriptapireference_processflow_token_html Demonstrates creating a token in a General Process Flow and a specific object instance with parent-child label access. ```FlexScript Token aToken = Token.create(NULL, getactivity("ProcessFlow", "Start"), 0); //General Process Flow Token newToken = Token.create(Model.find("Processor1"), "Start", 0, aToken, TOKEN_LABEL_ACCESS_READ); newToken.Type = 1; newToken.release(0); ``` -------------------------------- ### Array.unshift() Source: https://help.autodesk.com/view/FLEXSIMIN/2026/ENU?guid=FlexSim_User_Manual_reference_codinginflexsim_flexscriptapireference_data_array_html Adds a new element to the start of the array. ```APIDOC ## Array.unshift(Variant val) ### Description Adds a new element to the start of the array. ### Parameters - **val** (Variant) - The new array element. ### Returns - **Array** - The modified array. ``` -------------------------------- ### Querying Objects with Root Parameters Source: https://help.autodesk.com/view/FLEXSIMIN/2026/ENU?guid=FlexSim_User_Manual_reference_tools_propertytables_html Examples of querying objects within a specific subtree using different parameter types. ```SQL SELECT Object, Name FROM Objects('MODEL:/FirstFloor') ``` ```SQL SELECT Object, Name FROM Objects('FirstFloor') ``` ```SQL SELECT Object, Name FROM Objects(Model.find('FirstFloor')) ``` -------------------------------- ### Parameter Definition Source: https://help.autodesk.com/view/FLEXSIMIN/2026/ENU?guid=FlexSim_User_Manual_reference_processflowobjects_warehousing_findslot_html Example of a parameter value passed into the query. ```text token ``` -------------------------------- ### Creating a list reference Source: https://help.autodesk.com/view/FLEXSIMIN/2026/ENU?guid=FlexSim_User_Manual_reference_codinginflexsim_flexscriptapireference_list_list_html Instantiates a reference to a global list by its name. ```FlexScript List itemList = List("ItemList"); ``` -------------------------------- ### GET webserver.dll?canceljob Source: https://help.autodesk.com/view/FLEXSIMIN/2026/ENU?guid=FlexSim_User_Manual_reference_developeradvanceduser_webserver_html Cancels an incomplete or waiting job. ```APIDOC ## GET webserver.dll?canceljob ### Description Cancels a job submitted with a submitjob query if it is incomplete or waiting. ### Method GET ### Endpoint webserver.dll?canceljob=[id] ``` -------------------------------- ### Example Activation ID Format Source: https://help.autodesk.com/view/FLEXSIMIN/2026/ENU?guid=FlexSim_User_Manual_introduction_activatingmanaginglicense_html A sample string representing the structure of a standard FlexSim Activation ID. ```text company.com08-ABCDE-FGHIJ-KLMNO-FSENT22.0 ``` -------------------------------- ### Variant.getVariable() Source: https://help.autodesk.com/view/FLEXSIMIN/2026/ENU?guid=FlexSim_User_Manual_reference_codinginflexsim_flexscriptapireference_data_variant_html Gets the value of an Object Variant's variable. ```APIDOC ## Variant.getVariable() ### Description Gets the value of an Object Variant's variable. Forwards to Object.getVariable. This method throws an exception if the Variant is not a treenode with Object data. ### Signature Variant getVariable( string variableName ) ### Parameters - **variableName** (string) - The name of the variable. ``` -------------------------------- ### Basic Map Usage Source: https://help.autodesk.com/view/FLEXSIMIN/2026/ENU?guid=FlexSim_User_Manual_reference_codinginflexsim_flexscriptapireference_data_map_html Demonstrates initializing a map, assigning values using the [] operator, and retrieving values. ```FlexScript Map map; map[5] = 10; int x = map[5]; // x is 10 ``` -------------------------------- ### OnPreOpen Source: https://help.autodesk.com/view/FLEXSIMIN/2026/ENU?guid=FlexSim_User_Manual_reference_developeradvanceduser_guis_guievents_html Fires after the window tree structure is created but before initialization. Used to modify window structure before opening. ```APIDOC ## OnPreOpen ### Description This event allows you to execute functionality before the window is created. It is fired after the tree structure for the window is created, but before the window itself is initialized. ``` -------------------------------- ### Get USD Property Source: https://help.autodesk.com/view/FLEXSIMIN/2026/ENU?guid=FlexSim_User_Manual_reference_codinginflexsim_flexscriptapireference_data_usd_prim_html Retrieve a property from a prim by its name. ```FlexScript USD.Stage stage = Model.find("USD Stage1"); USD.Prim prim = stage.findPrim("/World/Processor1"); USD.Property property = prim.getProperty("myProperty"); if (property) { ... } ``` -------------------------------- ### AGV.finalDestinationCP Source: https://help.autodesk.com/view/FLEXSIMIN/2026/ENU?guid=FlexSim_User_Manual_reference_codinginflexsim_flexscriptapireference_agv_agv_html Gets the final destination control point of the AGV. ```APIDOC ## AGV.finalDestinationCP ### Description Gets the final destination control point of the AGV. ### Returns - **Object** - The property value (readonly). ``` -------------------------------- ### Finding and Assigning Slots with FlexScript Source: https://help.autodesk.com/view/FLEXSIMIN/2026/ENU?guid=FlexSim_User_Manual_connectingflows_warehousing_keyconceptswarehousing_html Demonstrates using Storage.system.findSlot() to locate a slot based on item properties and assigning it to a storage item. ```FlexScript Storage.Slot slot = Storage.system.findSlot("WHERE Type = $1.Type AND slot.hasSpace($1) ORDER BY RAND()", 0, item); if (slot) { Storage.Item storageItem = Storage.Item(token.Item); storageItem.assignedSlot = slot; } token.Slot = slot; ``` -------------------------------- ### Create, Add, and Dispatch a TaskSequence Source: https://help.autodesk.com/view/FLEXSIMIN/2026/ENU?guid=FlexSim_User_Manual_reference_codinginflexsim_flexscriptapireference_taskexecuter_tasksequence_html Demonstrates the standard workflow of creating a task sequence for an operator, adding a load task, and dispatching it for execution. ```FlexScript TaskSequence ts = TaskSequence.create(Model.find("Operator1")); ts.addTask(TASKTYPE_LOAD, item, current); ... ts.dispatch(); ``` -------------------------------- ### AGV.destinationCP Source: https://help.autodesk.com/view/FLEXSIMIN/2026/ENU?guid=FlexSim_User_Manual_reference_codinginflexsim_flexscriptapireference_agv_agv_html Gets the current destination control point of the AGV. ```APIDOC ## AGV.destinationCP ### Description Gets the current destination control point of the AGV. ### Returns - **Object** - The property value (readonly). ``` -------------------------------- ### RegExResult.operator [] Source: https://help.autodesk.com/view/FLEXSIMIN/2026/ENU?guid=FlexSim_User_Manual_reference_codinginflexsim_flexscriptapireference_data_regexresult_html Gets the complete match string for the nth match. ```APIDOC ## RegExResult.operator [] ### Description Gets the complete match string for the nth match. This is equivalent to calling getMatch(i)[1]. ### Parameters - **i** (int) - The match number for which you want the full match string. ### Returns - **string** - A string containing the full text of the nth match. ``` -------------------------------- ### Launch FlexSim via Command Line Source: https://help.autodesk.com/view/FLEXSIMIN/2026/ENU?guid=FlexSim_User_Manual_reference_developeradvanceduser_controllingflexsimexternally_html Launches a specific FlexSim model with flags to suppress the GUI and message popups. ```bash "C:\Program Files\FlexSim 2022\program\flexsim.exe" "C:\Users\username\Documents\Flexsim 2022 Projects\test.fsm" /maintenance nogui_disablemsg ```