Model.plyrealization_option#
- Model.plyrealization_option(ply_collection, collection, project, x1, y1, z1, x2, y2, z2, reserved1, search_option, reserved2, shrinkage, table_id, double_array, reserved3, reserved4)#
Extracts/projects elements belonging to ply contours.
- Parameters:
ply_collection (Collection) – The collection containing the input ply entities.
collection (Collection) – The collection containing the entities to extract/project. Valid entities are elements and components.
project (int) –
0 - Project normal to the contour plane.
1 - Project normal to the mesh.
2 - Project along an arbitrary direction using the
x1,y1,z1andx2,y2,z2arguments.3 - Drape map by proximity method (FiberSIM/CATIA composite link).
x1 (double) – The x-coordinate of the direction base. Only used if
project=2.y1 (double) – The y-coordinate of the direction base. Only used if
project=2.z1 (double) – The z-coordinate of the direction base. Only used if
project=2.x2 (double) – The x-coordinate of the direction normal. Only used if
project=2.y2 (double) – The y-coordinate of the direction normal. Only used if
project=2.z2 (double) – The z-coordinate of the direction normal. Only used if
project=2.reserved1 (int) – Reserved for future use. Must be set to 0.
search_option (int) –
Use the specified search criterion as:
0 - Centroid.
1 - All nodes inside.
2 - Shrinkage factor of border element edges.
reserved2 (int) – Reserved for future use. Must be set to 0.
shrinkage (double) – The shrinkage area factor. Only used if
search_optionis set to 2.table_id (int) – The ID of the table that holds core sample data. The table consists of 2 columns, “ply” and “points” that contain ply names and sampling points, of data type string and triples, respectively.
double_array (hwDoubleList) – The double array that contains the x, y and z coordinates of sample points.
reserved3 (int) – Reserved for future use. Must be set to 0.
reserved4 (double) – Reserved for future use. Must be set to 0.
Examples#
Project / extract plies for a ply named “Ply3” on elements with IDs 1-10 , normal to the elements, with search criterion “all nodes inside”#import hm import hm.entities as ent model = hm.Model() # Creating a collection that contains the elements with IDs 1-10 filter_elements = hm.FilterByEnumeration(ent.Element, list(range(1, 11))) elements_collection = hm.Collection(model, filter_elements) model.plyrealization_option( ply_collection=hm.Collection(model, ent.Ply, "name=Ply3"), collection=elements_collection, project=1, x1=0.0, y1=0.0, z1=0.0, x2=0.0, y2=0.0, z2=0.0, reserved1=0, search_option=1, reserved2=0, shrinkage=0, table_id=0, float_array=hm.hwDoubleList([]), reserved3=0, reserved4=0, )
Project / extract plies for a ply named “Ply3” on all elements , normal to the elements, with shrinkage factor of 0.25#import hm import hm.entities as ent model = hm.Model() model.plyrealization_option( ply_collection=hm.Collection(model, ent.Ply, "name=Ply3"), collection=hm.Collection(model,ent.Element) project=1, x1=0.0, y1=0.0, z1=0.0, x2=0.0, y2=0.0, z2=0.0, reserved1=0, search_option=2, reserved2=0, shrinkage=0.25, table_id=0, float_array=hm.hwDoubleList([]), reserved3=0, reserved4=0, )
Project/extract plies for a ply named “Ply2” on elements with IDs 1 - 10 , normal to the elements use core sample data. Create a table to store core sample data, use ply names Ply1 and Ply2 and sample points ( 1.1 , 2.1 , 3.1 ) and ( 4.1 , 5.1 , 6.1 ). Ply realization, assume the table ID of “coresample_table” is 2#import hm import hm.entities as ent model = hm.Model() model.tablecreate( name="coresample_table", color=1, config=1, string_array=["string", "triple"], number_of_rows=0, ) model.tableinsertcolumn( name="coresample_table", data_type="string", column_label="ply", string_array=["Ply1", "Ply2"], column_index=1, ) model.tableinsertcolumn( name="coresample_table", data_type="triple", column_label="points", string_array=["1.1", "2.1", "3.1", "4.1", "5.1", "6.1"], column_index=2, ) # Get the ID of the created table _, result = model.hm_latestentityid(entity_type=ent.Table) # Creating a collection that contains the elements with IDs 1-10 filter_elements = hm.FilterByEnumeration(ent.Element, list(range(1, 11))) elements_collection = hm.Collection(model, filter_elements) model.plyrealization_option( ply_collection=hm.Collection(model, ent.Ply, "name=Ply2"), collection=elements_collection, project=1, x1=0.0, y1=0.0, z1=0.0, x2=0.0, y2=0.0, z2=0.0, reserved1=0, search_option=1, reserved2=0, shrinkage=0, table_id=result.entity, float_array=hm.hwDoubleList([]), reserved3=0, reserved4=0, )