Polyline#

class pyaedt.modeler.cad.polylines.Polyline(primitives, src_object=None, position_list=None, segment_type=None, cover_surface=False, close_surface=False, name=None, matname=None, xsection_type=None, xsection_orient=None, xsection_width=1, xsection_topwidth=1, xsection_height=1, xsection_num_seg=0, xsection_bend_type=None, non_model=False)[source]#

Creates and manipulates a polyline.

The constructor for this class is intended to be called from the pyaedt.modeler.Primitives.Primitives.create_polyline() method. The documentation is provided there.

The returned Polyline object exposes the methods for manipulating the polyline.

Parameters:
primitivespyaedt.modeler.Primitives3D.Primitives3D

Pointer to the parent Primitives object.

src_objectoptional

The default is None. If specified, all other arguments are ignored.

position_listlist, optional

List of positions in the [x, y, z] format. The default is None. It is mandatory if scr_object is not specified.

segment_typestr or PolylineSegment or list, optional

Define the list of segment types. For a string, "Line" or "Arc" is valid. Use a "PolylineSegment", for "Line", "Arc", "Spline", or "AngularArc". A list of segment types (str or pyaedt.modeler.Primitives.PolylineSegment) is valid for a compound polyline. The default is None.

cover_surfacebool, optional

The default is False.

close_surfacebool, optional

The default is False.

namestr, optional

The default is None.

matnamestr, optional

Name of the material. The default is None.

xsection_typestr, optional

Type of the cross-section. Options are "Line", "Circle", "Rectangle", and "Isosceles Trapezoid". The default is None.

xsection_orientstr, optional

Direction of the normal vector to the width of the cross-section. Options are "X", "Y", "Z", and "Auto". The default is None.

xsection_widthfloat or str, optional

Width or diameter of the cross-section for all types. The default is 1.

xsection_topwidthfloat or str, optional

Top width of the cross-section for the type "Isosceles Trapezoid" only. The default is 1.

xsection_heightfloat or str, optional

Height of the cross-section for the types "Rectangle" and "Isosceles Trapezoid" only. The default is 1.

xsection_num_segint, optional

Number of segments in the cross-section surface for the types "Circle", "Rectangle" and "Isosceles Trapezoid". The default is 0. The value must be 0 or greater than 2.

xsection_bend_typestr, optional

Type of the bend. The default is None, in which case the bend type is set to "Corner". For the type "Circle", the bend type should be set to "Curved".

Methods

Polyline.clone()

Clone a polyline object.

Polyline.delete()

Delete the object.

Polyline.duplicate_along_line(vector[, ...])

Duplicate the object along a line.

Polyline.duplicate_around_axis(cs_axis[, ...])

Duplicate the object around the axis.

Polyline.edges_by_length(length[, ...])

Filter edges by length.

Polyline.export_image([file_path])

Export the current object to a specified file path.

Polyline.faces_by_area(area[, area_filter, ...])

Filter faces by area.

Polyline.get_touching_faces(object_name)

Get the objects that touch one of the face center of each face of the object.

Polyline.history()

Object history.

Polyline.insert_segment(position_list[, segment])

Add a segment to an existing polyline.

Polyline.intersect(theList[, keep_originals])

Intersect the active object with a given list.

Polyline.largest_face([n])

Return only the face with the greatest area.

Polyline.longest_edge([n])

Return only the edge with the greatest length.

Polyline.mirror(position, vector[, duplicate])

Mirror a selection.

Polyline.move(vector)

Move objects from a list.

Polyline.plot([show])

Plot model with PyVista.

Polyline.remove_point(position[, abstol])

Remove a point from an existing polyline by position.

Polyline.remove_segments(segment_id)

Remove a segment from an existing polyline by segment id.

Polyline.rotate(cs_axis[, angle, unit])

Rotate the selection.

Polyline.section(plane[, create_new, ...])

Section the object.

Polyline.set_crosssection_properties([type, ...])

Set the properties of an existing polyline object.

Polyline.shortest_edge([n])

Return only the edge with the smallest length.

Polyline.smallest_face([n])

Return only the face with the smallest area.

Polyline.split(plane[, sides])

Split the active object.

Polyline.subtract(tool_list[, keep_originals])

Subtract one or more parts from the object.

Polyline.sweep_along_path(sweep_object[, ...])

Sweep the selection along a vector.

Polyline.sweep_along_vector(sweep_vector[, ...])

Sweep the selection along a vector.

Polyline.sweep_around_axis(cs_axis[, ...])

Sweep around an axis.

Polyline.touching_conductors()

Get the conductors of given object.

Polyline.unite(object_list)

Unite a list of objects with this object.

Polyline.wrap_sheet(object_name[, imprinted])

Execute the sheet wrapping around an object.

Attributes

Polyline.bottom_edge_x

Bottom edge in the X direction of the object.

Polyline.bottom_edge_y

Bottom edge in the Y direction of the object.

Polyline.bottom_edge_z

Bottom edge in the Z direction of the object.

Polyline.bottom_face_x

Bottom face in the X direction of the object.

Polyline.bottom_face_y

Bottom face in the X direction of the object.

Polyline.bottom_face_z

Bottom face in the Z direction of the object.

Polyline.bounding_box

Bounding box of a part.

Polyline.bounding_dimension

Retrieve the dimension array of the bounding box.

Polyline.color

Part color as a tuple of integer values for (Red, Green, Blue) color values.

Polyline.color_string

Color tuple as a string in the format '(Red, Green, Blue)'.

Polyline.display_wireframe

Wireframe property of the part.

Polyline.edges

Information for each edge in the given part.

Polyline.end_point

List of the [x, y, z] coordinates for the ending point in the polyline object in the object's coordinate system.

Polyline.face_closest_to_bounding_box

Return only the face ids of the face closest to the bounding box.

Polyline.faces

Information for each face in the given part.

Polyline.faces_on_bounding_box

Return only the face ids of the faces touching the bounding box.

Polyline.group_name

Group the object belongs to.

Polyline.id

ID of the object.

Polyline.is3d

Check for if the object is 3D.

Polyline.is_conductor

Check if the object is a conductor.

Polyline.logger

Logger.

Polyline.mass

Object mass.

Polyline.material_name

Material name of the object.

Polyline.model

Part model or non-model property.

Polyline.name

Name of the object as a string value.

Polyline.object_type

Type of the object.

Polyline.object_units

Object units.

Polyline.part_coordinate_system

Part coordinate system.

Polyline.points

Polyline Points.

Polyline.segment_types

List of the segment types of the polyline.

Polyline.solve_inside

Part solve inside flag.

Polyline.start_point

List of the [x, y, z] coordinates for the starting point in the polyline object in the object's coordinate system.

Polyline.surface_material_name

Surface material name of the object.

Polyline.top_edge_x

Top edge in the X direction of the object.

Polyline.top_edge_y

Top edge in the Y direction of the object.

Polyline.top_edge_z

Top edge in the Z direction of the object.

Polyline.top_face_x

Top face in the X direction of the object.

Polyline.top_face_y

Top face in the Y direction of the object.

Polyline.top_face_z

Top face in the Z direction of the object.

Polyline.touching_objects

Get the objects that touch a vertex, edge midpoint, or face of the object.

Polyline.transparency

Part transparency as a value between 0.0 and 1.0.

Polyline.valid_properties

Valid properties.

Polyline.vertex_positions

List of the [x, y, z] coordinates for all vertex positions in the polyline object in the object's coordinate system.

Polyline.vertices

Information for each vertex in the given part.

Polyline.volume

Object volume.