Command line arguments for PrePoMax

Just now, if the program is run from the command line, only PMX and FRD files can be read. It would be nice to have an ability to import geometry, mesh and INP files by

prepomax.exe -i <file_name>.

command. It allows to use PrePoMax more widely inside CMD and BAT files. Additionally, the program could be used as a fast viewer for this files.

Perhaps β€˜-u <set_number>’ key for the default unit set will also be useful just to avoid unit selection every time when the program starts.

1 Like

That is a good idea and I will try to add it to the source.

The source code now includes the support for command-line arguments.

There is no switch necessary for defining a file open or file import. Only the file name with the whole path and extension <path/file_name.extension>. All PrePoMax extensions are supported:

.stp
.step
.igs
.iges
.brep
.stl
.unv
.vol
.inp
.mesh

To preselect a unit system a switch -us is needed followed by a unit system type:

M_KG_S_C
MM_TON_S_C
M_TON_S_C
IN_LB_S_F
UNIT_LESS

So to import a file <path/file_name.extension> in a new model with the unit system M_KG_S_C, the following command must be executed:

PrePoMax.exe <path/file_name.extension> -us M_KG_S_C

2 Likes

I have compiled a new development version. As usual it is available at my educational web page. Unfortunately command line reading of geometry files works only for STL file format. For STEP and IGS the following error message is shown:

02/14/22 09:50:26   Set new model properties: Model space: 3D, Unit system: mm, ton, s, Β°C
02/14/22 09:50:26   Import file: test_cube.STEP
02/14/22 09:50:26   Running command: C:\Tools\PrePoMax_dev\NetGen\NetGenMesher.exe STEP_ASSEMBLY_SPLIT_TO_COMPOUNDS "test_cube.STEP" "C:\Tools\PrePoMax_dev\Temp\DIVbi7J1....
02/14/22 09:50:26   brep"
02/14/22 09:50:26    Reading STEP file: test_cube.STEP
02/14/22 09:50:26   Error reading in STEP File: test_cube.STEP

The same file can be imported to PrePoMax via File / Import without any problems. Test files are attached.
test_cube.zip (5.3 KB)

I have tried your version of the PrePoMax and it works. You must use the whole path of the file to import like: β€œC:\Temp\test_cube.STEP”. I see my instructions were a little misleading so I added the path to the file name now.

At the moment we have the following situation with this new feature:

  1. There is no need to add the full path for PMX, FRD and even STL files
  2. You have to add the full path for CAD files in STEP or IGES formats (I have not tested other formats yet)
    It could be a bit confusing for some users, however it allows to start using this feature.

I did not test all file formats but I think (it should be like that) that all files must contain a full path. The exception are only files in the same path as the executable or in the shortcuts working folder. This is the default behaviour of the operating system. The file without the path can not be found on the system otherwise.

The problem is that STEP and IGES files need full path even if these files are in the same folder as PrePoMax. This is the very uncommon for any operational system.

Second, if all files are in the working directory, command like

<Full_path_to_PrePoMax>\prepomax.exe file.ext

works well for PMX, FRD, INP and even STL files and does not work for STEP and IGES files. For these two types of files you need to add the full path. Again, it is very uncommon.

Now I finally understood where is the problem. I fixed it and now it should work as expected. I newer put geometry or model files in the exe directory so I only tested all other directories. If everything works as expected please close the topic.

1 Like