Include parameter¶
Within a pyp file it’s possible to include the parameters of another file. This can be be used e.g. to include
files with general PythonPart parameter
files with parameter blocks for indexing
into the current pyp file. The use of the include allows to define these parameters only once, avoids a lot of typing and simplifies the modification of the pyp file.
Syntax¶
The include statement must be added to the <Page> tag of the pyp file. When the entries in the file IncludeParameter.incpyp are
and the text IDs defined as
the above include statement creates the parameter in the current pyp file as
The general form of the include statement is:
#include _file_name;index1,text1;index2,text2;…|LanguageFile=IncludeParameter_incpyp
with the following definition
file_name |
Path and name of the file to include. The path can be defined locally to the current pyp file or with a leading etc\, std\, usr\ or prj\ to make it globally a standard Allplan path. |
index… |
Index of the parameter which will be added to the name value in all existing <Name> tags from the include file. The value can be a string, a single number or an index range. |
text… |
Text, which will replace the # character in all existing <Text> tags from the include file. The text can be a text ID like 1002. In case of an index range like 2-4, the index replaces the #. |
LanguageFile=… |
Definition of the language file for the <TextId> tags from the include file. The path can be defined locally to the current pyp file or with a leading etc\, std\, usr\ or prj\ to make it globally a standard Allplan path. If the language file is not defined, the text for the IDs is taken from the resource file of the pyp file. |
If the index value is an index range, the index can also be used to replace the # in a <Visible> or <Enable> tag defined like
<Visible>CoordCount >= #</Visible>
The use of the include statement is shown in the example
…\etc\Examples\PythonParts\PaletteExamples\IncludeParameter.pyp…\etc\PythonPartsExampleScripts\PaletteExamples\IncludeParameter.py