# Cannot Merge h5m files with CAd\_to\_OpenMC

**URL:** https://openmc.discourse.group/t/cannot-merge-h5m-files-with-cad-to-openmc/5390
**Category:** User Support
**Created:** [March 31, 2025, 7:04pm UTC](https://openmc.discourse.group/t/cannot-merge-h5m-files-with-cad-to-openmc/5390 "2025-03-31T19:04:03Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Elie](https://avatars.discourse-cdn.com/v4/letter/e/6f9a4e/32.png) [@Elie](https://openmc.discourse.group/u/Elie)
#### Post date: [March 31, 2025, 7:04pm UTC](https://openmc.discourse.group/t/cannot-merge-h5m-files-with-cad-to-openmc/5390/1 "2025-03-31T19:04:03Z")

</div>

Hello,

I ran this code to convert CAD files to h5m using CAD\_to\_OpenMC:

> import CAD\_to\_OpenMC.assembly as ab
> 
> CORE = ab.Assembly([“msre\_core.step”])
> 
> CORE.run(backend=‘stl2’, merge=True, h5m\_filename=‘msre\_core.h5m’)
> 
> DETECTOR\_ROD = ab.Assembly([“Detector Rod3.step”])
> 
> DETECTOR\_ROD.run(backend=‘stl2’, merge=True, h5m\_filename=‘detector\_rod3.h5m’)
> 
> PIT = ab.Assembly([“msre\_pit.step”])
> 
> PIT.run(backend=‘stl2’, merge=True, h5m\_filename=‘msre\_pit.h5m’)
> 
> CR = ab.Assembly([“msre\_control\_rod.step”])
> 
> CR.run(backend=‘stl2’, merge=True, h5m\_filename=‘msre\_control\_rod.h5m’)
> 
> ab.merge2h5m([CORE,PIT], h5m\_file=‘msre\_reactor.h5m’)

However, I got the following error:

> INFO: reassembling stl-files into h5m structure msre\_reactor.h5m  
> MOAB ERROR: --------------------- Error Message ------------------------------------  
> MOAB ERROR: vol\_1\_face0000.stl: No such file or directory!  
> MOAB ERROR: serial\_load\_file() line 527 in src/Core.cpp  
> MOAB ERROR: load\_file() line 471 in src/Core.cpp  
> Traceback (most recent call last):  
> File “/home/elie/Thesis2024/Simulation Files/script2.py”, line 22, in  
> ab.merge2h5m([CORE, PIT], h5m\_file=‘msre\_reactor.h5m’)  
> File “/home/elie/micromamba/envs/msresim/lib/python3.9/site-packages/CAD\_to\_OpenMC/assembly.py”, line 1133, in merge2h5m  
> mbcore = a.add\_entities\_to\_moab\_core(mbcore, mbtags, noimplicit=True, in\_datadir=a.datadir)  
> File “/home/elie/micromamba/envs/msresim/lib/python3.9/site-packages/CAD\_to\_OpenMC/assembly.py”, line 663, in add\_entities\_to\_moab\_core  
> mbcore.load\_file(str(pl.Path(in\_datadir) / f), fset)  
> File “pymoab/core.pyx”, line 91, in pymoab.core.Core.load\_file  
> File “pymoab/types.pyx”, line 109, in pymoab.types.check\_error  
> OSError: MOAB ErrorCode: MB\_FILE\_DOES\_NOT\_EXIST

---

<div class="post-metadata">

### Author: ![Shimwell](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/shimwell/32/3876_2.png) [@Shimwell](https://openmc.discourse.group/u/Shimwell)
#### Post date: [April 11, 2025, 11:21pm UTC](https://openmc.discourse.group/t/cannot-merge-h5m-files-with-cad-to-openmc/5390/2 "2025-04-11T23:21:22Z")

</div>

> [@Elie](#):
>
> MB\_FILE\_DOES\_NOT\_EXIST

Perhaps not a clear error message that is being returned here but I think MOAB is saying that it can’t find the h5m file at the specified path. You could try putting in the absolute path instead of the relative path to the h5m file

---

<div class="post-metadata">

### Author: ![ebknudsen](https://avatars.discourse-cdn.com/v4/letter/e/aeb1de/32.png) [@ebknudsen](https://openmc.discourse.group/u/ebknudsen)
#### Post date: [June 30, 2025, 4:00pm UTC](https://openmc.discourse.group/t/cannot-merge-h5m-files-with-cad-to-openmc/5390/3 "2025-06-30T16:00:00Z")

</div>

Many apologies for not noticing this one before now ( I am the author of CAD\_to\_OpenMC ). Is this problem still relevant? If so - the best way for me to help you is for you to raise an issue in the CAD\_to\_OpenMC repo at [GitHub - united-neux/CAD\_to\_OpenMC: code to target the conversion from a step-file to a h5m-geometry for neutronics](https://github.com/united-neux/CAD_to_OpenMC).

Not sure what could cause this particular problem but (shooting from the hip): A likely candidate is the fact that you have spaces in the path to your working directory.  
cheers  
Erik
