# Orienting a cylinder source via pv python?

**URL:** https://discourse.paraview.org/t/orienting-a-cylinder-source-via-pv-python/3896
**Category:** ParaView Support
**Tags:** python
**Created:** [March 26, 2020, 7:18pm UTC](https://discourse.paraview.org/t/orienting-a-cylinder-source-via-pv-python/3896 "2020-03-26T19:18:06Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![braddeibert](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/b/f14d63/32.png) [@braddeibert](https://discourse.paraview.org/u/braddeibert)
#### Post date: [March 26, 2020, 7:18pm UTC](https://discourse.paraview.org/t/orienting-a-cylinder-source-via-pv-python/3896/1 "2020-03-26T19:18:06Z")

</div>

Hey there all, hope you’re all staying busy and healthy!

My question arises from troubles I’ve run into attempting to generate a cylinder source that “stands up” about the z-axis from a python script.

Since the .Direction option used for cone sources is unavailable for cylinders, how would I go about doing this?

---

<div class="post-metadata">

### Author: ![Andy\_Bauer](https://discourse.paraview.org/user_avatar/discourse.paraview.org/andy_bauer/32/5442_2.png) [@Andy\_Bauer](https://discourse.paraview.org/u/Andy_Bauer)
#### Post date: [March 26, 2020, 7:34pm UTC](https://discourse.paraview.org/t/orienting-a-cylinder-source-via-pv-python/3896/2 "2020-03-26T19:34:41Z")

</div>

I’d recommend using the Transform filter to rotate it. You can rotate 90 degrees around the X-axis.

---

<div class="post-metadata">

### Author: ![braddeibert](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/b/f14d63/32.png) [@braddeibert](https://discourse.paraview.org/u/braddeibert)
#### Post date: [March 26, 2020, 7:58pm UTC](https://discourse.paraview.org/t/orienting-a-cylinder-source-via-pv-python/3896/3 "2020-03-26T19:58:33Z")

</div>

What is the easiest way to do this with python if I already have a source called “cyl”, for example?

---

<div class="post-metadata">

### Author: ![braddeibert](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/b/f14d63/32.png) [@braddeibert](https://discourse.paraview.org/u/braddeibert)
#### Post date: [March 26, 2020, 8:11pm UTC](https://discourse.paraview.org/t/orienting-a-cylinder-source-via-pv-python/3896/4 "2020-03-26T20:11:50Z")

</div>

I also notice that the transform filter changes the coordinates of the points. How could I rotate the cylinder without losing the initial center coordinates?

---

<div class="post-metadata">

### Author: ![Andy\_Bauer](https://discourse.paraview.org/user_avatar/discourse.paraview.org/andy_bauer/32/5442_2.png) [@Andy\_Bauer](https://discourse.paraview.org/u/Andy_Bauer)
#### Post date: [March 27, 2020, 11:48am UTC](https://discourse.paraview.org/t/orienting-a-cylinder-source-via-pv-python/3896/5 "2020-03-27T11:48:26Z")

</div>

I’d recommend getting familiar with using the Python trace. That is the easiest way to see how to do a GUI operation through the Python interface. The Transform filter also has a translate input.
