0% found this document useful (0 votes)
4 views6 pages

OneLiner PythonAPI Setup 2024-07-24

The document is a setup guide for configuring Python IDEs to use the ASPEN OneLiner Python API, requiring ASPEN OneLiner V15.7 or higher and 32-bit Python 3.8 or higher. It provides detailed instructions for setting up Visual Studio Code, PyScripter, and IDLE, including necessary code snippets for testing the configuration. Additional information on file locations and support contact is also included.

Uploaded by

Giovani Scarpati
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views6 pages

OneLiner PythonAPI Setup 2024-07-24

The document is a setup guide for configuring Python IDEs to use the ASPEN OneLiner Python API, requiring ASPEN OneLiner V15.7 or higher and 32-bit Python 3.8 or higher. It provides detailed instructions for setting up Visual Studio Code, PyScripter, and IDLE, including necessary code snippets for testing the configuration. Additional information on file locations and support contact is also included.

Uploaded by

Giovani Scarpati
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

ASPEN OneLiner Python API Setup Guide

IDE Setup Examples

This document provides examples of configuring a Python Integrated Development Environment (IDE) to use the
OneLiner Python API.

Software requirements

● ASPEN OneLiner V15.7 or higher


● 32-bit Python 3.8 or higher (64-bit Python is not currently supported)
○ If you are using a network license for OneLiner, the OneLiner Python API will try to copy the
OneLiner "hasp_rt.exe" file into the same folder where your [Link] is located. This allows the
API to interact with the OneLiner license manager. Sometimes, this copy process fails due to write
restrictions in the location. If you are using a network license and find that the hasp_rt.exe file is
not copied into the folder where your [Link] file is located, please try to manually copy the
hasp_rt.exe file into the directory where your [Link] is located. The default installation location
of the OneLiner hasp_rt.exe file is C:\Program Files (x86)\ASPEN\1LPFv15\hasp_rt.exe.
● A Python IDE

Additional details

Please address questions to ASPEN support at support@[Link].

OneLiner Python API Directory and Files


The OneLiner Python API is installed during the OneLiner installation. The default OneLiner installation directory is:

● C:\Program Files (x86)\ASPEN\1LPFv15\

The core API file is a DLL located in that directory:

● C:\Program Files (x86)\ASPEN\1LPFv15\[Link]

The Python portion of the API is installed in a subdirectory of the OneLiner installation folder:

● C:\Program Files (x86)\ASPEN\1LPFv15\OlxAPI\Python\

The Python API files are:

● [Link] Object-oriented library for Python OlxAPI application development


● [Link] Collection of code snippets with demo usage of the OlxObj library
● [Link] Python wrapper for [Link]
● [Link] Collection of code snippets with demo usage of OlxAPI function calls
● [Link] OlxAPI constants
● [Link] Library of OLR file data and other routines
● [Link] Library of useful re-usable routines

Jump To IDE Setup Examples


VS Code Setup for OneLiner Python API
PyScripter Setup for OneLiner Python API
IDLE Setup for OneLiner Python API
VS Code Setup for OneLiner Python API
The following steps show an example of configuring Visual Studio Code (VS Code) to use the OneLiner Python API.

1. Launch VS Code.
2. Click the VS Code Command Pallete (Search Bar).

3. Type “>Python: Select Interpreter” into the Command Pallete and click the option that appears
below the search bar (shown in blue text below). Note: You must type the “>” symbol at the beginning, but
do not type the quotes. Alternatively, you can use the hotkey “Ctrl + Shift + P” to jump to the Command
Pallete, including placement of the “>” symbol.

4. Click an appropriate Python version from the list of those available on your machine. Note: You must install
Python separately from VS Code, and you must select a 32-bit Python with version 3.8 or higher.

5. Run the following Python code in VS Code (copy-paste) to test the configuration. Note: If OneLiner is not
installed in the default directory, you must update the directory paths in this code accordingly.

import os,sys
[Link]('C:\\Program Files (x86)\\ASPEN\\1LPFv15')
[Link]('C:\\Program Files (x86)\\ASPEN\\1LPFv15\\OlxAPI\\python')
import OlxObj
OlxObj.load_olxapi('C:\\Program Files (x86)\\ASPEN\\1LPFv15')

6. If successful, you should see messages in the terminal similar to the following.
PyScripter Setup for OneLiner Python API
The following steps show an example of configuring PyScripter to use the OneLiner Python API.

1. Launch PyScripter.
2. Click Run - Python Versions - Setup Python Versions.
3. Click the gear symbol with a plus mark, and navigate to the folder of an appropriate Python installation.
Note: You must install Python separately from PyScripter, and you must select a 32-bit Python with version
3.8 or higher.

4. Select the Python version from the list and click the gear symbol with an arrow symbol. Note: Your installed
Python version may appear in either the Registered or Unregistered menu, depending on the options
selected when installing Python.
5. Run the following Python code in PyScripter (copy-paste) to test the configuration. Note: If OneLiner is not
installed in the default directory, you must update the directory paths in this code accordingly.

import os,sys
[Link]('C:\\Program Files (x86)\\ASPEN\\1LPFv15')
[Link]('C:\\Program Files (x86)\\ASPEN\\1LPFv15\\OlxAPI\\python')
import OlxObj
OlxObj.load_olxapi('C:\\Program Files (x86)\\ASPEN\\1LPFv15')

6. If successful, you should see messages in the terminal similar to the following.
IDLE Setup for OneLiner Python API
Since the Python IDLE IDE is associated with only one Python installation, additional configuration is not necessary
to use the Python API with IDLE.

The following steps show an example of configuring Python IDLE to use the OneLiner Python API.

1. Launch IDLE. Note: You must use 32-bit Python with version 3.8 or higher.

2. To test the configuration, run the following Python code line by line. Note: If OneLiner is not installed in the
default directory, you must update the directory paths in this code accordingly.

import os,sys
[Link]('C:\\Program Files (x86)\\ASPEN\\1LPFv15')
[Link]('C:\\Program Files (x86)\\ASPEN\\1LPFv15\\OlxAPI\\python')
import OlxObj
OlxObj.load_olxapi('C:\\Program Files (x86)\\ASPEN\\1LPFv15')

3. If successful, you should see messages similar to the following print in the terminal.

You might also like