Engineering analysis + design software

LUSAS User Area

LUSAS Programmable Interface (LPI) Scripts

The LUSAS Programmable Interface (LPI) is a very powerful tool for customising and automating LUSAS operations. Scripts may be used to automate repetitive modelling and results-processing tasks, to save time and also help to ensure consistency. A collection of scripts is provided for use with LUSAS version 14.0 onwards.

For basic information on scripting see:

Documentation available

  • LUSAS Programmable Interface (LPI) Customisation and Automation Guide - see LUSAS Manuals Supplied for links to a version suitable for your installation.

  • LUSAS Programmable Interface (LPI) Developer Guide - see LUSAS Manuals Supplied for links to a version suitable for your installation.

  • LUSAS Programmable Interface (LPI) Online Reference Manual - Accessed using the LUSAS menu item Help > LPI Reference Manual

Example Visual Basic scripts

These scripts are provided for demonstrating how LUSAS Programmable Interface (LPI) and Visual Basic may be used with LUSAS and are not part of the LUSAS software.  As such, they are not quality approved, nor supported by LUSAS Technical Support for updating or modifications. Nevertheless, they are very helpful in performing special customised operations. Users are welcome to edit and modify these scripts, if they wish to do so. The scripts were created for a particular software release. The methods used may still be relevant for later versions of the software.

To use a selected script:

  1. Download the zip file and save locally.

  2. Unzip the file and read the instructions file which is provided in addition to the vbs file.

  3. In LUSAS Modeller go to File > Script > Run Script... and navigate to the directory the script was unzipped to, select the script and click OK to run it.

  4. Please note that Chrome browser may block downloading the following scripts. You may try other available browsers if you hit such an issue. 

Last Updated        Script Details 
  • Convert the prn output file from Slice Resultants Beams/Shells to a csv  

This script converts the prn output file from the Slice Resultants Beams/Shells utility created when slices are taken for more than one loadcase to a csv file format. After the script has run, a comma separated values file “SRBS_reformatted_prn.csv” is created and this can be opened in Excel.  The script assumes  that the SliceResultantsBeamsShells.prn file has already been created in the working folder.
The advantage of using this script is that all result values will be written in continuous columns which will be very useful for any Excel Post processing operations.

  • Plot Aspect Ratios

This script  can be used for plotting element aspect ratios with a Contours layer. It creates a scripted results entity “UserResults” and a results component “AspectRatio(Edges)”  giving an element nodal result (not averaged nodal) constant per element to the value of the ratio between the longest element edge and the shortest element edge.  If any elements of an aspect ratio greater than 10:1 are found then each element exceeding this ratio is identified in a message in the text output window and the element is added to a group called “EltsAspRatGrtrThan10”. This script is particularly useful for identifying and remedying meshing problems, where elements of poor shape have been created.

Expand and Check Smart Combinations

This script will expand an active smart combinations for checking permanent and variable load factors used for each component load case in it.
  • Moving Vertical Pedestrian Loading to BD37/01 (V15) 

A practical approach for dynamic analysis of lightweight bridges

Download V15 Script and PDF file

Download Office 2000 PPT and AVI files

  • Print Relative Displacements with Respect to a Node

    This script is for printing the relative displacements of all nodes in the model relative to a predefined node and for a range of loadcases. Results are written in the Modeller Text Output Window. Displacement results produced from an analysis are absolute by default, i.e. they refer to the initial / undeformed position of nodes. There are cases where relative displacements are useful i.e. referring them to another node of the mesh. 

  • Incrementally Launched Bridge 

This script creates a base model for incremental launch of a box girder bridge. The analysis method of moving supports is adopted. The repetitive process of assigning supports and loads, and activating segments of deck, is automated.  
A further automation script is provided in the zip file. This places the reactions in a spreadsheet arranged by loadcase and by pier.

  • Set model view perpendicular to a plane defined by three selected points.

This script may be useful for viewing the model normal to a desired plane or when using the ‘Slice Resultant Beam/Shell’ facility when the surfaces of interest are arbitrarily orientated

  • Slice and Split Multiple Surfaces Using a Curved surface

This script can be used for automatically slicing and splitting multiple surfaces by a curved surface. In the zip file a test model is provided for testing the script on it.

  • Create Multiple Surfaces from a Large Selection of Lines

This script creates multiple surfaces from a large selection of lines.  It will create triangular surfaces from 3 lines where possible first, then it will create quadrilateral surfaces from 4 lines.  The script will avoid creating coincident surfaces and will check for the presence of triangular surfaces before creating a quadrilateral surface coincident with existing triangular surfaces.  This is particularly useful for creating multiple surfaces quickly where geometry from a CAD package has imported just as a frame of lines and points.  It can also be useful for reconstructing surfaces that have been deleted to resolve connectivity problems in the underlying points and lines.

  • Name Geometry Features with a Prefix and a Sequential Number in Selection Order

This script gives selected features a name that includes a prefix and sequential numbering in the order that the features were selected starting at a specified number.  This is useful for post-processing where the feature name (rather than ID) may be used as a reference for results output, for example in a report.

  • Compute the Angle and Change in Angle between Two Vectors Defined by Selected Nodes

This script requires that four nodes are selected to define two vectors and computes the angle between these vectors.  The angle between the vectors for the original mesh, for the deformed mesh and the change in angle is given in the Text Output window.

  • Dynamic Varying Moving Load

This script demonstrates how to create a dynamic moving load with a varying magnitude. This script will create a copy of the model and add multiple load cases with moving and varying load assignments. The default load variation is a sine wave, but this can be changed by editing the script.

  • Orientate Beam Local y Axis Horizontally for Selected Lines

This script will automate the assignment of line meshes, using automatically generated local coordinate attributes, to keep the axes consistent. The chosen orientation is for the local y-axis to always be horizontal.

  • Surface Areas

This script will calculate the total area of the currently selected surfaces in a model.

  • Export Averaged Nodal Results to Excel

This script outputs averaged nodal results of "selected" nodes to an Excel spreadsheet for requested results components. The created drop down lists in Excel can be used to easily filter and sort results into the desired format.

  • Copy Loads From Current Load Case to Multiple Load Cases

This script copies specified loads assignments in the currently active loadcase to a specified range of loadcases.  Note that load factors are not copied in this test script and all the new assignments will have a load factor of 1.0. Discrete loads are excluded in this script

  • Export 3D Thick Beam Fibre Stresses to Excel

This script outputs stress results to an Excel Spreadsheet for all fibres of all 3D thick beams in a model.  Results are initially ordered by geometric attribute, then fibre location, then element, then node. However the created drop down lists in Excel can be used to easily filter and sort results into the desired format. 

  • Assign a Load Attribute to Selected Features in Multiple Load Cases

This script assigns a chosen load attribute to all desired loadcases with a specified range. Select the features to which you wish to assign a particular load. Note down the attribute ID number (in the attributes treeview) of the load that you wish to assign. Also note the ID number of the first and last loadcase that you wish to assign the load to before running the script and input these after running the script. The load will be assigned to all selected features for all given load cases.

  • Check and Tabulate All Load Factors in a Spreadsheet 

This script creates a comma separated value file of the assigned load factors of all assigned loads for all loadcases to be opened in a spreadsheet application.

  • Check and Detect Short Lines 

This script creates a group of lines that have a length below a maximum value that the user can specify.  This is particularly useful for identifying and remedying connectivity problems, perhaps in a model created by importing geometry from a CAD package.

  • Automate Graph Through 2D and Export Results to a Spreadsheet

This script performs a graph through 2D operation to extract force and moment results from a slice along a selected line for the active loadcase results.  All results are output against the distance along the line to a spreadsheet.  

  • Annotate Length of Selected Lines

This script annotates selected lines with their length.  This can be done in V14.4 onwards using standard Labels layer.  This facility could be useful for creating plots showing model dimensions for QA purposes.

  • Select Nearby Features

This script selects a geometry feature of the type specified, nearest to the coordinates specified. This can be useful for selecting features in a certain known location in a complex model, or for checking for rogue or superfluous geometry features in CAD imported geometry that may cause connectivity problems.

  • Moving Vertical Pedestrian Loading to BS EN 1991-2 2003 (Eurocode)  (V14, for V15 see the new link above) 

    A practical approach for dynamic analysis of lightweight bridges in V14 

    Download V14 Script and instructions PDF file

The following PDF files are relevant when using this script:

  • Compute Standard Deviation in Unaveraged Nodal Values

This script determines the averaged nodal value for Standard Deviation in unaveraged nodal values for the visible model, active loadcase, specified results entity and specified results component.  The Standard Deviation divided by maximum absolute unaveraged nodal value is also determined.  These results can then be used for mesh refinement studies as a means of assessing the suitability of the sizes and of the number of elements, the interpolation order of elements used and the elements’ shapes.


innovative | flexible | trusted

LUSAS is a trademark and trading name of Finite Element Analysis Ltd. Copyright 1982 - 2022. Last modified: May 10, 2023 . Privacy policy. 
Any modelling, design and analysis capabilities described are dependent upon the LUSAS software product, version and option in use.