Options - Python

Click File on the Ribbon and select Options > Python to specify PythonPath folders.

Note: Cadcorp SIS Desktop supports Python 3.2 and only Python 3.2. No other versions of Python are supported. Cadcorp SIS Desktop and Python must be the same bit version (both should be 32-bit or both 64-bit.)

PYTHONPATH* folders

PYTHONPATH is a native environment variable in Python. PYTHONPATH variable allows you to specify custom locations where Python in SIS should look for additional Python extension modules.

TIP: See also Python documentation for details of PYTHONPATH: https://docs.python.org/3.2/using/cmdline.html#envvar-PYTHONPATH

PYTHONSTARTUP* filename

PYTHONSTARTUP is the name of a .py file containing commands that are executed at Cadcorp SIS Desktop startup to carry out repetitive operations.

The .py file can be located in any convenient folder and targeted from the PYTHONSTARTUP* filename folder icon.

An example of a simple .py file may be:

#import sis
from cadcorp import sis

#Define function called 'main'
def main():
                for x in range(0,6): 
                                sis.CreatePoint(150 +x,150 +x ,0,"circle", 0, 15000)
                                sis.DoCommand("AComRedraw")          
if __name__ == "__main__":
                main()

This example code creates six circle symbols at the coordinates specified in the CreatePoint Method.

See Python documentation for details of PYTHONSTARTUP: https://docs.python.org/3.2/using/cmdline.html#envvar-PYTHONSTARTUP

Note: RestartCadcorp SIS Desktop to update any changes made to PYTHONPATH and/or PYTHONSTARTUP.