Author: Hans
Removing an Element
This script shows how to remove an Element from the document. This can be done by calling the document’s ‘removeObject()’ method. Please be aware that the Element still exists in memory, it just does not belong to the document anymore. You can reassign it by calling the ‘addObject()’ method. This can be useful for undo/redo […]
Read MoreSetting the color of an Element
This script shows how to set the color, transparency and line width of an Element. There are four colors in Lexocad which define the visual appearance of an Element: Diffuse Color Emissive Color Specular Color Ambient Color Please refer to the Draw.OglMaterial class for more information. import Base import OpenLxApp as lx import OpenLxUI as ui app […]
Read MoreCopying an Element
This script shows how to copy an Element. import Geom import OpenLxApp as lx import OpenLxUI as ui app = lx.Application.getInstance() doc = app.getActiveDocument() #———————- # Creating 1st element. #———————- cylinder = lx.RightCircularCylinder.createIn(doc) elem1 = lx.Element.createIn(doc) elem1.setGeometry(cylinder) cylinder.setHeight(0.5) cylinder.setRadius(0.5) #————————————- # Copying and positioning 2nd element. #————————————- elem2 = elem1.copy() elem2.translate(Geom.Vec(0, 2, 0), Geom.CoordSpace_WCS) doc.recompute()
Read MoreRotating an Element
This script shows how to rotate an Element around an axis. The rotation can be done in the local space of the Element (LCS) or the global space of the scene (WCS). The rotation axis is defined by the Geom.Ax1 class. All angles are in radians. import Base, Geom import OpenLxApp as lx import OpenLxUI as ui […]
Read MoreTranslating 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 MoreCreation 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 MorePython License
https://docs.python.org/2.7/license.html
Read More