How to find out the syntax of PyFlux expressions?

Introduction

To write in PyFlux language, the user needs to know the syntax of the PyFlux expressions (Flux commands in the PyFlux language).

How to find out the PyFlux syntax

There are five methods to find out the syntax of the PyFlux expressions.

These methods are presented in the table below and explained in the following blocks.

Method Description
1 recover the syntax in a command file
2 recover the syntax in the Echo zone
3 activate the entity command Display PyFlux command (contextual menu, right click on item in the menu tree)
3' apply the Python type() method to the entity (Command prompt zone )
4 apply the Python help() method to the entity (Command prompt zone )

(1) …in a command file

To recover the PyFlux expression of a Flux command applied during the session:

  • use the command file*, which saves the Flux commands** when the Flux program running

* Details on management of command files are presented in section Management and execution of command files .

** The ‘ graphic'commands are not automatically written in the command file created by default.

To recover these commands the user must activate the writing of the graphic commands. This command is described in section: How to Activate/ inactivate the writing of graphic commands .

(2) … in the Echo zone

To recover the PyFlux expression of a Flux command:

  • activate the Flux command
  • directly recover the syntax within the Echo zone

Example:

Echo of the command Open project > CASE1.FLU :

loadProject('case1.flu')

(3) Command Display the PyFlux expression

In order to find out the PyFlux expression of a Flux entity (the type and attributes):

  • in the contextual menu of the Flux entity, click on the Display PyFlux command
  • recover the syntax within the History zone

Example:

Display of the PyFlux expression of the command Point[1] :

Typing Point[1]
PointCoordinates(color=Color['White'],
                 visibility=Visibility['VISIBLE'],
                 coordSys=CoordSys['CENTER'],
                 uvw=['-60',
                 '0',
                 '0'],
                 nature=Nature['STANDARD'],
                 mesh=MeshPoint['E_SHAPE'])
End typing Point[1]

(3') type() method

In order to find out the PyFlux expression of a Flux entity (the type and attributes):

  • in the Command zone, apply the Python type() method to the Flux entity
  • recover the syntax within the History zone

The Python type() method is equivalent to the Flux command Display PyFlux command

Example:

Result of the command Point[1].type():

PointCoordinates(color=Color['White'],
                           visibility=Visibility['VISIBLE'],
                           coordSys=CoordSys['CENTER'],
                           uvw=['-60',
                           '0',
                           '0'],
                           nature=Nature['STANDARD'],
                           mesh=MeshPoint['E_SHAPE'])

(4) help() method

In order to find out the PyFlux syntax of the complete structure of a Flux type-entity (its attributes, sub-types, methods, selection method):

  • in the Command zone, apply the Python help() method to the Flux type-entity (type PyFlux).
  • recover the syntax within the History zone

Example:

Result of the command ParameterGeom.help() :

ParameterGeom (Entity for parametrizing a geometry) : 
Type Entity (read write) Fields : - 
ParameterGeom[id name].expression (Expression for the parameter) : [1...1] of C80 (read write) -
ParameterGeom[id name].name (Name of Parameter) : [1...1] of C80 (read write)
ParameterGeom[id name].value (parameter value) : [1...1] of R08 (read)