A ConstrainedSketch object contains the entities that are used to create a sketch. The objects include ConstrainedSketchGeometry objects contained in the Geometry Repository, such as Line, Arc, and Spline. Vertex, Dimension, Constraint, and Parameter objects are contained in their respective repositories.
import sketch mdb.models[name].sketches[name]
This method creates a ConstrainedSketch object. If the sketch cannot be created, the method returns None.
mdb.models[name].ConstrainedSketch
Required arguments
A String specifying the repository key.
A Float specifying the sheet size.
Optional arguments
A Float specifying the spacing between gridlines. Possible values are Floats 0. The default value is approximately 2 percent of sheetSize.
A sequence of sequences of Floats specifying the three-dimensional orientation of the sketch. The sequence is a 3 × 4 transformation matrix specifying the axis of rotation and the translation vector. Possible values are any Floats.
The default value for the axis of rotation is the identity matrix
(1.0, 0.0, 0.0), (0.0, 1.0, 0.0), (0.0, 0.0, 1.0)The default value for the translation vector is(0.0, 0.0, 0.0)The default values position the sketch on the X–Y plane centered at the origin.
Return value
A ConstrainedSketch object.
Exceptions
This method copies one ConstrainedSketch object to a new ConstrainedSketch object.
Note: If the name of the sketch to be copied to is __edit__, Abaqus creates an exact copy that contains both reference geometry and a non-identity transform matrix. Otherwise, the Sketch copy constructor strips the reference geometry from the copied sketch and sets the transform matrix to identity, creating a standalone copy.
mdb.models[name].ConstrainedSketch
Required arguments
A String specifying the repository key.
A ConstrainedSketch object to be copied.
Optional arguments
Return value
A ConstrainedSketch object.
Exceptions
InvalidNameError.
This method creates a ConstrainedSketch object and places it in the sketches repository.
mdb.models[name].ConstrainedSketchFromGeometryFile
Required arguments
A String specifying the repository key.
An AcisFile object specifying a file containing geometry. The geometry in the file is converted to two-dimensional sketch geometry in the X–Y plane.
Optional arguments
Return value
A ConstrainedSketch object.
Exceptions
InvalidNameError.
This method prints the following statistics about a sketch:
The sketch Id (a positive integer).
The number of geometry curves (the number of ConstrainedSketchGeometry objects).
The number of dimensions (the number of ConstrainedSketchDimension objects).
The number of vertices (the number of ConstrainedSketchVertex objects).
Arguments
Return value
Exceptions
This method indicates the construction line that will be used as a centerline for revolved features.
Required argument
A ConstrainedSketchGeometry object specifying a construction line that indicates the centerline of revolved features.
Optional arguments
Return value
Exceptions
This method indicates the isolated point that will be used as the center of twist when an extruded feature is created with twist.
Required argument
A ConstrainedSketchVertex object specifying an isolated point that indicates the center of twist for extruded features that use a twist angle.
Optional arguments
Return value
Exceptions
This method applies dimensions to the selected ConstrainedSketchGeometry objects in an effort to make the ConstrainedSketch well defined.
Required argument
A sequence specifying the ConstrainedSketchGeometry objects to dimension.
Optional arguments
Return value
Exceptions
This method automatically trims a selected ConstrainedSketchGeometry object at the specified location. If the object does not intersect other ConstrainedSketchGeometry objects, the entire selected object will be deleted.
Required arguments
The ConstrainedSketchGeometry object to be trimmed.
A pair of Floats specifying the location on ConstrainedSketchGeometry where the trimming should be applied. point1 and parameter1 are mutually exclusive.
A Float specifying the parameter location on the ConstrainedSketchGeometry where the trimming should be applied. point1 and parameter1 are mutually exclusive.
Optional arguments
Return value
Exceptions
This method breaks a specified ConstrainedSketchGeometry object (curve1) using another specified ConstrainedSketchGeometry object (curve2). If the selected ConstrainedSketchGeometry objects intersect, then only curve1 will be broken; curve2 is not affected by the operation. The location for the break is determined by the specified point values.
Required arguments
A ConstrainedSketchGeometry object specifying the object to be broken.
A pair of Floats specifying the location on curve1 near where the break should be applied.
A ConstrainedSketchGeometry object specifying where curve1 should be broken.
A pair of Floats specifying the location on curve2 near where curve1 should be broken.
Optional arguments
Return value
Exceptions
This method creates copies of the given ConstrainedSketchGeometry objects, mirrors them about a selected line, and inserts them into the appropriate repositories of the ConstrainedSketch object.
Required arguments
A ConstrainedSketchGeometry object specifying the line about which Abaqus will mirror the sketch.
A sequence of ConstrainedSketchGeometry objects specifying the sketch to be copied and mirrored.
Optional arguments
Return value
Exceptions
This method creates copies of the given ConstrainedSketchGeometry objects, moves them from their original position, and inserts them into the appropriate repositories of the ConstrainedSketch object.
Required arguments
A sequence of two Floats specifying the translation vector.
A sequence of ConstrainedSketchGeometry objects to be copied and moved.
Optional arguments
Return value
Exceptions
This method creates copies of the given ConstrainedSketchGeometry objects, rotates them, and inserts them into the appropriate repositories of the ConstrainedSketch object.
Required arguments
A pair of Floats specifying the center of rotation.
A Float specifying the angle of rotation in degrees.
A sequence of ConstrainedSketchGeometry objects to be copied and moved.
Optional arguments
Return value
Exceptions
This method creates copies of the given ConstrainedSketchGeometry objects, scales them by the specified value about a selected point, and inserts them into the appropriate repositories of the ConstrainedSketch object.
Required arguments
A Float specifying the value for scaling.
A pair of Floats specifying the center of scaling.
A sequence of ConstrainedSketchGeometry objects to be copied and scaled.
Optional arguments
Return value
Exceptions
This method deletes the given ConstrainedSketchGeometry, ConstrainedSketchDimension, or ConstrainedSketchConstraint objects.
Required argument
A sequence of ConstrainedSketchGeometry, ConstrainedSketchDimension, or ConstrainedSketchConstraint objects to be deleted.
Optional arguments
Return value
Exceptions
The command deletes a specified parameter.
Required argument
A String specifying the name of the parameter to delete.
Optional arguments
Return value
Exceptions
This method drags a specified ConstrainedSketchGeometry or ConstrainedSketchVertex object to a specific location.
Required arguments
A ConstrainedSketchGeometry or ConstrainedSketchVertex object specifying the object to drag.
A sequence of sequences of three Floats specifying a sequence of points along which to drag the entity. The order of points in the sequence defines a path that determines the solution.
Optional arguments
Return value
Exceptions
This method copies ConstrainedSketchGeometry objects in a linear pattern along one or two directions. This method also copies any associated dimension or constraint objects that exist between the given objects.
Required arguments
An Integer specifying the total number of copies, including the original objects, that appear along the first direction in the pattern. Possible values are 1 number1 1000.
A Float specifying the spacing between copies along the first direction in the pattern. Possible values are 0.0 spacing1 .
A Float specifying the angle in degrees of the first direction in the pattern. Possible values are –360.0 angle1 360.0.
Optional arguments
A sequence of ConstrainedSketchVertex objects to copy.
A sequence of ConstrainedSketchGeometry objects to copy.
An integer specifying the total number of copies, including the original objects, that appear along the second direction in the pattern. Possible values are 1 number2 1000. The default value is 1. The value of either number1 or number2 must be greater than one.
A Float specifying the spacing between copies along the first direction in the pattern. Possible values are 0.0 spacing2. The default value is spacing1.
A Float specifying the angle in degrees of the first direction in the pattern. Possible values are –360.0 angle2 360.0. The default value is 90° beyond the value of angle1.
Return value
Exceptions
AbaqusException
This method merges the ConstrainedSketchVertex objects that lie within the specified distance of each other. If only one ConstrainedSketchVertex object is selected, it will merge all ConstrainedSketchVertex objects that lie within the specified distance of that vertex. If more than one vertex is selected, the search will be restricted to only the selected ConstrainedSketchVertex objects.
Required arguments
A Float specifying the search radius.
A sequence of ConstrainedSketchVertex objects to be merged.
Optional arguments
Return value
Exceptions
This method translates the given ConstrainedSketchGeometry objects by the given vector.
Required arguments
A sequence of two Floats specifying the translation vector.
A sequence of ConstrainedSketchGeometry objects specifying the objects to be translated.
Optional arguments
Return value
Exceptions
This method creates copies of the selected ConstrainedSketchGeometry objects, offsets them by the specified distance in the specified direction, and inserts them into the ConstrainedSketch object's appropriate repositories. If connected objects are selected, trim or extend is carried out to complete the offset.
Required arguments
A Float specifying the distance to be offset.
A sequence of ConstrainedSketchGeometry objects to be copied and offset.
A SymbolicConstant specifying which side the offset should occur. Possible values are LEFT and RIGHT.
Optional argument
A Boolean specifying whether the corners need to be rounded instead of being extended.
Return value
Exceptions
This method copies ConstrainedSketchGeometry objects in a radial pattern about a specified center point.
Required arguments
An Int specifying the total number of copies, including the original objects, that appear in the radial pattern. Possible values are 2 number2 1000.
A Float specifying the total angle in degrees between the first and last instance in the pattern. A positive angle corresponds to a counter-clockwise direction. The values 360° and -360° represent a special case where the pattern makes a full circle. In this case, because the copy would overlay the original, the copy is not placed at the last position. Possible values are –360.0 totalAngle 360.0.
A pair of Floats specifying the center of the radial pattern.
Optional arguments
A sequence of ConstrainedSketchVertex objects to copy.
A sequence of ConstrainedSketchGeometry objects to copy.
Return value
Exceptions
This method resets the view to be perpendicular to the sketching plane.
Arguments
Return value
Exceptions
This method creates four lines that form a rectangle with diagonal corners defined by the given points and inserts them into the geometry repository of the ConstrainedSketch object.
Required arguments
A pair of Floats specifying the first corner of the rectangle.
A pair of Floats specifying the second corner of the rectangle.
Optional arguments
Return value
An Int specifying the success or failure of the method. A value of 0 indicates failure.
Exceptions
This method removes gaps and overlaps between sketch geometries specified by the user. This method is particularly useful when cleaning up imported sketches
Required arguments
A float value which specifies the largest size of the gap or overlap between entities that is to be removed. Typically this value is small and is used to close gaps and overlaps which may not exist in the originating program but exist in the sketch because of mismatched tolerances between the two programs.
A sequence of ConstrainedSketchGeometry objects where the gaps and overlaps are to be removed.
Optional arguments
Return value
Exceptions
This method deletes the short edges specified, optionally selecting only those short edges whose lengths are smaller than the specified tolerance and healing the resultant gap in the sketch. This method is particularly useful in conjunction with removeGapsAndOverlap when cleaning up imported sketches.
Required argument
A sequence of ConstrainedSketchGeometry objects where the short edges are to be removed.
Optional argument
A float value that is used to select and delete only those edges specified in geomList whose lengths are smaller than the given value. The default value is –1.0. This value implies that all edges specified in geomList will be removed and the sketch healed to remove gaps left by their removal.
Return value
Exceptions
This method copies all ConstrainedSketchGeometry, ConstrainedSketchDimension, ConstrainedSketchConstraint, and ConstrainedSketchParameter objects from the specified ConstrainedSketch object. The new objects are added to the existing objects (if any). The objects in the specified ConstrainedSketch object are not modified by the retrieve operation.
Required argument
A ConstrainedSketch object specifying the object from which to copy.
Optional arguments
Return value
Exceptions
This method rotates the given ConstrainedSketchGeometry objects by the given angle and about the given point.
Required arguments
A pair of Floats specifying the center of rotation.
A Float specifying the angle of rotation in degrees.
A sequence of ConstrainedSketchGeometry specifying the objects to be rotated.
Optional arguments
Return value
Exceptions
This method scales the given ConstrainedSketchGeometry objects by the given scale factor and about the given point.
Required arguments
A Float specifying the value of scale.
A pair of Floats specifying the center of scale.
A sequence of ConstrainedSketchGeometry objects specifying the objects to be scaled.
Optional arguments
Return value
Exceptions
This method makes the ConstrainedSketch object the primary object in the current viewport. The sketch remains the primary object in the current viewport until an unsetPrimaryobject command is issued.
Required argument
A SymbolicConstant specifying how the sketch is displayed. Possible values are:
STANDALONE: Indicates a new stand-alone sketch. The current viewport is cleared and is replaced by the stand-alone sketch. The view direction is set to –.
SUPERIMPOSE: Indicates that the sketch is superimposed on the current viewport. The view direction is changed to be perpendicular to the sketch plane. The change is effected smoothly as an animated sequence of many small viewing steps.
Optional arguments
Return value
Exceptions
This method trims or extends a specified ConstrainedSketchGeometry object (curve1) using another specified ConstrainedSketchGeometry object (curve2). curve2 is not affected by the operation. The location for the trim or extend is determined by the specified point values.
Required arguments
The ConstrainedSketchGeometry object specifying the object to be trimmed or extended.
A pair of Floats specifying the location on curve1 where trim or extend should be applied.
The ConstrainedSketchGeometry object specifying the object to which curve1 is trimmed or extended. curve2 is not trimmed or extended.
A pair of Floats specifying the location on curve2 near where curve1 should be trimmed or extended.
Optional arguments
Return value
Exceptions
This method undoes the effects of the last ConstrainedSketch object method.
Arguments
Return value
Exceptions
This method removes the ConstrainedSketch object from the current viewport, reversing the effects of the setPrimaryobject command. If the option argument was set to SUPERIMPOSE, the viewport will be returned to the view orientation that was in place when the setPrimaryobject command was issued. If the option argument was set to STANDALONE, the viewport will be left empty.
Arguments
Return value
Exceptions
This method exports the geometry of the sketch to a named file in ACIS format.
Required argument
A String specifying the file name.
Optional argument
A Float specifying the ACIS version. For example, the Float “12.0” corresponds to ACIS Version 12.0. The default value is the current version of ACIS.
Return value
Exceptions
InvalidNameError.
This method exports the geometry of the sketch to a named file in IGES format.
Required argument
A String specifying the file name.
Optional argument
A SymbolicConstant specifying a particular flavor of IGES to export. Possible values areSTANDARD, AUTOCAD, SOLIDWORKS, JAMA, and MSBO.
Return value
Exceptions
InvalidNameError.
The ConstrainedSketch object can have the following members:
A repository of ConstrainedSketchConstraint objects.
A repository of ConstrainedSketchDimension objects.
A ConstrainedSketchGeometryArray object specifying the sketch geometry, such as lines, arcs, circles, and splines.
A repository of ConstrainedSketchParameter objects specifying sketch parameters, which may be associated with dimensions.
A ConstrainedSketchOptions object specifying the sketch option settings.
A ConstrainedSketchVertexArray object.
A ConstrainedSketchImageOptions object.