Translating an Element

This script shows how to translate (move) an Element. Translations can be done in the local space of the Element (LCS – Local Coordinate System) or in the global space of the scene (WCS- World Coordinate System import Geom import OpenLxApp as lx import OpenLxUI as ui app = lx.Application.getInstance() doc = app.getActiveDocument() #——————– # […]

Read More

Creation of an Element

This first script is basically the same as the one in ‘Quick Start’. It just creates an Element with a Block as its geometry. For a detailed description of this script please refer to the Quick Start page. #=============================================================================== # # CREATING AN ELEMENT # #=============================================================================== #—————————– # 1. Import Lexocad libraries. #—————————– import OpenLxApp […]

Read More

Editors

If you want to use a special editor to create your Python scripts, take a look at the following ones: Eclipse https://www.eclipse.org/ Notepad++ https://notepad-plus-plus.org/ PyCharm https://www.jetbrains.com/pycharm/ Python Tools for Visual Studio https://github.com/Microsoft/PTVS

Read More

A closer look at the script

Let us examine the example a bit closer. # Import Lexocad libraries import OpenLxApp as lx The import statement loads existing Python code from another file – a module. The Python binding to Lexocad is defined by modules. By importing a module you gain access to Lexocad’s functions through the API (Application Programming Interface). # […]

Read More

Quick Start

Below is a very simple script. The easiest way to test and get it working: Start Lexocad. In the menu go to: Extra > Python > Python Console. Copy the script below and paste it inside the interactive console, eventually press the [Enter] key. # Create Block example # Import Lexocad libraries import OpenLxApp as […]

Read More

Overview

Python is a programming language in which scripts for Lexocad are written. You do not need a separate Python installation: Python is implemented in Lexocad and runs out of the box. If you are new to Python, please read the official Python tutorial here: https://docs.python.org/2.7/tutorial/ Python scripts can be executed in Lexocad by writing the […]

Read More