Iron Python API

Details

How to

  • To access the documentation, download the file mentioned above
  • Right click the file and select properties
  • Click on Unblock and then on Apply

Various Know-how

Embedding Iron Python code in a module

How to
  • Select a DA in your module
  • Insert a new DF with ID 004336 and change DF-Verh. to py
  • Close the DA and reopen it
  • Expand the DI and paste your code into IronPython Skript
  • Save and start the module
  • Add the following code at the top:
     # coding: latin-1"
  • Code that looks like this in C#:
    GetValue<T>()
  • Will look like this in Iron Python:
    GetValue[T]()

Note

  • Keep in mind for C#, Visual Basic and Visual C++ it's "String" but in Python it's "str"

Reload modules on local client without client-restart

Information
  • In order to apply code changes without the need of a client-restart, use the following guideline.

How to

  • Insert the following code prior to the import statement of the target module:
    sys.modules.Remove("MyModule")
  • After the statement above, place your unchanged import statement:
    from MyModule import MyModule
  • The conditions for your AddReference-statement stays the same as before - it needs to stay prior to your import statement but it can stay before or after the statement of step 1.

Useful snippets

Method Parameter Return value Comment
df   Returns the DF the Iron Python script was executed from

Getting the value of a DI that is in the same DA as the Iron Python macro:

df.DataArea.ChildrenDF[df.DataArea.Customizing.get_df_by_name(DF-Python-ID)].GetValue[T]()

Microsoft .NET Framework

Topic attachments
I Attachment History Size Date Comment
Chmchm Iron_python_API.chm r1 279.2 K 2009-07-10 - 19:10  

         PLANTA project









 
  • Suche in Topic-Namen

  • Suche in Topic-Inhalten
This site is powered by the TWiki collaboration platform Powered by Perl