set_crosssection_properties#

Polyline.set_crosssection_properties(type=None, orient=None, width=0, topwidth=0, height=0, num_seg=0, bend_type=None)[source]#

Set the properties of an existing polyline object.

Parameters:
typestr, optional

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

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, which sets the orientation to "Auto".

widthfloat or str, optional

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

topwidthfloat or str

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

heightfloat or str

Height of the cross-section for the types "Rectangle" and “Isosceles Trapezoid”` only. The default is 0.

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.

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".

Returns:
bool

True when successful, False when failed.

References

>>> oEditor.ChangeProperty

Examples

>>> P = modeler.create_polyline([[0, 1, 2], [0, 2, 3], [2, 1, 4]])
>>> P.set_crosssection_properties(type="Circle", width="1mm")