Modeler#
- Usage:
Modeler Class API Wrapper
- class Modeler[source]#
Bases:
object
Wrapper for Modeler class of Moldflow Synergy.
- activate_lcs(lcs, active, lcs_type)[source]#
Activates or deactivates a local coordinate system (LCS)
- center_lines()[source]#
Extract center lines from visible CAD bodies with Channel (3D) property. Tapered bodies or flat bodies will not be processed. :rtype:
bool
- Returns:
bool: True if the operation was successful, False otherwise.
- create_arc_by_angle(center, radius, start, end, prop_set, ends)[source]#
Creates an arc from a center and start and end angles
- Parameters:
- Returns:
The list of created arcs.
- Return type:
- create_arc_by_points(pt1, pt2, pt3, circle, prop_set, ends)[source]#
Creates an arc from three points
- Parameters:
pt1 (Vector) – The first point.
pt2 (Vector) – The second point.
pt3 (Vector) – The third point.
circle (bool) – Specify True to create a circle
points (False to create an arc between the first and third)
respectively
prop_set (Property) – The property set for the arc.
ends (bool) – Whether to include the endpoints.
- Returns:
The list of created arcs.
- Return type:
- create_boundary_list()[source]#
Creates an empty BoundaryList object
- Returns:
The created boundary list.
- Return type:
- create_curve_by_connect(curve1, end1, curve2, end2, factor, prop_set)[source]#
Creates a curve by connecting two curves
- Parameters:
- Returns:
The list of created curves.
- Return type:
- create_entity_list()[source]#
Creates an empty EntList object
- Returns:
The created entity list.
- Return type:
- create_hole_by_boundary(region, curve)[source]#
Creates a hole in a region from an ordered sequence of boundary curves
- create_hole_by_extrusion(region, curve, direction)[source]#
Creates a hole in a region by extruding a set of curves along a given direction vector
- create_hole_by_nodes(region, nodes)[source]#
Creates a hole in a region from an ordered sequence of boundary nodes
- create_hole_by_ruling(region, curve1, curve2)[source]#
Creates a hole in a region by a ruling operation
- create_lcs_by_points(coord1, coord2=None, coord3=None)[source]#
Creates a local coordinate system (LCS) from three points
- create_line(coord, vec, relative, prop_set, ends)[source]#
Creates a line from between two given points :rtype:
EntList
- Args:
coord (Vector): The starting point of the line. vec (Vector): The direction vector of the line. relative (bool): Specify False if Vec specifies the coordinates of the second point True if Vec specifies an offset will be added to the first point to obtain the second prop_set (Property): The property set for the line. ends (bool): Whether to include the endpoints.
- Returns:
EntList: The list of created lines.
- create_node_by_intersect(curve, curve2, pt)[source]#
Creates a node at an intersection of two curves
- create_node_by_xyz(coord)[source]#
Create a node by its coordinates.
- Parameters:
coord (Vector) – The coordinates of the node.
- Returns:
The ID of the created node.
- Return type:
int
- create_nodes_between(start, end, num_nodes)[source]#
Creates a set of nodes between two given points
- create_nodes_by_divide(curve, num_nodes, ends)[source]#
Creates a set of nodes by dividing a curve (the curve itself is not modified)
- create_nodes_by_offset(coord, offset, num_nodes)[source]#
Creates a set of nodes by an offset operation
- create_region_by_boundary(curve, prop_set)[source]#
Creates a region from an ordered sequence of boundary curves
- create_region_by_extrusion(curve, direction, prop_set)[source]#
Creates one or more regions by extruding a set of curves along a given direction vector
- create_region_by_nodes(nodes, prop_set)[source]#
Creates a region from an ordered sequence of boundary nodes
- create_region_by_ruling(curve1, curve2, prop_set)[source]#
Creates one or more regions between two sets of curves by a ruling operation
- create_spline(coord, prop_set, ends)[source]#
Creates a spline from a set of points
- Parameters:
coord (VectorArray) – The coordinates of the spline.
prop_set (Property) – The property that will be assigned to the spline
ends (bool) – Whether to include the endpoints.
- Returns:
The list of created splines.
- Return type:
- find_property(prop_type, prop_id)[source]#
Find a property by its type and ID
- Parameters:
prop_type (int) – The type of the property.
prop_id (int) – The ID of the property.
- Returns:
The found property.
- Return type:
- get_new_edited_cad_study_name(job_id)[source]#
Gets the name of the new edited CAD study
- Parameters:
job_id (int) – The task ID for CAD editing.
- Returns:
The name of the new edited CAD study.
- Return type:
str
- is_inventor_fusion_cad_edit_aborted(job_id)[source]#
Checks if the Inventor Fusion CAD edit is aborted
- Parameters:
job_id (int) – The task ID for CAD editing.
- Returns:
True if the operation was aborted, False otherwise.
- Return type:
bool
- is_inventor_fusion_cad_edit_done(job_id)[source]#
Checks if the Inventor Fusion CAD edit is done
- Parameters:
job_id (int) – The task ID for CAD editing.
- Returns:
True if the operation is completed, False otherwise.
- Return type:
bool
- modified_with_inventor_fusion(ents)[source]#
Modifies a set of entities with Inventor Fusion
- Parameters:
ents (EntList) – The entities to modify.
- Returns:
Task ID for CAD editing
- Return type:
int
- reflect(ent, reference, plane, copy, merge)[source]#
Reflects a set of entities about a plane defined by a reference point and a normal vector :type ent:
EntList
|None
:param ent: The entities to reflect. :type ent: EntList :type reference:Vector
|None
:param reference: The reference point for the reflection. :type reference: Vector :type plane:Vector
|None
:param plane: The normal vector of the reflection plane. :type plane: Vector :type copy:bool
:param copy: Specify True to create a copy of the reflected entities :type copy: bool :param False to move the original entities: :type merge:bool
:param merge: Specify True to merge the reflected entities after reflection :type merge: bool- Returns:
True if the operation was successful, False otherwise.
- Return type:
bool
- rotate(ent, center, axis, angle, copy, num_copies, merge)[source]#
Rotates entities about an axis passing through a reference point
- Parameters:
ent (EntList) – The entities to rotate.
center (Vector) – The center point for the rotation.
axis (Vector) – The direction vector of the rotation axis.
angle (float) – The rotation angle in degrees.
copy (bool) – Specify True to create a copy of the rotated entities
entities (False to move the original)
num_copies (int) – The number of copies to create.
merge (bool) – Specify True to merge the rotated entities after rotation
- Returns:
True if the operation was successful, False otherwise.
- Return type:
bool
- rotate_3_pts(ents, pt1, pt2, pt3, copy, merge)[source]#
Rotates entities about a plane defined by three points
- Parameters:
ents (EntList) – The entities to rotate.
pt1 (Vector) – The first point defining the plane.
pt2 (Vector) – The second point defining the plane.
pt3 (Vector) – The third point defining the plane.
copy (bool) – Specify True to create a copy of the rotated entities. False to move the original entities
merge (bool) – Specify True to merge the rotated entities after rotation.
- Returns:
True if the operation was successful, False otherwise.
- Return type:
bool
- scale(ent, reference, scale, copy, merge)[source]#
Scales a set of entities about a reference point
- Parameters:
ent (EntList) – The entities to scale.
reference (Vector) – The reference point for the scaling.
scale (Vector) – The scaling factor.
copy (bool) – Specify True to create a copy of the scaled entities
entities (False to move the original)
merge (bool) – Specify True to merge the scaled entities after scaling
- Returns:
True if the operation was successful, False otherwise.
- Return type:
bool
- scale_mesh_density(ents, boundaries, scale)[source]#
Scales the mesh density of a set of entities
- Parameters:
ents (EntList) – The entities to scale.
boundaries (BoundaryList) – The boundaries for the scaling.
scale (float) – The scaling factor.
- Returns:
True if the operation was successful, False otherwise.
- Return type:
bool
- set_mesh_size(global_size, ents, boundaries, size, cad_bodies, num_layer)[source]#
Sets the mesh size for a set of entities.
- Parameters:
global_size (float) – The global mesh size.
ents (EntList) – The entities to set the mesh size for.
boundaries (BoundaryList) – The boundaries to set the mesh size for.
size (float) – The mesh size.
cad_bodies (EntList) – The CAD bodies to set the mesh size for.
num_layer (int) – The number of layers.
- Returns:
True if the operation was successful, False otherwise.
- Return type:
bool
- translate(ent, translation, copy, num_copies, merge)[source]#
Translates a set of entities by a given vector
- Parameters:
ent (EntList) – The entities to translate.
translation (Vector) – The translation vector.
copy (bool) – Specify True to create a copy of the translated entities
entities (False to move the original)
num_copies (int) – The number of copies to create.
merge (bool) – Specify True to merge the translated entities after translation
- Returns:
True if the operation was successful, False otherwise.
- Return type:
bool