Other available PyFlux commands

Introduction

There are additional commands available to the user that are not accessible by recopying a sequence of PyFlux.

Commands

The available commands are as follows:

  • startMacroTransaction() / endMacroTransaction()
  • getProjectName()
  • [ALL]
  • getHelp()
  • getPyFluxCommande()

These commands are described in the next sections.

startMacroTransaction()/endMacroTransaction()

The description and applications of this command are explained in the table below.

Commands startMacroTransaction() / endMacroTransaction()
Function Permits the regrouping of a set of commands in a block.
Use
startMacroTransaction()
# set of PyFlux commands
endMacroTransaction()
Example : Pyflux sequence

Creation of a triangle :

startMacroTransaction()
PointCoordinates(color=Color['White'],
                 visibility=Visibility['VISIBLE'],
                 coordSys=CoordSys['XYZ1'],
                 uvw=['0',
                 '0',
                 '0'],
                 nature=Nature['STANDARD'])
PointCoordinates(color=Color['White'],
                 visibility=Visibility['VISIBLE'],
                 coordSys=CoordSys['XYZ1'],
                 uvw=['0',
                 '0',
                 '10'],
                 nature=Nature['STANDARD'])
PointCoordinates(color=Color['White'],
                 visibility=Visibility['VISIBLE'],
                 coordSys=CoordSys['XYZ1'],
                 uvw=['10',
                 '0',
                 '0'],
                 nature=Nature['STANDARD'])
LineSegment(color=Color['White'],
                 visibility=Visibility['VISIBLE'],
                 defPoint=[Point[1],
                 Point[2]],
                 nature=Nature['STANDARD'])
LineSegment(color=Color['White'],
                 visibility=Visibility['VISIBLE'],
                 defPoint=[Point[2],
                 Point[3]],
                 nature=Nature['STANDARD'])
LineSegment(color=Color['White'],
                 visibility=Visibility['VISIBLE'],
                 defPoint=Point[[3],
                 Point[1]],
                 nature=Nature['STANDARD'])
endMacroTransaction()
Example : note The commands are evaluated and the graphics refreshed at the end of the sequence, permitting the acceleration of the process.

getProject Name()

The description and applications of this command are explained in the table below.

Commands getProjectName()
Function Permits the recovery of the name of the project open in Flux
Use Name= getProjectName() permits the storage of the project name in the ‘Name'variable
Example : PyFlux sequence

Display of the Flux project name in a file :

file = open("Name of project","a")
file.write("Name of project :")
file.write(getProjectName())
file.flush()
file.close()

[ALL]

The description and applications of this command are explained in the table below.

Commands [ALL]
Function Creates a the list of all entities of the same type which facilitates the storage of this list in a ‘Flux variable'
Use Points = Point[ALL] creates a list of all entities of the point type and enables the storage of this list in the « Points » variables.
Reminder / Comparison

The command List_instance(typeId='Point')* results in the display of all entities of the point type displayed in the History zone.

* syntax equivalent to the command List described under § § 5.3.2 Informations sur les entités : Afficher l'expression Pyflux, Lister, et Utiliser par..

Example : PyFlux sequence

Display of a detailed list of entities belonging to the same entity type in a file:

file = open("List of entities", "a")
file.write("Detailed list of points")
for I in Point[ALL] :
   file.write("\n\nInstance : ")
   file.write(repr(I))
   for field in Point.__fields.keys() :
      file.write("\n")
      file.write(field)
      file.write(" : ")
      file.write(repr(I.__getattr__(field)))
file.flush()
file.close()
Example : result

Content of the created file:

Detailed list of points:
Instance : PointCoordinates[1]
visibility :'VISIBLE'
surface : None
color :'White'
domain :'DOMAIN1 : Domain.'
nature :'STANDARD : Topologie standard'
inAirPointFaceLocation : None
region : None
globalCoordinates : [-0.06, 0.0, -0.05]
ETAT : 0
mesh :'E_SHAPE : E_SHAPE VOLUMES'
inAirPointVolumeLocation : None
Instance : PointCoordinates[2]
visibility :'VISIBLE'
surface : None
color :'White'
domain :'DOMAIN1 : Domain.'
nature :'STANDARD : Topologie standard'
inAirPointFaceLocation : None
region : None
globalCoordinates : [-0.04, 0.02, -0.05]
ETAT : 0
mesh :'E_SHAPE : E_SHAPE VOLUMES'
inAirPointVolumeLocation : None
…
…

getHelp()

The description and applications of this command are explained in the table below.

Commands getHelp()
Function

Permits to stor the help text dealing with an entity type in a

« Flux variable ».

Use Point = Point.getHelp() retrieves the syntax describing the « Point » entity type in order to support storage in the « Point » variable.
Reminder / Comparison The command Point.help() permits the display of the support storage of the Point entity in the history zone.
Example : PyFlux sequence

Display of support related to an entity type in a file:

file = open("Aid PyFlux","a")
file.write("Aid on the point :")
file.write(Point. getHelp())
file.flush()
file.close()
Example : result File created comprising all of the supporting Pyflux command syntax associated with the « Point. » entity type.

getPyFlux Command()

The description and applications of this command are explained in the table below.

Command getPyFluxCommand()
Function Permits the storage of ann entity in a « Flux variable ».
Use P1=Point[1]. getPyFluxCommand() permits the storage of the Point[1] entity in the « P1 » variable
Reminder / Comparison The command Point[1]. type() permits the display of the entity Point[1] in the history zone
Example : PyFlux sequence

Display of an entity in a file:

file = open("Entities of the Flux project ","a")
file.write("Point P1 :")
file.write(Point[1]. getPyFluxCommand())
file.flush()
file.close()
Example : result

Content of created file:

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