SpaceClaim Online Help
You are here: Customizing SpaceClaim > Scripting

Scripting

 

Refer to the Class LibraryClosed for a detailed description of the API. A copy of the Class Library compiled help file (.chm) is included in the installation directory. You can also download the latest version here.

 

You can work with SpaceClaim programmatically using Python. A built-in script editor allows you to create and run scripts to perform repetitive tasks and work with models and geometry.

 

Use File>New>Script to begin a new script.

 

Use File>Open to open an existing script file (*.scscript, *.py).

 

When you exit SpaceClaim with an open script, you are asked if you want to save the existing script.

Script Editor

The Script Editor has the following functions.

Script is written in the main Script Window but can also be entered as single commands in the command line.

Intellisense is included in the editor to assist with entering commands.

The editor supports the following shortcuts:

Results of running a script, including error and warnings, are written to the Output Window.

Snippets

Snippets are chunks of code that can be inserted into your script. They are presented in a dropdown folder browser with tooltip help describing the function of each Snippet.

You can write your own Snippets and add them to the Snippet directory, which is a collection of directories and XML files.

 

ClosedSnippet example

Script Groups

Scripts can be saved to GroupsClosed to store them in the model. In the Script Editor, open the dropdown menu on the Save button and check Save Script to Group. Click the Save button to create the group and add it to the Scripts folder in the Groups PanelClosed.

Script Parameters

Variables used in scripts can be saved to Parameter Groups. This allows you to easily modify the values without editing the script.

To create a Parameter group

  1. Create a Script group
  2. Right-click in the Groups Panel and choose Create Parameter from the menu
  3. The parameter is created with a default name and a default value of zero
  4. Rename the Parameter
ClosedScript Group and Parameter example

 

 


© Copyright 2016 SpaceClaim Corporation. All rights reserved.