Icon Manage Scripts

The Manage Scripts node in the Administration Tool is used to manage the CustomTools script add-ins that could be attached to several CustomTools features such as the Export in CustomTools 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 need 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, are compiled automatically on the next startup of SOLIDWORKS. Also the scripts which are changed since the last compiling, are re-compiled automatically on SOLIDWORKS startup.

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

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

Scripts Management:

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 loading of the script on the SOLIDWORKS startup.
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.

Info 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.


Referenced assemblies:

Add Add a new referenced assebly. Reference assemblies (.dll files) you have added, appear 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 { 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. With the CustomTools 2015 version, Microsoft .NET Framework 4.5 version is required.


Other controls:

Compile Compiles the script.
Check In Save the script changes into the database.

The script is compiled before it is stored 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 that tells whether the operation was successfull or not.
Ln Shows the current line number where the cursor is located vertically.
Ch Shows the character number where the cursor is located horizontally.




Related Topics

Add reference assembly
Additional files

External: Microsoft Visual Studio website

Back to Top