Model.elementtestlength#

Model.elementtestlength(collection, length, outputcollection, wantmin, dimension, contour, title)#

Tests elements for whether or not they pass the edge length element quality check, and puts those that fail on the specified outputcollection.

Parameters:
  • collection (Collection) – The collection containing the element entities to test.

  • length (double) – The value to use as a threshold beyond which elements should be considered to have failed the test.

  • outputcollection (Collection) – The collection containing the failed element entities.

  • wantmin (int) – A nonzero value indicates to check if the element’s smallest edge is less than the threshold, as opposed to its largest edge being greater than the threshold.

  • dimension (int) –

    A code telling to measure the dimension of:

    1 - Measure 1D elements.

    2 - Measure 2D elements.

    4 - Measure 3D elements.

  • contour (int) –

    A code telling if should:

    0 - Display the results of the test normally.

    1 - Display the elements color coded by their ratings.

    2 - Build a histogram showing the distribution of ratings.

  • title (hwString) – The title to label the curve in the histogram.

Example#

Test all displayed elements for an edge length value less than 20#
import hm
import hm.entities as ent

model = hm.Model()

elems1 = model.CreateCollectionByDisplayed(ent.Element)
elems2 = hm.Collection(model, hm.FilterByEnumeration(ent.Element, ids=hm.hwUIntList([])))

model.elementtestlength(collection,length,outputcollection,wantmin,dimension,contour,title)
    collection=elems1,
    length=20,
    outputcollection=elems2,
    wantmin=1,
    dimension=2,
    contour=0,
    title="2D Element Length"
)

Note

With 2D and 3D elements, the only concern is if the element is too small.

With 1D elements, there is an additional test available to test if the element is too large. To activate that test, set dimension=1 and wantmin=1.

The details of the edge length element quality check can be found in the online help for the Check Elements panel.