# How to import a .vtu file programmatically?

**URL:** https://discourse.kitware.com/t/how-to-import-a-vtu-file-programmatically/1650
**Category:** Using SMTK
**Created:** [November 24, 2025, 11:01am UTC](https://discourse.kitware.com/t/how-to-import-a-vtu-file-programmatically/1650 "2025-11-24T11:01:19Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![CsatiZoltan](https://discourse.kitware.com/letter_avatar_proxy/v4/letter/c/76d3ee/32.png) [@CsatiZoltan](https://discourse.kitware.com/u/CsatiZoltan)
#### Post date: [November 24, 2025, 1:05pm UTC](https://discourse.kitware.com/t/how-to-import-a-vtu-file-programmatically/1650/2 "2025-11-24T13:05:35Z")

</div>

Partial success: I found out that it is [`libsmtkVTKSession.so`](https://gitlab.kitware.com/cmb/smtk/-/blob/3a6cc47f01972dcbc495d01d379fa5256e64b3aa/smtk/session/vtk/CMakeLists.txt#L1-L8) that I need to attach the debugger. Moreover, I need to import the .vtu file with `smtk::markup::Import`, which in turn calls `smtk::extension::vtk::io::ImportAsVTKData`. So the following questions remain:

1. Is there a way to print (or log) what SMTK operations are executed in CMB?
2. Why can’t I import a .vtu file with `smtk::session::vtk::Import`, but with `smtk::markup::Import`?
3. Should I use `smtk::markup::Import` or directly `smtk::extension::vtk::io::ImportAsVTKData`?

---

_[View the full topic](https://discourse.kitware.com/t/how-to-import-a-vtu-file-programmatically/1650)._
