Orienting a cylinder source via pv python?

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?

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

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

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?

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.