Model.elementtestaspect#

Model.elementtestaspect(collection, aspect, output_collection, dimension, contour, title)#

Tests 2D and 3D elements using the aspect element quality check.

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

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

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

  • dimension (int) –

    The option of whether to measure 2D or 3D elements:

    2 - Measure 2D elements.

    4 - Measure 3D elements.

  • contour (int) –

    Flag that determines how the results are presented. Valid values are:

    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. Only required, if contour is 2.

Examples#

Testing all displayed 3D elements for an aspect of 5.0#
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.elementtestaspect(
    collection=elems1,
    aspect=5.0,
    output_collection=elems2,
    dimension=4,
    contour=0,
    title=""
)
Testing all displayed 2D elements for an aspect of 6.0#
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.elementtestaspect(
    collection=elems1,
    aspect=6.0,
    output_collection=elems2,
    dimension=2,
    contour=0,
    title=""
)