# Command line arguments for PrePoMax

**URL:** <https://prepomax.discourse.group/t/command-line-arguments-for-prepomax/42>\
**Category:** Feature Requests\
**Created:** [February 4, 2022, 9:36am UTC](https://prepomax.discourse.group/t/command-line-arguments-for-prepomax/42 "2022-02-04T09:36:16Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![i\_rokach](https://avatars.discourse-cdn.com/v4/letter/i/cdc98d/32.png) [@i\_rokach](https://prepomax.discourse.group/u/i_rokach)\
**Post date:** [February 4, 2022, 9:36am UTC](https://prepomax.discourse.group/t/command-line-arguments-for-prepomax/42/1 "2022-02-04T09:36:16Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Matej](https://avatars.discourse-cdn.com/v4/letter/m/a698b9/32.png) [@Matej](https://prepomax.discourse.group/u/Matej)\
**Post date:** [February 4, 2022, 11:07am UTC](https://prepomax.discourse.group/t/command-line-arguments-for-prepomax/42/2 "2022-02-04T11:07:59Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Matej](https://avatars.discourse-cdn.com/v4/letter/m/a698b9/32.png) [@Matej](https://prepomax.discourse.group/u/Matej)\
**Post date:** [February 13, 2022, 7:36pm UTC](https://prepomax.discourse.group/t/command-line-arguments-for-prepomax/42/3 "2022-02-13T19:36:50Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![i\_rokach](https://avatars.discourse-cdn.com/v4/letter/i/cdc98d/32.png) [@i\_rokach](https://prepomax.discourse.group/u/i_rokach)\
**Post date:** [February 14, 2022, 8:58am UTC](https://prepomax.discourse.group/t/command-line-arguments-for-prepomax/42/4 "2022-02-14T08:58:13Z")

</div>

I have compiled a new development version. As usual it is available at [my educational web page](http://www.tu.kielce.pl/~rokach/instr/ppm_main.htm). Unfortunately command line reading of geometry files works only for STL file format. For STEP and IGS the following error message is shown:

```auto
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](https://prepomax.discourse.group/uploads/short-url/vQaeNEDRaTDObkwTyJXx6e1gbmA.zip) (5.3 KB)

---

<div class="post-metadata">

**Author:** ![Matej](https://avatars.discourse-cdn.com/v4/letter/m/a698b9/32.png) [@Matej](https://prepomax.discourse.group/u/Matej)\
**Post date:** [February 14, 2022, 9:57am UTC](https://prepomax.discourse.group/t/command-line-arguments-for-prepomax/42/5 "2022-02-14T09:57:16Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![i\_rokach](https://avatars.discourse-cdn.com/v4/letter/i/cdc98d/32.png) [@i\_rokach](https://prepomax.discourse.group/u/i_rokach)\
**Post date:** [February 14, 2022, 7:09pm UTC](https://prepomax.discourse.group/t/command-line-arguments-for-prepomax/42/6 "2022-02-14T19:09:23Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Matej](https://avatars.discourse-cdn.com/v4/letter/m/a698b9/32.png) [@Matej](https://prepomax.discourse.group/u/Matej)\
**Post date:** [February 15, 2022, 8:48am UTC](https://prepomax.discourse.group/t/command-line-arguments-for-prepomax/42/7 "2022-02-15T08:48:47Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![i\_rokach](https://avatars.discourse-cdn.com/v4/letter/i/cdc98d/32.png) [@i\_rokach](https://prepomax.discourse.group/u/i_rokach)\
**Post date:** [February 15, 2022, 3:18pm UTC](https://prepomax.discourse.group/t/command-line-arguments-for-prepomax/42/8 "2022-02-15T15:18:47Z")

</div>

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

```auto
<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.

---

<div class="post-metadata">

**Author:** ![Matej](https://avatars.discourse-cdn.com/v4/letter/m/a698b9/32.png) [@Matej](https://prepomax.discourse.group/u/Matej)\
**Post date:** [February 16, 2022, 10:29am UTC](https://prepomax.discourse.group/t/command-line-arguments-for-prepomax/42/9 "2022-02-16T10:29:35Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![i\_rokach](https://avatars.discourse-cdn.com/v4/letter/i/cdc98d/32.png) [@i\_rokach](https://prepomax.discourse.group/u/i_rokach)\
**Post date:** [February 16, 2022, 10:45am UTC](https://prepomax.discourse.group/t/command-line-arguments-for-prepomax/42/10 "2022-02-16T10:45:58Z")

</div>

Closed on February 16, 2022, 10:45am UTC


