get_curve_edges(curve) does not seem to work

I have the following snippet in a custom export file that I have written to export VTK files for the deal.II library

sideset_ids = cubit.get_sideset_id_list()
for sideset_id in sideset_ids:
        curves = cubit.get_sideset_curves(sideset_id)
        for curve in curves:
            edges = get_curve_edges(curve)

Unfortunatly the above code returns an empty list of edges, indepdently on what I pass to it.

I worked around it by using the following:

sideset_ids = cubit.get_sideset_id_list()
for sideset_id in sideset_ids:
            group_id = cubit.get_id_from_name("temp_edges")
            if group_id != 0:
                cubit.silent_cmd("delete group " + str(group_id))
            cubit.silent_cmd(
                "group 'temp_edges' add edge all in curve " + str(curve))
            group_id = cubit.get_id_from_name("temp_edges")
            edges = cubit.get_group_edges(group_id)

which works, but seems a little bit of a hack.

Is there a reason why the first code does not produce the expected output?

It looks like you were missing the “cubit.” before “get_curve_edges()”. Try this:

sideset_ids = cubit.get_sideset_id_list()
for sideset_id in sideset_ids:
curves = cubit.get_sideset_curves(sideset_id)
print “\nCurves in sideset {0}: {1}”.format(sideset_id, curves)
for curve in curves:
edges = cubit.get_curve_edges(curve)
print “Edges in curve {0}: {1}”.format(curve, edges)