# How to wrap VTK-derived C++ function for Python

**URL:** https://discourse.vtk.org/t/how-to-wrap-vtk-derived-c-function-for-python/4862
**Category:** Support
**Created:** [December 20, 2020, 1:46am UTC](https://discourse.vtk.org/t/how-to-wrap-vtk-derived-c-function-for-python/4862 "2020-12-20T01:46:50Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![desheng](https://discourse.vtk.org/user_avatar/discourse.vtk.org/desheng/32/2764_2.png) [@desheng](https://discourse.vtk.org/u/desheng)
#### Post date: [December 20, 2020, 1:30pm UTC](https://discourse.vtk.org/t/how-to-wrap-vtk-derived-c-function-for-python/4862/3 "2020-12-20T13:30:11Z")

</div>

Thanks for your reply and explanation.  
Have learned VTK has its own wrap macro also from here

> [@explain the vtk architecture design](https://discourse.vtk.org/t/explain-the-vtk-architecture-design/1978/14):
>
> Tcl/Tk bindings no longer get built (they were removed in 2017). The other two are built on some programs VTK builds that read the VTK headers and write out code for Python and Java to use VTK objects. The generated sources are then tossed back at CMake to write out the rules for actually making the libraries and modules necessary. The tools themselves are pretty tailor-made to (or at least have sizeable exceptions and special cases for) VTK classes and its class hierarchy, so they’re not genera…

What I described was not clear. Yes I mean, how to wrap a new VTK-derived classes? Is there a simplest example available?

---

_[View the full topic](https://discourse.vtk.org/t/how-to-wrap-vtk-derived-c-function-for-python/4862)._
