Skip to main content
Version: 2023.3

Add a Resource Script to a Model

Description: Add a resource script to a specific model.

Signature: add_script_to_model(model_name, script_name, script_file_path, version, script_alias, parameters, category)

Parameters:

NameDirectionRequiredDescription
model_nameInYesSpecify the model name you want the driver to be connected to
script_nameInYesSpecify the name of the resource script you want to add
script_file_pathInYesTo replace the current script file with another one, specify the full path to the script file (including file name). py files and zip packages are supported.
versionInNoSet a version number for the script
script_aliasInNoSpecify an alias for the service
parametersInNoSpecify a list of inputs required by the script. For example: ["key1, value1”, "key2, value2”]
categoryInNoScript's category. The script will be arranged under this category in the resource/App/service's Commands pane

Sample:

`add_script_to_model('Generic Chassis Model','Debugging script' ,'C:\\Work\\Scripts\\Resource-Service\\resource_debugging_script_v1.4.zip', '', 'Generic Resources', [], 'Infra')`