Public Member Functions | List of all members
SketchManager Class Reference

SketchManager Class
The commands in the SketchManager class are described below.
. More...

Public Member Functions

void BreakAtIntersection ()
 Breaks a sketch at an intersection.
 
void Connect2Lines ()
 Connects two basic shapes.
 
void Connect2LinesByPatternId (int pattern_id)
 Connects two basic shapes. This function is used when there are multiple patterns of connection. More...
 
void CreateChamfer (double length, double angle, bool reverse)
 Creates chamfering for basic shapes. More...
 
void CreateChamferByPatternId (double length, double angle, bool reverse, int pattern_id)
 Creates chamfering for basic shapes. This function is used when there are multiple creation patterns. More...
 
ConvertToRegionFilletCreateConvertToRegionFilletParameter ()
 Converts to the fillet feature. More...
 
void CreateFillet (double radius)
 Creates fillets for basic shapes. More...
 
void CreateFilletByPatternId (double radius, int pattern_id)
 Creates fillets for basic shapes. This function is used when there are multiple patterns of connection. More...
 
void DefineConstraints (String array &allowedTypes)
 Creates constraints from geometries. More...
 
void DeleteDuplication (double tolerance)
 Deletes multiple duplicated vertices to merge into one. More...
 
void Divide (int division, bool reverse_ratio, String array &ratio_list)
 Divides basic shapes. More...
 
void Execute (ParameterObject *param)
 Executes parameter.
 
void JointLine ()
 Creates joints for basic shapes.
 
void MergeLines ()
 Merges basic shapes.
 
void MirrorCopy (double x, double y, double angle, bool keep_constraints)
 Creates mirror copies of a basic shape by defining an axis of symmetry. More...
 
void Move (double x, double y, bool keep_constraints)
 Moves the sketch in a parallel direction by specifying a distance in displacement. More...
 
void ParallelCopy (double x, double y, int instance, bool keep_constraints)
 Creates parallel copies of basic shape by specifying position of a copy destination. More...
 
void ParallelLines (double distance, bool reverse)
 Specifies a distance, and then creates a parallel line from the selected line. More...
 
void Rotate (double x, double y, double angle, bool keep_constraints)
 Moves the sketch in a rotational direction by specifying an angle in displacement. More...
 
void RotateCopy (double x, double y, double angle, int instance, bool keep_constraints)
 Creates rotation copy of basic shape by defining center of rotation. More...
 
void Scale (double xFactor, double yFactor, double xCenter, double yCenter, bool keep_constraints)
 Enlarges or shrinks basic shapes. More...
 
void SketchTrim (double x, double y)
 Trims sketches. More...
 
void TangentLine ()
 Creates a line connecting the selected vertex and circle (or arc).
 
void VerticalLine ()
 Creates a vertical line connecting the selected vertex and line.
 

Detailed Description

SketchManager Class
The commands in the SketchManager class are described below.
.

The SketchManager class includes the commands for the following operation.

Member Function Documentation

void SketchManager::Connect2LinesByPatternId ( int  pattern_id)

Connects two basic shapes. This function is used when there are multiple patterns of connection.

Parameters
pattern_idConnection pattern ID
void SketchManager::CreateChamfer ( double  length,
double  angle,
bool  reverse 
)

Creates chamfering for basic shapes.

Parameters
lengthLength
angleAngle
reverse
True=on : Reverse
False=off : Do not reverse
void SketchManager::CreateChamferByPatternId ( double  length,
double  angle,
bool  reverse,
int  pattern_id 
)

Creates chamfering for basic shapes. This function is used when there are multiple creation patterns.

Parameters
lengthLength
angleAngle
reverse
True=on : Reverse
False=off : Do not reverse
pattern_idConnection pattern ID
ConvertToRegionFillet * SketchManager::CreateConvertToRegionFilletParameter ( )

Converts to the fillet feature.

Returns
Object for convert to fillet feature

For more information about ConvertToRegionFillet, see " ConvertToRegionFillet ".

void SketchManager::CreateFillet ( double  radius)

Creates fillets for basic shapes.

Parameters
radiusFillet radius
void SketchManager::CreateFilletByPatternId ( double  radius,
int  pattern_id 
)

Creates fillets for basic shapes. This function is used when there are multiple patterns of connection.

Parameters
radiusFillet radius
pattern_idConnection pattern ID
void SketchManager::DefineConstraints ( String array &  allowedTypes)

Creates constraints from geometries.

Parameters
allowedTypes
Types of constraints
"distance" : Distance
"angle" : Angle
"radius" : Radius/Diameter
"fixture" : Fixation
"horizontality" : Horizontality
"verticality" : Verticality
"parallelism" : Parallel
"perpendicularity" : Perpendicular
"concentricity" : Concentric circle
"tangency" : Tangent circle
"coincident" : Coincident

The following example displays how to transfer string array using commands.

Applying distance constraint and fixation constraint
Set app=designer
Set geomApp = app.CreateGeometryEditor()
ReDim refarray(2)
refarray(0) = "distance"
refarray(1) = "fixation"
Call geomApp.GetDocument().GetSketchManager().DefineConstraints(refarray)
  • The "DefineConstraints" command is run on all shapes that are being edited when the command to select geometries is not described before "DefineConstraints."
void SketchManager::DeleteDuplication ( double  tolerance)

Deletes multiple duplicated vertices to merge into one.

Parameters
toleranceTolerance
void SketchManager::Divide ( int  division,
bool  reverse_ratio,
String array &  ratio_list 
)

Divides basic shapes.

Parameters
divisionNumber of divisions
reverse_ratio
True=on : Reverse direction of the division ratio
False=off : Do not reverse direction of the division ratio
ratio_listDivision ratio list
void SketchManager::MirrorCopy ( double  x,
double  y,
double  angle,
bool  keep_constraints 
)

Creates mirror copies of a basic shape by defining an axis of symmetry.

Parameters
xX-coordinate of center point of axis
yY-coordinate of center point of axis
angleAxis direction angle (X-coordinate)
keep_constraints
True=1 : Keep constraints
False=0 : Do not keep constraints
void SketchManager::Move ( double  x,
double  y,
bool  keep_constraints 
)

Moves the sketch in a parallel direction by specifying a distance in displacement.

Parameters
xDisplacement in X-direction
yDisplacement in Y-direction
keep_constraints
True=1 : Keep constraints
False=0 : Do not keep constraints
void SketchManager::ParallelCopy ( double  x,
double  y,
int  instance,
bool  keep_constraints 
)

Creates parallel copies of basic shape by specifying position of a copy destination.

Parameters
xDisplacement of X-direction per instance
yDisplacement of Y-direction per instance
instanceNumber of instance
keep_constraints
True=1 : Keep constraints
False=0 : Do not keep constraints
void SketchManager::ParallelLines ( double  distance,
bool  reverse 
)

Specifies a distance, and then creates a parallel line from the selected line.

Parameters
distanceDistance
reverse
True=1 : Reverses the position to create a parallel.
False=0 : Do not reverse the position to create a parallel.

The right side is the true direction of the line based on the start and end point for the position to create a parallel.

void SketchManager::Rotate ( double  x,
double  y,
double  angle,
bool  keep_constraints 
)

Moves the sketch in a rotational direction by specifying an angle in displacement.

Parameters
xCenter of rotation in X coordinate
yCenter of rotation in Y coordinate
angleAngle
keep_constraints
True=1 : Keep constraints
False=0 : Do not keep constraints
void SketchManager::RotateCopy ( double  x,
double  y,
double  angle,
int  instance,
bool  keep_constraints 
)

Creates rotation copy of basic shape by defining center of rotation.

Parameters
xRotation center of X-coordinate of rotation center
yRotation center of Y-coordinate of rotation center
angleAngle
instanceNumber of instance
keep_constraints
True=1 : Keep constraints
False=0 : Do not keep constraints
void SketchManager::Scale ( double  xFactor,
double  yFactor,
double  xCenter,
double  yCenter,
bool  keep_constraints 
)

Enlarges or shrinks basic shapes.

Parameters
xFactorFactor of X-axis direction
yFactorFactor of Y-axis direction
xCenterX-coordinate of center point of the scale
yCenterY-coordinate of center point of the scale
keep_constraints
True=1 : Keep constraints
False=0 : Do not keep constraints
void SketchManager::SketchTrim ( double  x,
double  y 
)

Trims sketches.

Parameters
xLine (circle, arc, or spline) is trimmed on a point on X coordinate
yLine (circle, arc, or spline) is trimmed on a point on Y coordinate

The value for X and Y coordinates are specified when the pointer is clicked on a position for a target in the work plane.