About: This article introduces the Script node, a Special node within Construct.
Location: Node panel
Table of Contents
Feature Overview
The Script node allows users integrate code into their node workflow. In this node, users can write and edit code scripts that may be needed as part of their job. Batch, Power Shell, and Power Shell Command capabilities are built into the node by default. Additional script formats can be added to the node with a small customization the configuration and as long as the corresponding applications are installed on the machine.
Adding Languages to the Script Node
Additional scripting formats such as Python and R can be added to the Script node by customizing the program's configuration file. This process will vary slightly depending on which version of Construct you use: Workstation, Pro, or Enterprise. Each version has a corresponding configuration file (Workstation.config, ProServer.config, EntServer.config). Follow the steps below using the appropriate file name as the "configuration file" according to which version of Construct you use.
- Close Construct.
- Open a File Explorer and navigate to this location: C:\ProgramData\Rapid Insight Inc\Veera Construct\Configuration.
- If you do not see a Configuration folder, simply create a new folder in this location and name it "Configuration".
- Inside the Configuration folder, open the configuration file (Workstation.config, ProServer.config, EntServer.config). If you do not see the configuration file in this location, or if you just created the Configuration folder in step 2, simply create a new text file using Notepad, name it according to your version (including the .config extension), and save it in the Configuration folder.
-
Ensure that the program (such as Python or R) is installed on the machine.
Note: If you use Construct Pro or Construct Enterprise versions, a custom install is required when installing the program. Because Construct Pro and Construct Enterprise run as a service, the program needs to be installed for all users. This changes the install location to Program Files and makes the program visible/available to the service.
- If you just created your configuration file in step 3, paste the entire following code block into the file. If you already had an existing configuration file, simply copy line 2, the code for the specific program you are adding, and the second to last line and paste between your existing <configuration> tags.
Note: Code highlighted in red needs to be updated to reflect your specific configuration file name, as well as the file path of the program executable on your machine.
<configuration>
<rapidInsight.veeraConstruct.scriptEngines file="Workstation.config">
<!-- R -->
<scriptEngine name="R" enginePath="C:\Program Files\R\R-4.1.2\bin\Rscript.exe" scriptFileExtension="r" workingFolder="C:\ProgramData\Rapid Insight Inc\Veera Construct\Temp" editor="%windir%\system32\notepad.exe">
<arg value=""{ScriptFile}"" />
</scriptEngine>
<!-- PYTHON -->
<scriptEngine name="Python" enginePath="C:\Users\LBrennan\AppData\Local\Programs\Python\Python310\python.exe" scriptFileExtension="py" workingFolder="C:\ProgramData\Rapid Insight Inc\Veera Construct\Temp" editor="%windir%\system32\notepad.exe">
<arg value=""{ScriptFile}"" />
</scriptEngine>
</rapidInsight.veeraConstruct.scriptEngines>
</configuration> - Save the configuration file and close it.
- If you are using Construct Workstation, you should see the new script option available upon restarting the program.
If you are using Construct Pro, the service will need to be restarted for the changes to take effect. This can be done by going to Windows Services > Veera Construct Pro > Restart.
If you are using Construct Enterprise, the server will need to be restarted for the changes to take effect. This can be done by going to the Enterprise Manager on the server machine > Main tab > Stop Service > Start Service.
You should then see the new script option(s) available upon restarting the program.
If you need assistance with this process, we are happy to help! Please reach out to RI-Support@eab.com with questions.
Video Tutorial
Comments
0 comments
Article is closed for comments.