Model.adjustgroupsnormal#

Model.adjustgroupsnormal(name, main_flag, collection, elem_flag, orientation_element, reverse_normal)#

Adjusts a group normal using an orientation element.

Parameters:
  • name (hwString) – The name of the group entity to adjust. User can directly supply a Python string.

  • main_flag (int) –

    0 - Use secondary

    1 - Use main

  • collection (Collection) – The collection containing the elements to adjust.

  • elem_flag (int) –

    Flag for reversing the contact normal of all or individual elements of the group.

    0 - All elements, collection is ignored

    1 - Individual elements, collection is used

  • orientation_element (unsigned int) – The ID of the shell element that should be used for shell group normal correction on shell face. This element should be part of the selection.

  • reverse_normal (int) –

    0 - Correct group normal along the direction of orientation_element normal

    1 - Correct group normal opposite to the direction of orientation_element normal

Examples#

Reverse the normal of all main elements of the group “ test “#
import hm
import hm.entities as ent

model = hm.Model()
model.adjustgroupsnormal(
    name="test",
    main_flag=1,
    collection=hm.Collection(model,ent.Element,populate=False),
    elem_flag=0,
    orientation_element=0,
    reverse_normal=0
)
Reverse the normal of all secondary elements of the group “ test “#
import hm
import hm.entities as ent

model = hm.Model()
model.adjustgroupsnormal(
    name="test",
    main_flag=0,
    collection=hm.Collection(model,ent.Element,populate=False),
    elem_flag=0,
    orientation_element=0,
    reverse_normal=0
)
Adjust the normal of group “ test “ for the elements with IDs 12 , 23 , 29 , and 53 in the normal direction of reference element with ID 23#
import hm
import hm.entities as ent

model = hm.Model()
elems = hm.Collection(model, ent.Element, [12,23,29,53])
model.adjustgroupsnormal(
    name="test",
    main_flag=1,
    collection=elems,
    elem_flag=1,
    orientation_element=23,
    reverse_normal=0
)
Adjust the normal of group “ test “ for the elements with ID 12 , 23 , 29 , and 53 in the reverse normal direction of reference element with ID 23#
import hm
import hm.entities as ent

model = hm.Model()
elems = hm.Collection(model, ent.Element, [12,23,29,53])
model.adjustgroupsnormal(
    name="test",
    main_flag=1,
    collection=elems,
    elem_flag=1,
    orientation_element=23,
    reverse_normal=1
)