IronPython API
Details
- A detailed description of the API is located in the client's help folder (%client_folder%\help).
- If you have trouble opening the file, see the hints below.
- Another version can be found here: Iron_python_API.chm
How to
- To access to the documentation, download the file mentioned above
- Right click on the file and select properties.
- Click on Unblock and then on Apply
Various Know-how
Embedding IronPython code in a module
How to
- Select a DA in your module
- Insert a new DF with ID 004336 and change DF-Verhalten 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 IronPython:
GetValue[T]()
Notes
- Keep in mind for C#, Visual Basic and Visual C++ it is "String" but in Python it is "str"
- For reason of the IronPython bug, the indexers of the generic .NET collections will not work if a first access to them was not correct (for example the indexer requires int but you put a string value). So use the attribute _getitem_ instead of [] explicitly or please be sure that indexers are used correct.
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
Useful snippets
Getting the value of a DI that is in the same DA as the IronPython macro:
df.DataArea.ChildrenDF[df.DataArea.Customizing.get_df_by_name(DF-Python-ID)].GetValue[T]()
Microsoft .NET Framework