Skip to main content

PyAVEVAE3D

PyAVEVAE3D contains Proof of Concept for Python 3 embedding into AVEVA Plant Design Products ( e.g. PDMS, E3D2.1/ 3.1, Diagrams, Engineering). These software are based on PML & PML.Net.

This repository has Visual Studio Project Solution. The Solution contains 2 main projects:

  • PyAVEVAInteraction : It contains the architectural skeleton for Python Embadding into AVEVA E3D2.1.0.3. and It invoks the either system level python or virtual enviroment python.

  • PyAVEVAE3DExt : It's Python extension module. It contains the c++ & python classes which allows python to directly interact with the AVEVA E3D.

Build Environment Information

  • AVEVA E3D Version : Mk2.1.0.3[Z2103-12] (WINDOWS-NT 6.1) (27 Apr 2016 : 23:54)
  • Python : Python 3.10.4 (tags/v3.10.4:9d38120, Mar 23 2022, 22:57:10) [MSC v.1929 32 bit (Intel)] on win32
  • Visual Studio : 2022

Procedure For Utilizing the Enviroment

  1. Copy following files from solution to the pmllib folder,

    ..\PyAVEVAE3D\PyAVEVAE3DExt\DataBridge.pmlobj

    ..\PyAVEVAE3D\PyAVEVAInteraction\RunPy.pmlfrm

  2. Create Python 32bit Virtual enviroment. and Create PML Global Variable for Accessing Python Virtual from E3D Session. Use the following pml command,

    !!pyVenv = |path to virtual environment/Scripts/python.exe|
    
  3. Copy Dll files from repository to Aveva Installation Directory.

    From : ..\PyAVEVAE3D\SampleDlls\PyAVEVAInteraction.dll

    To : %AVEVA_DESIGN_EXE%

  4. Install pyavevae3dext

    -- Method 1: using pip install pyavevae3dext.

    -- Method 2: Build the .pyd file based on the your module dependencies and build the package. Refer Development Documetation Section

  5. Open RunPy form using pml command Show !!RunPy. RunPy Form is used to write a test python scripts.

  6. Run Python Script form the Form. And All the output from python scripts will be printed in the AVEVA console. e.g. print("abc") in python will give the output in the python console.

More information on pyavevae3dext PiPy Package.

pyavevae3dext PiPy package has basically 3 classes.

  1. COMMON:

    Common Class Instentiation,

    from pyavevae3dext import *
    c = COMMON()
    

    Method to know about current mdb.

    c.mdb()
    

    Method to execute Savework command.

    c.savework()
    

    Method to execute Getwork command.

    c.getwork()
    

    Getter-Setter for CE,

    print(c.ce()) #Getter
    c.ce = "/ElementName" #Setter
    
  2. DB:

    Db Class Instentiation,

    from pyavevae3dext import *
    d = DB()
    

    Method to know Attributes on current elements,

    att = d.attributes()
    print(att)
    

    Method to Get Collection as List for the Element,

    elms = d.collectAllForElement("/SITE-CABLE-AREA03")
    print(elms)
    

    Method to Get Collection as List for the Element,

    elms = d.collectAllFor("PIPE BRAN", "/SITE-PIPING-AREA01 /SITE-PIPING-AREA02")
    print(elms)
    

    Method to Set String Attribute for Element,

    d.SetStringAttribute("/SITE-PIPING-AREA03", "Description",  "This is test description")
    

    Method to Set Real Attribute for Element,

    d.SetRealAttribute("/SITE-PIPING-AREA03", "Number", 5)
    

    Method to Set Bool Attribute for Element,

    d.SetBoolAttribute("/SITE-PIPING-AREA03", "Lock", True)
    
  3. PML:

    PML Class Instentiation,

    from pyavevae3dext import *
    p = PML()
    

    Method to Run the PML Command in PDMS Console,

    p.RunInPdms("$p This Message is From Python...")
    

    Method to Run the PML Command in .Net Environment,

    p.Run("/SITE-CABLE-AREA03") # /SITE-CABLE-AREA03 will be set as current element 
    

    To utilize the methods mentioned below, the variables in the PML Commandline must be defined as global variable.

    Run the below code in PML Commandline to define the pml global variable,

    !!AR[1] = 'A'
    !!AR[2] = 'b1'
    !!AR[3] = 'C'
    !BOOL = true
    !REAL = 5
    !STR = |Hii.. This message is From PML.|
    

    Method to get the Value of the PML Variable as String,

    value = p.GetPmlString("STR")
    print(value)
    

    Method to get the Value of the PML Variable as Long,

    value = p.GetPmlReal("REAL")
    print(value)
    

    Method to get the Value of the PML Variable as Bool,

    value = p.GetPmlBool("BOOL")
    print(value)
    

    Method to get the Value of the PML Variable as Array/ List,

    value = p.GetPmlArray("AR")
    print(value)
    

Procedure For Setting Up Development Enviroment

Refer the Development Documetation Section for Detailed Procedure for setting up development environment.

General Guideline

-- For Utilzing Python with Other AVEVA Software, Please install the Python version compatible to the AVEVA module architecture e.g. (x86, x64). and Make sure the platform architectural dependencies (Python and AVEVA Dll) for Build/ Release.

-- conda Environment as well conpatible. Make sure the conda environment platform architecture e.g. (x86, x64).

Metadata

Release files for pyavevae3dext 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyavevae3dext 0.0.2
File Size Uploaded Provenance Actions
pyavevae3dext-0.0.2.tar.gz 48.5 kB Without provenance Details for pyavevae3dext-0.0.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pyavevae3dext 0.0.2
File Interpreter ABI Platform Actions
pyavevae3dext-0.0.2-py3-none-any.whl Python 3 none any Details for pyavevae3dext-0.0.2-py3-none-any.whl

Total release size: 94.0 kB

Release files / pyavevae3dext-0.0.2.tar.gz

Download URL pyavevae3dext-0.0.2.tar.gz
Size 48.5 kB
Tags Source
SHA-256 checksum
How to use checksums
58aac9e8bf85ce30ed615998c53795bcbf6b7d4a689ffac013cd13aecc6c0fe1
BLAKE2b-256 checksum
How to use checksums
51b1fd0de9994076bfe55d07451a5b27e0b4687b0947bd7f65ae49f4b2e4831c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.10.4

Release files / pyavevae3dext-0.0.2-py3-none-any.whl

Download URL pyavevae3dext-0.0.2-py3-none-any.whl
Size 45.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
eb27c67083f2925c86d3b98fe398c4f3f51beacc9819f8e537cb5a7aeb884386
BLAKE2b-256 checksum
How to use checksums
85949cd72e2d6aff57a5ed246e4d047220b7cbdec61d4c741207836e38eac554
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.10.4

Security for pyavevae3dext 0.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page