Use vertex name directly to generate surface

Hey,

i started using Trelis in combination with python and i want do use the variable name of some vertices to create a surface (see code below). Does this work?

v1 = cubit.cmd(‘create vertex {} {} {}’.format(0, 0, 0))
v2 = cubit.cmd(‘create vertex {} {} {}’.format(0, 1, 0))
v3 = cubit.cmd(‘create vertex {} {} {}’.format(0, 0, 1))
surf1 = cubit.cmd(‘create surface vertex {} {} {} {} {}’.format(v1, v2, v3))

Best Regards
Andreas

No that will not work. The cubit.cmd() method does not return any useful information. You could use the extended interface that is more pythonic.

Try something like this.

v1 = cubit.create_vertex(0,0,0)
v2 = cubit.create_vertex(1,0,0)
v3 = cubit.create_vertex(1,1,0)
v4 = cubit.create_vertex(0,1,0)
cubit.cmd( "create surface vertex {} {} {} {}".format(v1.id(), v2.id(), v3.id(), v4.id() ) )

If you want to keep surf1 around you have to create curves using create_curve() or create_spline() and pass a list of curves to create_surf().

Hey Karl,

ok I understand.
Many thanks for your reply.

Best Regards
Andreas