Model.hm_getedgeloops2#
- Model.hm_getedgeloops2(collection, looptype=63)#
Returns the chain of boundary entities of the given type. The return is a list of loops. Each loop is an ordered list of either surface edge or element node entities that define each loop. The first value in each loop list is the loop type. For example, a list that starts with number 32 means the list consists of entities (nodes or edges) representing an x-connection type “closed” loop. The remaining values are the ordered node/surface edge entities defining the loop. If the loop is closed, the first and last entity object are the same.
This API is similar to Model.hm_getedgeloops. The difference is that, in defining the connection types at the boundary,
hm_getedgeloopstakes into account all the elements/surfaces in the model, whilehm_getedgeloops2considers only the given input as if the rest of the model does not exists. Thus, if the edge of a surface is connected to another surface that is not in the input, then that edge is considered to be a “free” edge; that is, as if it is not stitched to any other edge. In this sense, the boundary entities (nodes or edges) of input entities are classified according to their connection type of being “free”, “t-connection” or “x-connection”.- Parameters:
collection (Collection) – The collection containing the entities. Currently supported for surfaces and elements.
looptype (int) –
The type of loop types to find.
Bit values are used and the value is calculated as (1*Bit0 + 2*Bit1 + 4*Bit2 + 8*Bit3 + 16*Bit4 + 32*Bit5). If not specified, all loop types are returned. Valid Bit options are:
Bit0
Consider open free edge loops. Valid values are:
0 - Do not consider open free edge loops
1 - Consider open free edge loops
Bit1
Consider closed free edge loops. Valid values are:
0 - Do not consider closed free edge loops
1 - Consider closed free edge loops
Bit2
Consider open t-connections. Valid values are:
0 - Do not consider open t-connections
1 - Consider open t-connections
Bit3
Consider closed t-connections. Valid values are:
0 - Do not consider closed t-connections
1 - Consider closed t-connections
Bit4
Consider open x-connections. Valid values are:
0 - Do not consider open x-connections
1 - Consider open x-connections
Bit5
Consider closed x-connections. Valid values are:
0 - Do not consider closed x-connections
1 - Consider closed x-connections
Show Bit value calculator
Radio Button Table Option Name Value Consider open free edge loops (Bit0) Consider closed free edge loops (Bit1) Consider open t-connections (Bit2) Consider closed t-connections (Bit3) Consider open x-connections (Bit4) Consider closed x-connections (Bit5) Calculated argument value: 0
- Returns:
hwReturnStatus- Status objectHmQueryResultList- Result list object containingHmQueryResultobjects with the following output data:loopType (int) - The type of loop.
0 - Undefined loop
1 - Open free edge loop
2 - Closed free edge loop
4 - Open t-connection
8 - Closed t-connection
16 - Open x-connection
32 - Closed x-connection
loopEntities (EntityList) - The list of entity objects representing the loop. For
collectioncontaining surfaces, the entities are surface edges. Forcollectioncontaining elements, the entities are element nodes.
Example#
Find all edge loops on displayed elements#import hm import hm.entities as ent model = hm.Model() elements = hm.CollectionByDisplayed(model,ent.Element) _, resultlist = model.hm_getedgeloops2(collection=elements, looptype=63) for result in resultlist: print("Loop Type:", result.loopType) print("Number of Loop Entities:", len(result.loopEntities))