Use Altair Compose commands to interact with Flux

Introduction

This section presents the different commands allowing the interaction between Flux and solidThinking Compose.

Workflow

In the following table, the steps to follow in Compose for a nominal scenario are presented, an example is available in the installation path : C:\Program Files\Altair \2018.1\flux\Flux\Api\win64\Compose\flux_mp.oml

Copy and paste this file in your working repertory, the other file, flux_mp.bat starts the first one.
  1. To add the corresponding toolbox, the Compose project must be at this path : C:\Program Files\Altair \2018.1\flux\Flux\Bin\dll\win64

  2. To start with the commands, the flux server must be configured.

重要: when using the oml exemple, the file will write some files (Flux log …), that is why the working repertory of Compose must not be : C:\Program Files\.....

Command example

  • Configure the server (add more options with the server arguments described above).
serverUid =
        FMP_startLocaleServer(FLUX2D_64,'../',strcat(NUMERICAL_MEMORY_LABEL,'600000000'))
注: To use dynamic memory in Flux, enter '0' for the memory value.
  • Execute a python or a pyFlux command
FMP_executeJythonCommand(serverUid, 'newProject()')

FMP_executeJythonCommand(serverUid, 'Face[1].region=RegionFace[“IRON”]')

FMP_executeJythonCommand(serverUid, 'closeProject()')

FMP_executeJythonCommand(serverUid, 'PythonOrPyfluxCommand()')
FMP_executeJythonCommand(serverUid, 'executeBatchSpy('Python_File.py')')
  • Set an array double
FMP_setJythonDoubleArrayValue(serverUid,'b',[123.4,567.8])
  • Get an array double
b = FMP_getJythonDoubleArrayValue(serverUid,'b')
  • Set an array integer
FMP_setJythonIntArrayValue(serverUid,'d',[123,456]);
  • Get an array integer
d = FMP_getJythonIntArrayValue(serverUid,'d')
  • Set an array string
FMP_setJythonStringArrayValue(serverUid,'f',{'text one','text two'});
  • Get an array string
f = FMP_getJythonStringArrayValue(serverUid,'f')
注: For this kind of command in python : Every single quote must be replaced by a double quote
lastInstance = MeshLineArithmetic(name='10',
                   color=Color['White'],
                   number=10)
And in Compose this command must not contain any line withdrawal. The good compose command for the following example :
FMP_executeJythonCommand(serverUid, 'lastInstance = MeshLineArithmetic(name="10",color=Color["White"],number=10)');