Icon Manage Scripts

The Manage Scripts node in the CUSTOMTOOLS Administration is used to manage the CUSTOMTOOLS script add-ins. Script add-ins could be associated to several CUSTOMTOOLS features such as Export, available in the SOLIDWORKS Add-In. Script add-ins are usually used for generating customized reports with the Export feature but, the script add-ins could be used also to customize other CUSTOMTOOLS operations like file conversion for example.

Script add-in development is not included in CUSTOMTOOLS maintenance subscription of any license level. So if your CUSTOMTOOLS environment needs any functionality customizations that could be or have to be implemented by a script add-in, please contact the CUSTOMTOOLS Sales Team or, use the Contact form available in CUSTOMTOOLS website for the further information about script add-in possibilities and pricing.

Scripts that assembly file (.dll) is missing and, the scripts which are changed since the last compiling, are automatically being compiled on the next startup of the CUSTOMTOOLS Administration, CUSTOMTOOLS Viewer and/or the CUSTOMTOOLS add-in in SOLIDWORKS.

The script files are located in the following path in the local hard drive:

C:\Users\user name\AppData\Local\CustomTools\CUSTOMTOOLS 20xx\CustomToolsDatabaseName\Add-ins

NOTE: Windows XP operating system is not supported by CUSTOMTOOLS products.

Selected script Open the desired script for editing. The script code appears into the editor area automatically once the script is selected.

If your script does not exist in the list that opens from the Selected script box, click Browse to browse the system to locate the script.

Select <New Script> to create a new script.
Remove Script Removes the selected script from the CUSTOMTOOLS database. The script is not deleted from the disk with the Remove script command.
Name Sets the name for the new script.
Language Determines the programming language used to develop the script. When you open the existing script, the Language is read from the script and the correct programming language appears automatically into the Language box.
Class name Sets the startup method of the script. Scripts may have several methods. A class selected in the Class name box determines the one to be called on the script startup.

If the script have only one (1) class, the class name appear automatically into the Class name box on load and the Class name box does not have any alternative startup classes available.
Load at start-up Enable/Disable automatic loading of the selected script on startup of the CUSTOMTOOLS Administration, CUSTOMTOOLS Viewer and the CUSTOMTOOLS add-in in SOLIDWORKS.
Debug add-in The Debug add-in option allows you to develop your script add-in on the fly with help of the Microsoft Visual Studio. With Visual Studio you can debug and develop the source code of your add-in script implemented for example by using the Microsoft C# programming language.

TIP: You can add tabs into the script code by pressing the Tab key. The tab width in the CUSTOMTOOLS script is two (2) spaces.

The line number and the character number are shown below the script area to make easier to locate the issue if the script does not compile successfully.


Add Add a new referenced assebly. Reference assemblies (.dll files) you have added, appears into the Referenced assemblies list.
Edit Edit reference.
Remove Remove the selected assembly reference.
Additional Files Upload any kind of files used by the script into the database.

You can define the required Referenced assemblies also in the script code. This could be done by using the @AUTO-REFERENCE tags. Only one referenced assembly could be on the same row so, if the script needs more referenced asseblies, add all necessary referenced assemblies as their own rows.

For Example:

In a script that is written in C# programming language which needs the referenced assemblies called, Interop.CTEngineLib.dll, CTInterface.dll and System.Windows.Forms.dll, the referenced asseblies are defined in the beginning of the script code (even before the "using..." statements) as follows:

//@AUTO-REFERENCE { [CT_INSTALL_PATH]\Interop.CTEngineLib.dll }
//@AUTO-REFERENCE { [CT_INSTALL_PATH]\CTInterface.dll }
//@AUTO-REFERENCE { [ASSEMBLY_PATH]\ExampleReference.dll }
//@AUTO-REFERENCE { C:\Windows\Microsoft.NET\Framework64\v2.0.50727\System.Windows.Forms.dll }

NOTE: The // marks are the comment denotes in C# programming language so, if you are using some other programming language, you have to mark the automatic references by using the comment denotes of the programming language the script is written in.

The referenced assemblies defined in the script code are parsed from the code and added to the Referenced assemblies list when you compile the script by clicking Compile or when you check in the script into the database by clicking Check In.

CUSTOMTOOLS script add-ins should be developed using the same version of Microsoft .NET Framework as the CUSTOMTOOLS uses. Since the CUSTOMTOOLS 2015 major version, at least the Microsoft .NET Framework 4.5 version is required. However, the Microsoft .NET Framework 4.5.1 version is recommeneded.

Compile Compiles the script.
Check In Compile the script and save changes into the database.

The script is always compiled before it's changes are saved to the database. If the compiling does not succeed, you get prompted to decide whether or not to save the script into the database anyway.

Once the Compile and Check-In actions are done, the message box is shown to indicate whether the compile was successfull. If any errors occurred on the script compilation, they are included in the message.
Ln Shows the current line number where the cursor is located vertically.
Ch Shows the character number where the cursor is located horizontally.

While compiling the script in the CUSTOMTOOLS Administration, the automatic references are automatically parsed. All references with the [ASSEMBLY_PATH] attribute included in the path are verified on compile process to ensure that the reference files exist in the script add-in's output path.

TIP: To learn more about the CUSTOMTOOLS script references, please see the CUSTOMTOOLS API Documentation.



Send Feedback


Related Topics

Add reference assembly
Additional files

External: Microsoft Visual Studio website
External: CUSTOMTOOLS API Documentation (in English only)