Model.positionentity_bycollection#
- Model.positionentity_bycollection(collection, source_coords=hwTripleList(), target_coords=hwTripleList(), source_nodes=s_defaultEntityList, target_nodes=s_defaultEntityList)#
Positions selected entities in space. You can specify a collection of special points either by providing lists of coordinates or a list of node entities.
- Parameters:
collection (Collection) – The collection containing the entities to modify.
source_coords (hwTripleList) – The list of lists of x, y, z coordinates for source points.
target_coords (hwTripleList) – The list of lists of x, y, z coordinates for target points.
source_nodes (EntityList) – The list of source node entities.
target_nodes (EntityList) – The list of target node entities.
Examples#
Position the components with IDs 41 , 42 use source and target coordinates ( case 1 )#import hm import hm.entities as ent model = hm.Model() model.positionentity( collection=hm.Collection(model,ent.Component,[41, 42]), source_coords=[ [1268.2080057472, 1390.3206502704, 261.94218701528], [1453.2078889448, 1211.6243689829, 214.0606603456], [1268.2079790993, 1032.9281037002, 166.17913259364], ], target_coords=[ [83.410371153542, 206.5, 174.00000024836], [268.41037026165, 206.5, -10.999999839969], [83.410373806586, 206.5 - 196.00000026844], ] )
Position the components with IDs 41 , 42 use source and target coordinates ( case 2 )#import hm import hm.entities as ent model = hm.Model() model.positionentity( collection=hm.Collection(model,ent.Component,[41, 42]), source_coords=[ [1268.2080057472, 1390.3206502704, 261.94218701528], [1453.2078889448, 1211.6243689829, 214.0606603456], ], target_coords=[ [83.410371153542, 206.5, 174.00000024836], [268.41037026165, 206.5, -10.999999839969], ] )
Position the components with IDs 41 , 42 use source and target coordinates ( case 3 )#import hm import hm.entities as ent model = hm.Model() model.positionentity( collection=hm.Collection(model,ent.Component,[41, 42]), source_coords=[1268.2080057472, 1390.3206502704, 261.94218701528], target_coords=[83.410371153542, 206.5, 174.00000024836], )
Position the components with IDs 41 , 42 use source nodes and target nodes ( case 1 )#import hm import hm.entities as ent model = hm.Model() model.positionentity( collection=hm.Collection(model,ent.Component,[41, 42]), source_nodes=[ ent.Node(model, 221417), ent.Node(model, 221416), ent.Node(model, 221415), ], target_nodes=[ ent.Node(model, 221414), ent.Node(model, 221413), ent.Node(model, 221412), ], )
Position the components with IDs 41 , 42 use source nodes and target nodes ( case 2 )#import hm import hm.entities as ent model = hm.Model() model.positionentity( collection=hm.Collection(model,ent.Component,[41, 42]), source_nodes=[ ent.Node(model, 221417), ent.Node(model, 221416), ], target_nodes=[ ent.Node(model, 221414), ent.Node(model, 221413), ], )
Position the components with IDs 41 , 42 use source nodes and target nodes ( case 3 )#import hm import hm.entities as ent model = hm.Model() model.positionentity( collection=hm.Collection(model,ent.Component,[41, 42]), source_nodes=[ ent.Node(model, 221417), ], target_nodes=[ ent.Node(model, 221414), ], )