Model.CE_MarkReplaceLinkEntities#
- Model.CE_MarkReplaceLinkEntities(collection, link_collection, ce_style, num_ents, link_elems_geom='elems', link_rule='', relink_rule='', tol=0.0, tol_flag=0, ce_maxlinkupto=0, ce_nonnormal=0, ce_link_option=0, ce_normal_angle=0.0)#
Replaces the links from scratch in connectors.
- Parameters:
collection (Collection) – The collection containing the connector entities.
link_collection (Collection) – The collection containing the link entities to remove.
ce_style (hwString) – The style of connectors to create. Valid values are area, bolt, seam, and spot.
num_ents (int) – The number of links to replace.
link_elems_geom (hwString) – Specifies whether to connect elems (default) or geom.
link_rule (hwString) – Specifies the link rule. Valid values are now, at_fe_realize or none (default).
relink_rule (hwString) – Specifies the relink rule. Valid values are id, name or none (default).
tol (double) – Add entities as links only within this distance of the specified location. Default 0.0.
tol_flag (int) –
Flag for seam or area connector grouping:
0 - Do not use tol (default)
1 - Use tol
ce_maxlinkupto (int) – Reserved for future use. Must be specified as 0.
ce_nonnormal (int) – Reserved for future use. Must be specified as 0.
ce_link_option (int) – Reserved for future use. Must be specified as 0.
ce_normal_angle (double) – Reserved for future use. Must be specified as 0.
Example#
Replace links for spot connectors 1 and 2 by removing existing links first#import hm import hm.entities as ent model = hm.Model() connectors = hm.Collection(model, ent.Connector, [1, 2]) components = hm.Collection(model, ent.Component, [1, 2, 3, 4]) model.CE_MarkReplaceLinkEntities( collection=connectors, link_collection=component, ce_style="spot", num_ents=4, link_elems_geom="elems", link_rule="now", relink_rule="id", tol=99.0, tol_flag=1 )