Model.CE_AddLinkEntitiesWithRules#
- Model.CE_AddLinkEntitiesWithRules(connector_collection, entity_collection, entity_state, ce_rules, ce_le_rule, tolerance_flag, tolerance, num_ents)#
Updates connectors at the specified locations with rules.
- Parameters:
connector_collection (Collection) – The collection containing the connector entities to update.
entity_collection (Collection) – The collection containing the entities to use as links.
entity_state (unsigned int) –
The state of the link entities. Valid values are:
0 - Geometry.
1 - Elements.
ce_rules (unsigned int) –
Flag indicating when to make the links. Valid values are:
0 - Now.
1 - At realize.
ce_le_rule (unsigned int) –
Flag indicating how to make the links. Valid values are:
0 - None.
1 - Use ID.
2 - Use name.
tolerance_flag (unsigned int) –
Flag indicating whether to use the default tolerance. Valid values are:
0 - Use default.
1 - Use specified value.
tolerance (double) – Used to add entities only within the given tolerance from the specified connector.
num_ents (int) – Number of entities to add/update connector (connectors thickness (2T, 3T, etc.) value).
Example#
Update connectors with IDs 1 and 2 to add the nearest two out of four components specified, using a tolerance of 1.0. Components will be linked by IDs#import hm import hm.entities as ent model = hm.Model() model.CE_AddLinkEntitiesWithRules( connector_collection=hm.Collection(model, ent.Connector, [1, 2]), entity_collection=hm.Collection(model, ent.Component, [21, 23, 24, 27]), entity_state=1, ce_rules=1, ce_le_rule=1, tolerance_flag=1, tolerance=1.0, num_ents=2, )