How can I deliver vector type variables in Python to Itasca command?

I have tried to create wall in PFC3D by using Python script.
However, it fails to deliver vector type variable to Itasca command.
Please check the following script.


get_ipython().magic(‘reset -sf’)
import itasca as it
from vec import vec

it.command(""“model new
model configure dynamic
model deterministic off
model large-strain on”"")

it.command(""“model domain extent -0.08 0.08
domain condition destroy”"")

def create_wall():
p11 = vec((-0.01, -0.01, -0.01))
p22 = vec((0.01, 0.01, -0.01))
p33 = vec((-0.01, 0.01, -0.01))
p44 = vec((0.01, -0.01, -0.01))
it.command(""“wall generate id 1 name ‘bottom’ polygon {p11} {p44} {p22} {p33}”"")


*** Python error: ‘At least 3 vertices must be specified.\n While processing line 0 of source Python interpreter.’

it.command(f""“wall generate id 1 name ‘bottom’ polygon {p11.x()} {p11.y()} {p11.z()} …
{p22.x()} {p22.y()} {p22.z()} …
{p33.x()} {p33.y()} {p33.z()} …
{p44.x()} {p44.y()} {p44.z()} ”"")

Thank you Huy.
The following format also works. Regards.

it.command(""" {} {} {}""".format( .x(), .y(), .z()))

Yes, it’s the old syntax for Python 2. In Python 3, you can put “f” in front of the string.

looks like Python tuples are converted into FISH vectors. So, you can try declaring p11 as tuple instead of vec.

Thanks to you xpnguyen, the code has become simple.