Remesh a Model Multiple Times and Track Metrics

Goal: Remesh a model five times, tracking how long each remesh takes and the number of nodes that are created.

Code:

From time import clock, time
for x in range(0, 5):
    ExtAPI.DataModel.Project.Model.ClearGeneratedData()
    t1 = time()
    ExtAPI.DataModel.Project.Model.Mesh.GenerateMesh()
    t2 = time()
    print "Stats for mesh %d, elapsed time=%d" % (x+1, t2-t1)
    print ExtAPI.DataModel.Project.Model.Mesh.Nodes

Release 18.2 - © ANSYS, Inc. All rights reserved.