*sketchedit

Edits the sketch entity by adding/removing/modifying entities with various operations.

Syntax

*sketchedit <select_type>=<selection> operation=<value> <option1>=<value1> <option2>=<value2> ... <optionN>=<valueN>

Type

HyperMesh Tcl Modify Command

Description

Edits the sketch entity by adding/removing/modifying entities with various operations. Different operations require a different set of arguments. See the Examples section for details on how to use the function.

Inputs

<select_type>=<selection>
The entity or entities that are to be queried. There are several ways to provide the entities to be queried. Only one option can be used at a time:
id=<sketch_id>
The ID of the sketch entity.
name=<sketch_name>
The name of the sketch entity.
operation=<value>
The operation to perform. Valid values are:
  • add - Add the new entities into the sketch.
  • modify - Modify the existing entity data in the sketch.
  • split - Split the entity into multiple entities.
  • fillet - Add the fillet to the corner points.
  • offset - Offset entities by offsetting chain with offset distance.
  • trim - Trim the entities.
  • mirror - Mirror entities.
  • remove - Remove the entity/entities from the sketch.
  • extend - Extend the line/arc entity.
  • transform - Transform the entities to a new position.
  • clone - Creating entities from cloning existing entities.
entity_type=<value>
The entity type to be created. Valid only for operation="add". Valid values are point, line, circle, arc, ellipse, elliptic_arc, spline, polyline, pattern, constraint, dimension, rectangle, parallelogram, and polygon.
creation_method=<value>
The method of creation of the entity. Valid only for operation="add".
List of supported creation methods:
Table 1.
Entity Type Creation Method Description
point point_position_single Single point created on the position coordinates specified.
point_position_list Multiple points are created on the list of position coordinates specified.
point_curve_middle Points are created on middle of the curve entity specified.
line line_position_direction Infinite line is created with origin position and direction of line.
line_point_direction Infinite line is created with origin point specified and direction of line.
line_end_positions Line is created from start and end position coordinates.
line_end_points Line is created from start and end points.
line_angle_length Line is created from the start position and the end position is calculated from the angle and line length.
circle circle_centerposition_radius Circle is created from the center position and the radius.
circle_centerpoint_radius Circle is created from the center point and the radius.
circle_center_curve_position Circle is created from center position and a position on the circle.
circle_center_curve_point Circle is created from the center point and a point on the circle.
circle_diagonal_positions Circle is created from two diametrically opposite positions.
circle_diagonal_points Circle is created from the two diametrically opposite points.
circle_three_positions Circle is created from the three positions on the circumference of the circle.
circle_three_points Circle is created from three points on the circumference of the circle.
arc arc_three_positions Arc is created from the three position coordinates, start and end position and position on the curve specifies the direction of the curve.
arc_three_points Arc is created from the three points, start and end position and position on the curve specifies the direction of the curve.
arc_center_two_positions Arc is created from the center and start and end position coordinates.
arc_center_two_points Arc is created from the center and start and end points.
arc_tangent_two_positions Arc is created from the tangent to the curve and the start and end positions.
arc_tangent_two_points Arc is created from the tangent to the curve and the start and end points.
ellipse ellipse_center_axis_radius Ellipse is created from the center position and the major and minor radius.
ellipse_center_axis_lines Ellipse is created from the center point and the major and minor axis lines.
elliptic arc ellipticarc_center_axis_position Elliptic arc is created from the center position and the major and minor position and the bounded points.
ellipticarc_center_axis_lines Elliptic arc is created from the center position and the major axis and minor lines and the bounded points.
spline spline_position_list Create spline based on the coordinates specified.
spline_point_list Create spline based on the points specified.
polyline polyline_lines_list Creating the continuously connected lines from the list of position coordinates.
polyline_lines_arcs_list Creating continuously connected lines and arcs from the list of position coordinates.
pattern pattern_linear_one_direction Create linear pattern in one direction.
pattern_linear_two_direction Create linear pattern in two directions.
pattern_circular Create circular pattern.
constraint constraint_on_entity Create constraint on single entity.
constraint_two_entities Create constraint between two entities.
dimension dimension_on_entity Create dimension on an entity.
dimension_two_entities Create dimension constraint between two entities.
rectangle rectangle_diagonal_positions Create rectangle using diagonal positions.
rectangle_center_corner Create rectangle using the center corner method.
rectangle_center_length_width Create rectangle using the center length/width method.
rectangle_three_positions Create rectangle using three positions.
parallelogram parallelogram_three_positions Create parallelogram with 3 positions.
polygon polygon_center_position_sides Create polygon using the center position and sides.
point_position=<value>
The x, y coordinates on the sketch plane defining the point position.
position_list=<value>
The list of x, y coordinates on the sketch plane defining multiple point positions.
curve_id=<value>
The UID of a line, circle, ellipse, or spline.
line_position=<value>
The x, y coordinates on the sketch plane defining the line origin.
line_direction=<value>
The x, y vector components on the sketch plane defining the line direction.
point_id=<value>
The UID of the point defining the line origin.
start_position=<value>
The x, y coordinates on the sketch plane defining the start position of the line.
end_position=<value>
The x, y coordinates on the sketch plane defining the end position of the line.
start_point=<value>
The UID of the point defining the start position of the line.
end_point=<value>
The UID of the point defining the end position of the line.
angle=<value>
The angle between the horizontal axis and the line in degrees or radians depending on the selected sketching units.
length=<value>
The line length in the sketching units.
center_position=<value>
The x, y coordinates on the sketch plane defining the center position.
radius=<value>
The radius of the circle.
center_point=<value>
The UID of the point defining the center position of the circle, ellipse, or arc.
curve_position=<value>
The x, y coordinates on the sketch plane defining a position on circle curve.
curve_point=<value>
The UID of the point on the circle curve position.
opposite_position=<value>
The x, y coordinates on the sketch plane defining the opposite position on the circle curve.
opposite_point=<value>
The UID of the point on the opposite position on the circle curve.
first_position=<value>
The x, y coordinates on the sketch plane defining the first position on the circle.
second_position=<value>
The x, y coordinates on the sketch plane defining the second position on the circle.
third_position=<value>
The x, y coordinates on the sketch plane defining the third position on the circle.
first_point=<value>
The UID of the point defining the first position on the circle.
second_point=<value>
The UID of the point defining the second position on the circle.
third_point=<value>
The UID of the point defining the third position on the circle.
is_periodic=<value>
The flag defining if the curve is periodic.
arc_direction=<value>
The list of integers defining the arc direction in a polyline (0 - tangent upward, 1 - tangent downward, 2 - normal upward, 3 - normal downward).
type_list=<value>
The list of integers defining the type of polyline segments (0 - line, 1 - arc).
entity_list=<value>
The list of UIDs of input lines used to create the pattern.
pattern_dir=<value>
The UID of the line defining the pattern direction.
pattern_distance=<value>
The length of the pattern.
number_copies=<value>
The number of copies to define one directional pattern.
is_symmetric=<value>
The flag defining if the pattern is symmetric.
dir1_copies_count=<value>
The number of copies in the first direction.
dir1_distance=<value>
The pattern distance in the first direction.
dir1_is_symmetric=<value>
The flag defining if the pattern is symmetric in the first direction.
pattern_dir1=<value>
The UID of the line defining the first pattern direction.
dir2_copies_count=<value>
The number of copies in the second direction.
dir2_distance=<value>
The pattern distance in the second direction.
dir2_is_symmetric=<value>
The flag defining if the pattern is symmetric in the second direction.
pattern_dir2=<value>
The UID of the line defining the second pattern direction.
pattern_angle=<value>
The angle of the pattern in degrees.
is_counterclockwise=<value>
The flag defining the direction the arc is created between the start and end position.
invert_tangent=<value>
The flag to invert the tangent of the arc.
name=<value>
The name of the sketch entity to edit.
is_interpolated=<value>
The flag defining if the spline passes through the fit points or is approximated by the control points.
corner_position=<value>
The x, y coordinates on the sketch plane defining the corner position of the rectangle.
corner_position2=<value>
The x, y coordinates on the sketch plane defining the second corner position of the rectangle.
length_position=<value>
The x, y coordinates on the sketch plane defining the length position of the rectangle.
width_position=<value>
The x, y coordinates on the sketch plane defining the width position of the rectangle.
lower_left=<value>
The x, y coordinates on the sketch plane defining the lower left corner of the rectangle.
lower_right=<value>
The x, y coordinates on the sketch plane defining the lower right corner of the rectangle.
upper_right=<value>
The x, y coordinates on the sketch plane defining the upper right corner of the rectangle.
circle_position=<value>
The x, y coordinates on the sketch plane defining the position of the circle.
number_sides=<value>
The number of polygon sides (3-8).
midside_mode=<value>
The flag defining if the polygon is defined at a midside position or a vertex position.
entity_id=<value>
The UID of the entity to be modified.
constraint_type=<value>
The type of constraint. List of supported constraint types:
Table 2.
constraint_fixed constraint_collinear constraint_major_radius
constraint_horizontal constraint_distance_aligned constraint_minor_radius
constraint_vertical constraint_distance_horizontal constraint_offset_distance
constraint_coincident constraint_distance_vertical constraint_pattern_angle
constraint_parallel constraint_radius constraint_pattern_distance
constraint_perpendicular constraint_diameter_aligned constraint_pattern_distance_2
constraint_equal constraint_diameter_horizontal constraint_pattern_linear
constraint_tangent constraint_diameter_vertical constraint_pattern_circular
constraint_concentric constraint_angle
first_entity=<value>
The UID of the first entity to be constrained.
second_entity=<value>
The UID of the second entity to be constrained.
dim_position=<value>
The x, y coordinates on the sketch plane defining the position of the dimension.
is_fixed=<value>
The flag defining if an entity is fixed (1) or not (0).
is_construction=<value>
The flag defining if an entity is construction (1) or not (0).
start_angle=<value>
The start angle of a circle in degrees or radians depending on the selected sketching units.
end_angle=<value>
The end angle of a circle in degrees or radians depending on the selected sketching units.
sweep_angle=<value>
The sweep angle of a circle in degrees or radians depending on the selected sketching units.
major_radius=<value>
The major radius of the ellipse.
minor_radius=<value>
The minor radius of the ellipse.
variable_name=<value>
The variable name present in the variable manager. Valid only for dimension constraints.
dim_value=<value>
The dimension constraint value.
is_dimdriven=<value>
The flag defining if a constraint is dimension driven (1) or not (0).
operation_method=<value>
The operation methods. List of supported operation methods:
Table 3.
split_position mirror_single translate_list
fillet_single mirror_list rotate_list_position
fillet_list remove_single rotate_list_point
offset_position remove_list clone_single
trim_position extend_position clone_list
split_position=<value>
The x, y coordinates on the sketch plane defining the position at which curve entity is split.
point_list=<value>
The list of point UIDs.
geom_position=<value>
The x, y coordinates on the sketch plane on curve entity for selecting the chain of entities offset.
offset_distance=<value>
The offset distance.
trim_position=<value>
The x, y coordinates on the sketch plane defining the position for picking the curve segment to be removed from the curve.
mirror_axis=<value>
The UID of the line defining the mirror axis.
extend_position=<value>
The x, y coordinates on the sketch plane defining the position on other entity to which the selected curve is extended/shortened.
translate_direction=<value>
The x, y vector components on the sketch plane defining the translation direction.
translate_distance=<value>
The translation distance.
keep_relations=<value>
The flag defining if the relations are kept after the transformation (1) or not (0).
rotate_angle=<value>
The angle in degrees or radians depending on the selected sketching units by which the entities are rotated around the origin.
delete_original=<value>
The flag defining if the original entities are deleted after the transformation (1) or not (0).
major_axis=<value>
The x, y vector components defining the major axis of the ellipse.
majoraxis_line=<value>
The UID of the line defining the major axis of the ellipse.
minoraxis_line=<value>
The UID of the line defining the minor axis of the ellipse.
majoraxis_position=<value>
The x, y coordinates on the sketch plane defining the position of the major axis of the ellipse.
minoraxis_position=<value>
The x, y coordinates on the sketch plane defining the position of the minor axis of the ellipse.

Examples

Examples - Add Operation
Add a point
To create a point at (10.0, 20.0) in the sketch with ID 1:
*sketchedit id=1 operation=add entity_type=point creation_method=point_position_single point_position={10.0 20.0}
To create multiple points at locations (10.0, 20.0), (30.0, 40.0) in the sketch with ID 1:
*sketchedit id=1 operation=add entity_type=point creation_method=point_position_list position_list={{10.0 20.0} {30.0 40.0}}
To create a point in the middle of the line with ID 1 in the sketch with UID 13:
*sketchedit id=1 operation=add entity_type=point creation_method=point_curve_middle curve_id=13
Add a line
To create an infinite line with origin at (10.0, 20.0) and direction (1.0, 0.0) in the sketch with ID 1:
*sketchedit id=1 operation=add entity_type=line creation_method=line_position_direction line_position={10.0 20.0} line_direction={1.0 0.0}
To create an infinite line with origin at point with UID 5 and direction (1.0, 0.0) in the sketch with ID 1:
*sketchedit id=1 operation=add entity_type=line creation_method=line_point_direction point_id=5 line_direction={1.0 0.0}
To create a line with start position (10.0, 20.0) and end position (30.0, 40.0) in the sketch with ID 1:
*sketchedit id=1 operation=add entity_type=line creation_method=line_end_positions start_position={10.0 20.0} end_position={30.0 40.0}
To create a line with start position at point with UID 5 and end position at point with UID 6 in the sketch with ID 1:
*sketchedit id=1 operation=add entity_type=line creation_method=line_point_positions start_point=5 end_point=6
To create a line with start position (10.0, 20.0), at 45.0 angle from horizontal axis, and length 50.0 in the sketch with ID 1:
*sketchedit id=1 operation=add entity_type=line creation_method=line_angle_length start_position={10.0 20.0} angle=45.0 length=50.0
Add a circle
To create a circle with center at (10.0, 20.0) and radius 5.0 in the sketch with ID 1:
*sketchedit id=1 operation=add entity_type=circle creation_method=circle_centerposition_radius center_position={10.0 20.0} radius=5.0
To create a circle with center at point with UID 3 and radius 5.0 in the sketch with ID 1:
*sketchedit id=1 operation=add entity_type=circle creation_method=circle_centerpoint_radius center_point=3 radius=5.0
To create a circle with center at (10.0, 20.0) and a position on the circle at (15.0, 20.0) in the sketch with ID 1:
*sketchedit id=1 operation=add entity_type=circle creation_method=circle_center_curve_position center_position={10.0 20.0} curve_position={15.0 20.0}
To create a circle with center at point with UID 3 and a position on the circle at point with UID 4 in the sketch with ID 1:
*sketchedit id=1 operation=add entity_type=circle creation_method=circle_center_curve_position center_point=3 curve_point=4
To create a circle with two diametrically opposite positions at (10.0, 20.0) and (10.0, 30.0) in the sketch with ID 1:
*sketchedit id=1 operation=add entity_type=circle creation_method=circle_diagonal_positions curve_position={10.0 20.0} opposite_position={10.0 30.0}
To create a circle with two diametrically opposite positions at points with UID 4 and 5 in the sketch with ID 1:
*sketchedit id=1 operation=add entity_type=circle creation_method=circle_diagonal_positions curve_point=4 opposite_point=5
To create a circle from three positions on the circumference (0.0, 0.0), (1.0, 0.0), and (0.0, 1.0) in the sketch with ID 1:
*sketchedit id=1 operation=add entity_type=circle creation_method="circle_three_positions " first_position={0.0 0.0} second_position={1.0 0.0} third_position={0.0 1.0}
To create a circle from three positions on the circumference at points with UID 3, 4, and 5 in the sketch with ID 1:
*sketchedit id=1 operation=add entity_type=circle creation_method="circle_three_positions " first_point=3 second_point=4 third_point=5
Add an arc
To create an arc with start position at (10.0, 20.0), end position at (30.0, 40.0), and curve position at (20.0, 30.0) in the sketch with ID 1:
*sketchedit id=1 operation=add entity_type=arc creation_method=arc_three_positions start_position={10.0 20.0} end_position={30.0 40.0} curve_position={20.0 30.0}
To create an arc with start position at point with UID 3, end position at point with UID 4, and curve position at point with UID 5 in the sketch with ID 1:
*sketchedit id=1 operation=add entity_type=arc creation_method=arc_three_points start_point=3 end_point=4 curve_point=5
To create an arc with start position at (0.0, 0.0), end position at (10.0, 20.0), and center position at (0.0, 10.0) in clockwise direction in the sketch with ID 1:
*sketchedit id=1 operation=add entity_type=arc creation_method=arc_center_two_positions start_position={0.0 0.0} end_position={10.0 20.0} center_position={0.0 10.0} is_counterclockwise=0
To create an arc with start position at point with UID 3, end position at point with UID 4, and center position at point with UID 5 in clockwise direction in the sketch with ID 1:
*sketchedit id=1 operation=add entity_type=arc creation_method=arc_center_two_points start_point=3 end_point=4 center_point=5 is_counterclockwise=0
To create an arc with start position at (0.0, 0.0), end position at (10.0, 20.0), and tangent to the curve with UID 4 without inverting the tangent in the sketch with ID 1:
*sketchedit id=1 operation=add entity_type=arc creation_method=arc_tangent_two_positions curve_id=4 start_position={0.0 0.0} end_position={10.0 20.0} invert_tangent=0
To create an arc with start position at points with UID 3, end position at point with UID 5, and with inverted tangent to the curve with UID 4 in the sketch with ID 1:
*sketchedit id=1 operation=add entity_type=arc creation_method=arc_tangent_two_points curve_id=4 start_point=3 end_point=5 invert_tangent=1
Add an ellipse
To create an ellipse with center position at (0.0, 0.0), major axis direction in (0.0, 1.0), major radius of 5.0, and minor radius of 3.0 in the sketch with ID 1:
*sketchedit id=1 operation=add entity_type=ellipse creation_method=ellipse_center_axis_radius center_position={0.0 0.0} major_axis={0.0 1.0} major_radius=5.0 minor_radius=3.0
To create an ellipse with center position at point with UID 6, major axis defined by line with UID 10, and minor axis defined by line with UID 11 in the sketch with ID 1:
*sketchedit id=1 operation=add entity_type=ellipse creation_method=ellipse_center_axis_lines center_position={0.0 0.0} majoraxis_line=10 minoraxis_line=11
Add an elliptic arc
To create an elliptic arc with center position at (0.0, 0.0), major axis position in (0.0, 1.0), minor axis position in (1.0, 0.0), start position at (5.0, 0.0), end position at (-5.0, 0.0) in counterclockwise direction in the sketch with ID 1:
*sketchedit id=1 operation=add entity_type=elliptic_arc creation_method=ellipticarc_center_axis_position center_position={0.0 0.0} majoraxis_position={0.0 1.0} minoraxis_position={1.0 0.0} start_position={5.0 0.0} end_position={-5.0 0.0} is_counterclockwise=1
To create an elliptical arc with center position at (0.0, 0.0), major axis position in (0.0, 1.0), minor axis position in (1.0, 0.0), start position at (5.0, 0.0), end position at (-5.0, 0.0) in counterclockwise direction in the sketch with ID 1:
*sketchedit id=1 operation=add entity_type=elliptic_arc creation_method=ellipticarc_center_axis_position center_position={0.0 0.0} majoraxis_position={0.0 1.0} minoraxis_position={1.0 0.0} start_position={5.0 0.0} end_position={-5.0 0.0} is_counterclockwise=1
To create an elliptical arc with center at point with UID 6, major axis defined by line with UID 10, minor axis defined by line with UID 11, start position at point with UID 12, end position at point with UID 13 in clockwise direction in the sketch with ID 1:
*sketchedit id=1 operation=add entity_type=elliptic_arc creation_method=ellipticarc_center_axis_position center_point=6 majoraxis_line=10 minoraxis_line=11 start_point=12 end_point=13 is_counterclockwise=0
Add a spline
To create a spline with control points at (0.0, 0.0), (1.0, 1.0), and (2.0, 0.0) which is not periodic, with degree 3 and passing through the control points in the sketch with ID 1:
*sketchedit id=1 operation=add entity_type=spline creation_method=spline_position_list position_list={{0.0 0.0} {1.0 1.0} {2.0 0.0}} is_periodic=0 degree=3 is_interpolated=0
To create a spline with control points with UID 6, 7, and 8 which is not periodic, with degree 3 and not passing through the control points in the sketch with ID 1:
*sketchedit id=1 operation=add entity_type=spline creation_method=spline_point_list point_list={6 7 8} is_periodic=0 degree=3 is_interpolated=1
Add a polyline
To create a polyline with positions coordinates (0.0, 0.0), (1.0, 1.0), and (2.0, 0.0) in the sketch with ID 1:
*sketchedit id=1 operation=add entity_type=polyline creation_method=polyline_lines_list position_list={{0.0 0.0} {1.0 1.0} {2.0 0.0}}
To create a polyline starting at position (0.0, 0.0), passing through positions (3.0, 4.0), (5.0, 6.0), and (7.0, 8.0) where first segment is a line, second segment is an arc, and third segment is a line, with the arc direction being normal downward in the sketch with ID 1:
*sketchedit id=1 operation=add entity_type=polyline creation_method=polyline_lines_arcs_list start_position={0.0 0.0} position_list={{3.0 4.0} {5.0 6.0} {7.0 8.0}} type_list={0 1 0} arc_direction={3}
Add a pattern
To create a linear pattern using lines with UIDs 1, 2, and 3 as input lines, line with UID 4 as the pattern direction, with pattern distance of 5.0, with 3 copies, and symmetric pattern in the sketch with ID 1:
*sketchedit id=1 operation=add entity_type=pattern creation_method=pattern_linear_one_direction entity_list={1 2 3} pattern_dir=4 pattern_distance=5.0 number_copies=3 is_symmetric=1
To create a linear pattern in two directions using lines with UIDs 1, 2, and 3 as input lines, line with UID 4 as the first pattern direction, with pattern distance in the first direction of 5.0, with 3 copies in the first direction, asymmetric pattern in the first direction, line with UID 5 as the second pattern direction, with pattern distance in the second direction of 10.0, with 2 copies in the second direction, and asymmetric pattern in the second direction in the sketch with ID 1:
*sketchedit id=1 operation=add entity_type=pattern creation_method=pattern_linear_two_direction entity_list={1 2 3} pattern_dir1=4 dir1_distance=5.0 dir1_copies_count=3 dir1_is_symmetric=0 pattern_dir2=5 dir2_distance=10.0 dir2_copies_count=2 dir2_is_symmetric=0
To create a circular asymmetric pattern using lines with UIDs 1, 2, and 3 as input lines, with center at point with UID 7, with pattern angle of 30.0 degrees, 3 copies in the sketch with ID 1:
*sketchedit id=1 operation=add entity_type=pattern creation_method=pattern_circular entity_list={1 2 3} center_point=7 number_copies=3 pattern_angle=30.0 is_symmetric=0
Add a constraint
To create a horizontal constraint on line with UID 1 in the sketch with ID 1:
*sketchedit id=1 operation=add entity_type=constraint creation_method=constraint_on_entity entity_id=1 constraint_type=constraint_horizontal
To create a collinear constraint between lines with UIDs 1 and 2 in the sketch with ID 1:
*sketchedit id=1 operation=add entity_type=constraint creation_method=constraint_two_entities first_entity=1 second_entity=2 constraint_type=constraint_collinear
Add a dimension
To create a radius dimension on circle with UID 1 at position (10.0, 20.0) in the sketch with ID 1:
*sketchedit id=1 operation=add entity_type=dimension creation_method=dimension_on_entity entity_id=1 dim_position={10.0 20.0} constraint_type=constraint_radius
To create an angle dimension constraint between lines with UIDs 1 and 2 at position (10.0, 20.0) in the sketch with ID 1:
*sketchedit id=1 operation=add entity_type=dimension creation_method=dimension_two_entities first_entity=1 second_entity=2 dim_position={10.0 20.0} constraint_type=constraint_angle
Add a rectangle
To create a rectangle with first corner position at (10.0, 20.0), second corner position at (20.0, 20.0) in the sketch with ID 1:
*sketchedit id=1 operation=add entity_type=rectangle creation_method=rectangle_diagonal_positions corner_position={10.0 20.0} corner_position2={20.0 20.0}
To create a rectangle with the center at position (10.0, 10.0) and corner at position (15.0, 15.0) in the sketch with ID 1:
*sketchedit id=1 operation=add entity_type=rectangle creation_method=rectangle_center_corner center_position={10.0 10.0} corner_position={15.0 15.0}
To create a rectangle with the center at position (10.0, 10.0), the length position at (15.0, 10.0), and the width position at (10.0, 12.0) in the sketch with ID 1:
*sketchedit id=1 operation=add entity_type=rectangle creation_method=rectangle_center_length_width center_position={10.0 10.0} length_position={15.0 10.0} width_position={10.0 12.0}
To create a rectangle with the lower left corner at position (10.0, 20.0), the lower right corner at position (20.0, 20.0), and the upper right corner at position (20.0, 30.0) in the sketch with ID 1:
*sketchedit id=1 operation=add entity_type=rectangle creation_method=rectangle_three_positions lower_left={10.0 20.0} lower_right={20.0 20.0} upper_right={20.0 30.0}
Add a parallelogram
To create a parallelogram with lower left corner at position (10.0, 20.0), lower right corner at position (20.0, 20.0), and upper right corner at position (25.0, 30.0) in the sketch with ID 1:
*sketchedit id=1 operation=add entity_type=parallelogram creation_method=parallelogram_three_positions lower_left={10.0 20.0} lower_right={20.0 20.0} upper_right={25.0 30.0}
Add a polygon
To create a polygon with center at position (10.0, 10.0), circle position at (15.0, 10.0) using vertex mode, and with 6 sides in the sketch with ID 1:
*sketchedit id=1 operation=add entity_type=polygon creation_method=polygon_center_position_sides center_position={10.0 10.0} circle_position={15.0 10.0} number_sides=6 midside_mode=0
Examples - Modify Operations
Modify an ellipse
Modify the ellipse with UID 3 by setting its major radius to 3.0, its minor radius to 2.0, and its center in the sketch with ID 1:
*sketchedit id=1 operation=modify entity_id=3 major_radius=3.0 minor_radius=2.0
Examples - Split Operation
Split a curve
Split the curve with UID 3 at position (10.0, 20.0) in the sketch with ID 1:
*sketchedit id=1 operation=split operation_method=split_position entity_id=3 split_position={10.0 20.0}
Examples - Fillet Operation
To create a fillet
To create a fillet at point with UID 20 with radius 0.2 in the sketch with ID 1:
*sketchedit id=1 operation=fillet operation_method=fillet_single point_id=20 radius=0.2
To create a fillet at points with UID 20, 21, and 22 with radius 0.2 in the sketch with ID 1:
*sketchedit id=1 operation=fillet operation_method=fillet_list point_list={20 21 22} radius=0.2
Examples - Offset Operation
Offset a curve
Offset the curve with UID 3 by 5.0 units in the sketch with ID 1:
*sketchedit id=1 operation=offset operation_method=offset_single entity_id=3 offset_distance=5.0
Offset the curves with UIDs 4, 5, and 6 by 10.0 units in the sketch with ID 1:
*sketchedit id=1 operation=offset operation_method=offset_list entity_list={4 5 6} offset_distance=10.0
Examples - Trim Operation
Trim a curve
Trim a curve at position (10.0, 20.0) in the sketch with ID 1:
*sketchedit id=1 operation=trim operation_method=trim_position trim_position={10.0 20.0}
Examples - Mirror Operation
Mirror a curve
Mirror a curve with UID 3 along the line with UID 5 in the sketch with ID 1:
*sketchedit id=1 operation=mirror operation_method=mirror_single entity_id=3 mirror_axis=5
Mirror multiple curves with UIDs 4, 5, and 6 along the line with UID 7 in the sketch with ID 1:
*sketchedit id=1 operation=mirror operation_method=mirror_list entity_list={4 5 6} mirror_axis=7
Examples - Remove Operation
Remove entities from a sketch
Remove a single entity with UID 3 from the sketch with ID 1:
*sketchedit id=1 operation=remove operation_method=remove_single entity_id=3
Remove multiple entities with UIDs 4, 5, and 6 from the sketch with ID 1:
*sketchedit id=1 operation=remove operation_method=remove_list entity_list={4 5 6}
Examples - Extend Operation
Extend a curve
Extend a curve with UID 3 at position (10.0, 20.0) to meet another entity at position (15.0, 25.0) in the sketch with ID 1:
*sketchedit id=1 operation=extend operation_method=extend_position entity_id=3 geom_position={10.0 20.0} extend_position={15.0 25.0}
Examples - Transform Operation
Transform entities in a sketch
Translate an entity with UID 3 in direction (1.0, 0.0) by 5.0 while keeping the relations in the sketch with ID 1:
*sketchedit id=1 operation=transform operation_method=translate_list entity_list={3} translate_direction={1.0 0.0} translate_distance=5.0 keep_relations=1
Rotate entities with UIDs 4 and 5 around the center position (1.0, 1.0) by 180 degrees while keeping the relations in the sketch with ID 1:
*sketchedit id=1 operation=transform operation_method=rotate_list_position entity_list={4 5} center_position={1.0 1.0} rotate_angle=180.0 keep_relations=1
Rotate entities with UIDs 6 and 7 around the center point with UID 8 by 90 degrees while keeping the relations in the sketch with ID 1:
*sketchedit id=1 operation=transform operation_method=rotate_list_point entity_list={6 7} center_point=8 rotate_angle=90.0 keep_relations=1
Examples - Clone Operation
Clone entities in a sketch
Clone a single entity with UID 3 by translating it in the direction (1.0, 0.0) and rotating it by 90 degrees, deleting the original entity in the sketch with ID 1:
*sketchedit id=1 operation=clone operation_method=clone_single entity_id=3 delete_original=1 translate_direction={1.0 0.0} rotate_angle=90.0
Clone multiple entities with UIDs 4, 5, and 6 by translating them in the direction (3.0, 0.0) and rotating them by 135 degrees, deleting the original entities in the sketch with ID 1:
*sketchedit id=1 operation=clone operation_method=clone_list entity_list={4 5 6} delete_original=1 translate_direction={3.0 0.0} rotate_angle=135.0

Errors

Incorrect usage results in a Tcl error. To detect errors, you can use the catch command:
if { [ catch {command_name...} ] } {
   # Handle error
}

Version History

2021.2