sketcher journaling preface basic tasks glossary indexdunet.nicolas.free.fr/catiav5/dysjg.pdfpreface...
TRANSCRIPT
Sketcher Journaling
Preface
Basic Tasks
Glossary
Index
© Dassault Systèmes 1994-2000. All rights reserved.
PrefaceThe CATIA - Sketcher Journaling Guide has been designed to show you how to create sketchstarting from a CATIA script document. This book aims at illustrating the several stages ofcreation you may encounter.
The information contained in this guide is specific to Version 5 Release 5 of the CATIA -Sketcher workbench, which operates in a WINDOWS or UNIX workstation environment underthe AIX, IRIX, SUN OS and HP-UX operating system.
Basic Tasks
CATPart DocumentSketcher Profiles
Transformation ProfilesSketcher Basics
Sketcher Constraints
CATPart Document
New CATPartOpen CATPart
Create a CATPart DocumentDefinitionCreates a new part.Note the reference planes and the part body are implicitly created, see Part Properties and PartBody to retrieve them.
Methods
Documents.Add
Creates a document object and adds it to the documents collection.This document becomes the active one, and a window is created to accomodate it whichbecomes the active window.Syntax
Documents.Add ( iDocType ) as DocumentiDocType as String
The type of the document to be created, here a CATPart.= "Part"
ExampleCATIA.Documents.Add ( "Part" )
Running The MacroOpen CATIA.1. Load the CreateCATPart1.CATScript macro.2. Run the macro.3.
Open a CATPart DocumentDefinitionOpen an existing part.
Methods
Documents.Open
Opens and reads a document stored in a file, displays it in a new window, adds the document tothe documents collection and the window to the windows collection, and makes both thedocument and the window the active ones.Syntax
Documents.Add ( iFileName ) as DocumentiFileName as String
The string containing the document name and path to be opened. Example
CATIA.Documents.Open ( "C:\PartDirectory\UserPart.CATPart" )
Running The MacroOpen CATIA.1. Check in OpenCATPart1.CATScript the path to the Sketcher Journaling Guide directorysample.
2.
Load the OpenCATPart1.CATScript macro.3. Run the macro.4.
CATPart Document
ProfileRectangle
Oriented RectangleParallelogram
Elongated HoleCylindrical Elongated Hole
KeyholeHexagon
CircleThree Points Circle
Circle Using CoordinatesTritangent CircleThree Points Arc
Three Points Arc Starting With LimitsArc of Circle
SplineEllipse
ParabolaHyperbola
Creates a ConicLine
Bitangent LinePoint by Clicking
PointEquidistant Points
ProfileDefinitionA profile combines Point, Line, Circle and Constraints methods and properties, and there are nodedicated methods or properties to manage it.
RectangleDefinitionA rectangle combines Point, Line and Constraints methods and properties, and there are nodedicated methods or properties to manage it.
Oriented RectangleDefinitionAn oriented rectangle combines Point, Line and Constraints methods and properties, and thereare no dedicated methods or properties to manage it.
ParallelogramDefinitionA parallelogram combines Point, Line and Constraints methods and properties, and there are nodedicated methods or properties to manage it.
Elongated HoleDefinitionAn elongated hole combines Point, Line, Circle and Constraints methods and properties, andthere are no dedicated methods or properties to manage it.
Cylindrical Elongated HoleDefinitionA cylindrical elongated hole combines Point, Circle and Constraints methods and properties, andthere are no dedicated methods or properties to manage it.
KeyholeDefinitionA keyhole combines Point, Line, Circle and Constraints methods and properties, and there areno dedicated methods or properties to manage it.
HexagonDefinitionA hexagon combines Point, Line and Constraints methods and properties, and there are nodedicated methods or properties to manage it.
CircleDefinitionA circle is created from its center, start and end points, according to the horizontal axis (H) andthe vertical axis (V) of the sketch.A circle in a sketch is named 2D circle according to the 2D space.
Methods
CreateCircle
Creates a new 2D circle within the 2D Factory of the sketch beeing edited.Syntax
CreateCircle ( iHCenter, iVCenter, iRadius, iStartParameter, iEndParameter ) as Circle2DiHCenter as Double
The 2D circle center coordinate along the horizontal axis.iVCenter as Double
The 2D circle center coordinate along the vertical axis.iRadius as Double
The 2D circle radius.iStartParameter as Double
The start parameter is an angle value between 0 included and 2PI excluded, defined fromthe horizontal axis.
iEndParameter as DoubleThe end parameter is an angle value between iStartParameter excluded and 4PI included,defined from the horizontal axis.
ExampleSet UserCircle2D = UserFactory2D.CreateCircle ( 0.000000, 0.000000, 10.000000,0.000000, 3.141593 )
CreateClosedCircle
Creates a new 2D circle within the 2D Factory of the sketch beeing edited.Syntax
CreateClosedCircle ( iHCenter, iVCenter, iRadius ) as Circle2DiHCenter as Double
The 2D circle center coordinate along the horizontal axis.iVCenter as Double
The 2D circle center coordinate along the vertical axis.iRadius as Double
The 2D circle radius.Example
Set UserCircle2D = UserFactory2D.CreateClosedCircle ( 0.000000, 0.000000, 10.000000)
GetCenter
Gets the 2D circle center coordinates.Syntax
GetCenter ( oCenter ) oCenter as Double
A safe array with two elements:oCenter ( 0 ) the center coordinate along the horizontal axis,oCenter ( 1 ) the center coordinate along the vertical axis,The array must be previously initialized.
ExampleDim Center ( 1 ) As DoubleDim h, v As Double
UserCircle2D.GetCenter ( Center )
h = Center ( 0 )v = Center ( 1 )
GetCurvature
Gets the 2D circle curvature and curvature direction unit vector for a specified parameter.Syntax
GetCurvature iParameter, oCurvatureiParameter as Double
The parameter.oCurvature as Double
A safe array with three elements:oCurvature ( 0 ) the curvature,oCurvature ( 1 ) the unit vector coordinate along the horizontal axis,oCurvature ( 2 ) the unit vector coordinate along the vertical axis,The array must be previously initialized.
ExampleDim Curvature ( 2 ) As DoubleDim c, hc, vc As Double
UserCircle2D.GetCurvature 1.000000, Curvature
c = Curvature ( 0 )hc = Curvature ( 1 )vc = Curvature ( 2 )
GetDerivatives
Gets the 2D circle first, second and third derivatives for a specified parameter.Syntax
GetDerivatives iParameter, oDerivativeiParameter as Double
The parameter.oDerivative as Double
A safe array with six elements :oDerivative ( 0 ) the first derivative vector coordinate along the horizontal axis,oDerivative ( 1 ) the first derivative vector coordinate along the vertical axis,oDerivative ( 2 ) the second derivative vector coordinate along the horizontal axis,oDerivative ( 3 ) the second derivative vector coordinate along the vertical axis,oDerivative ( 4 ) the third derivative vector coordinate along the horizontal axis,oDerivative ( 5 ) the third derivative vector coordinate along the vertical axis,The array must be previously initialized.
ExampleDim Derivative ( 5 ) As DoubleDim hfd, vfd, hsd, vsd, htd, vtd As Double
UserCircle2D.GetDerivatives 1.000000, Derivative
hfd = Derivative ( 0 )vfd = Derivative ( 1 )hsd = Derivative ( 2 )vsd = Derivative ( 3 )htd = Derivative ( 4 )vtd = Derivative ( 5 )
GetEndPoints
Gets the 2D circle start and end point coordinates.Syntax
GetEndPoints ( oEndPoints )oEndPoints as Double
A safe array with four elements :oEndPoints ( 0 ) the start point coordinate along the horizontal axis,oEndPoints ( 1 ) the start point coordinate along the vertical axis,oEndPoints ( 2 ) the end point coordinate along the horizontal axis,oEndPoints ( 3 ) the end point coordinate along the vertical axis,
The array must be previously initialized.Example
Dim EndPoints ( 3 ) As DoubleDim hsp, vsp, hep, ved As Double
UserCircle2D.GetEndPoints ( EndPoints )
hsp = EndPoints( 0 )vsp = EndPoints( 1 )hep = EndPoints( 2 )ved = EndPoints ( 3 )
GetLengthAtParam
Gets the 2D circle length between two parameters.Syntax
GetLengthAtParam ( iFirstParameter, iSecondParameter ) as DoubleiFirstParameter as Double
The first parameter.iSecondParameter as Double
The second parameter.Example
CircleLength = UserCircle2D.GetLengthAtParam ( 1.000000, 2.000000 )
GetParamAtLength
Gets a 2D circle parameter from a parameter and the length between them.Syntax
GetParamAtLength ( iParameter, iLength ) as DoubleiParameter as Double
The parameter.iLength as Double
The length.Example
CircleParameter = UserCircle2D.GetParamAtLength ( 1.000000, 10.000000 )
GetParamExtents
Gets the 2D circle start and end point parameters.Syntax
GetParamExtents ( oParameters )oParameters as Double
A safe array with two elements :
oParameters ( 0 ) the start point parameter,oParameters ( 1 ) the end point parameter,The array must be previously initialized.
ExampleDim Parameters ( 1 ) As DoubleDim spp, epp As Double
UserCircle2D.GetParamExtents ( Parameters )
spp = Parameters ( 0 )epp = Parameters ( 1 )
GetPointAtParam
Gets the 2D circle point for a specified parameter.Syntax
GetPointAtParam iParameter, oPointiParameter as Double
The parameter.oPoint as Double
A safe array with two elements :oPoint ( 0 ) the point coordinate along the horizontal axis,oPoint ( 1 ) the point coordinate along the vertical axis,The array must be previously initialized.
ExampleDim Point ( 1 ) As DoubleDim hp, vp As Double
UserCircle2D.GetPointAtParam 1.000000, Point
hp = Point ( 0 )vp = Point ( 1 )
GetRangeBox
Gets the 2D circle points of its bounding box.Syntax
GetRangeBox ( oBoundingPoint )oBoundingPoint as Double
A safe array with four elements :oBoundingPoint ( 0 ) the minimum point coordinate along the horizontal axis,oBoundingPoint ( 1 ) the minimum point coordinate along the vertical axis,oBoundingPoint ( 2 ) the maximum point coordinate along the horizontal axis,oBoundingPoint ( 3 ) the maximum point coordinate along the vertical axis,The array must be previously initialized.
ExampleDim BoundingPoint ( 3 ) As DoubleDim hmin, vmin, hmax, vmax As Double
UserCircle2D.GetRangeBox ( BoundingPoint )
hmin = BoundingPoint ( 0 )vmin = BoundingPoint ( 1 )hmax = BoundingPoint ( 2 )vmax = BoundingPoint ( 3 )
GetTangent
Gets the 2D circle tangent direction unit vector for a specified parameter.Syntax
GetTangent iParameter, oTangentiParameter as Double
The parameter.oTangent as Double
A safe array with two elements :oCurvature ( 0 ) the unit vector coordinate along the horizontal axis,oCurvature ( 1 ) the unit vector coordinate along the vertical axis,The array must be previously initialized.
ExampleDim Tangent ( 2 ) As DoubleDim ht, vt As Double
UserCircle2D.GetTangent 1.000000, Tangent
ht = Tangent ( 0 )vt = Tangent ( 1 )
IsPeriodic
Gets the 2D circle periodicity.Syntax
IsPeriodic as Boolean= True, the circle is periodic.= False, the circle is not periodic.
ExampleUserCircle2D.IsPeriodic
SetData
Sets the 2D circle center point and radius.
SyntaxSetData iHCenter, iVCenter, iRadius
iHCenter as DoubleThe 2D circle center coordinate along the horizontal axis.
iVCenter as DoubleThe 2D circle center coordinate along the vertical axis.
iRadius as DoubleThe 2D circle radius.
ExampleUserCircle2D.SetData 0.00000, 0.00000, 10.000000
Properties
CenterPoint
Gets the 2D circle center point.Syntax
CenterPoint as Point2DExample
UserCircleCenterPoint = UserCircle2D.CenterPoint
Circle2D
Dimensions an object as circle in 2D space.Example
Dim UserCircle2D as Circle2D
Construction
Gets or sets the construction mode of the 2D circle.Syntax
Construction as Boolean= True, indicates that the circle is defined as construction 2D circle.= False, indicates that the circle is defined as standard 2D circle.
ExampleCircle2DConstructionMode = UserCircle2D.ConstructionUserCircle2D.Construction = True
Continuity
Gets the geometric continuity highest level of the 2D circle.
SyntaxContinuity as Short
ExampleCircleContinuity = UserCircle2D.Continuity
EndPoint
Gets or sets the end point of the 2D circle.Syntax
EndPoint as Point2DExample
CircleEndPoint = UserCircle2D.EndPointUserCircle2D.EndPoint = UserPoint2D
GeometricType
Gets the type of the geometrical element.Syntax
GeometricType as Long= 5, indicates that the geometrical element is a 2D circle.
ExampleGeometricalElementType = UserCircle2D.GeometricType
Period
Gets the period of the 2D circle.Syntax
Period as DoubleExample
CirclePeriod = UserCircle2D.Period
Radius
Gets the 2D circle radius.Syntax
Radius as DoubleExample
UserCircleRadius = UserCircle2D.Radius
ReportName
Gets or sets the report name of the 2D circle.This label is used to define the BRep element identifier.
SyntaxReportName as LongThe label of the report name
ExampleCircle2DReportName = UserCircle2D.ReportNameUserCircle2D.ReportName = 15
StartPoint
Gets or sets the start point of the 2D circle.Syntax
StartPoint as Point2DExample
CircleStartPoint = UserCircle2D.StartPointUserCircle2D.StartPoint = UserPoint2D
Running The MacroOpen the Circle1.CATPart document.1.
Load the Circle1.CATScript macro.2. Run the macro.3.
Three Points CircleDefinitionA three point circle combines Point, Circle and Constraints methods and properties, and thereare no dedicated methods or properties to manage it.
Circle Using CoordinatesDefinitionA circle using coordinates combines Point, Circle and Constraints methods and properties, andthere are no dedicated methods or properties to manage it.
Tritangent CircleDefinitionA tritangent circle combines Point, Circle and Constraints methods and properties, and there areno dedicated methods or properties to manage it.
Three Points ArcDefinitionA three points arc combines Point, Circle and Constraints methods and properties, and there areno dedicated methods or properties to manage it.
Three Points Arc Starting With LimitsDefinitionA three points arc starting with limits combines Point, Circle and Constraints methods andproperties, and there are no dedicated methods or properties to manage it.
Arc of CircleDefinitionA arc combines Point, Circle and Constraints methods and properties, and there are nodedicated methods or properties to manage it.
SplineDefinitionA spline is created from a set of control points, themselves created from their coordinates according tothe horizontal axis (H) and the vertical axis (V) of the sketch.A spline in a sketch is named 2D spline and a control point in a sketch is named 2D control pointaccording to the 2D space.
Methods
CreateControlPoint
Creates a new 2D control point within the 2D Factory of the sketch beeing edited.Syntax
CreateControlPoint ( iH, iV ) as ControlPoint2DiH as Double
The control point coordinate along the horizontal axis.iV as Double
The control point coordinate along the vertical axis.Example
Set UserControlPoint2D = UserFactory2D.CreateControlPoint ( 80.000000, 30.000000 )
CreateSpline
Creates a new 2D spline within the 2D Factory of the sketch beeing edited.Syntax
CreateSpline ( iControlPoints ) as Spline2DiControlPoints as ControlPoint2D
A safe array containing all 2D control points to build the 2D spline:iControlPoints ( i ) a 2D control points,The array must be previously initialized
ExampleDim UserControlPoints ( 2 ) As ControlPoint2D
Set UserControlPoints ( 0 ) = FirstControlPoint2DSet UserControlPoints ( 1 ) = SecondControlPoint2DSet UserControlPoints ( 2 ) = ThirdControlPoint2DSet UserSpline2D = UserFactory2D.CreateSpline ( UserControlPoints )
GetControlPoints
Gets the 2D spline 2D control points.
SyntaxGetControlPoints ( oControlPoints )
oControlPoints as ControlPoint2DA safe array containing all the 2D spline 2D control points:oControlPoints ( i ) a 2D control points,The array must be previously initialized.
ExampleDim UserControlPoints ( 2 ) As Double
UserSpline2D.GetControlPoints ( UserControlPoints )
GetCoordinates
Gets the control point coordinates.Syntax
GetCoordinates ( oControlPoint ) oControlPoint as Double
A safe array with two elements:oControlPoint ( 0 ) the point coordinate along the horizontal axis,oControlPoint ( 1 ) the point coordinate along the vertical axis,The array must be previously initialized.
ExampleDim ControlPoint ( 1 ) As DoubleDim h, v As Double
UserControlPoint2D.GetCoordinates ( Control Point )
h = Control Point ( 0 )v = Control Point ( 1 )
GetCurvature
Gets the 2D spline curvature and curvature direction unit vector for a specified parameter.Syntax
GetCurvature iParameter, oCurvatureiParameter as Double
The parameter.oCurvature as Double
A safe array with three elements:oCurvature ( 0 ) the curvature,oCurvature ( 1 ) the unit vector coordinate along the horizontal axis,oCurvature ( 2 ) the unit vector coordinate along the vertical axis,The array must be previously initialized.
ExampleDim Curvature ( 2 ) As DoubleDim c, hc, vc As Double
UserSpline2D.GetCurvature 1.000000, Curvature
c = Curvature ( 0 )hc = Curvature ( 1 )vc = Curvature ( 2 )
GetDerivatives
Gets the 2D spline first, second and third derivatives for a specified parameter.Syntax
GetDerivatives iParameter, oDerivativeiParameter as Double
The parameter.oDerivative as Double
A safe array with six elements :oDerivative ( 0 ) the first derivative vector coordinate along the horizontal axis,oDerivative ( 1 ) the first derivative vector coordinate along the vertical axis,oDerivative ( 2 ) the second derivative vector coordinate along the horizontal axis,oDerivative ( 3 ) the second derivative vector coordinate along the vertical axis,oDerivative ( 4 ) the third derivative vector coordinate along the horizontal axis,oDerivative ( 5 ) the third derivative vector coordinate along the vertical axis,The array must be previously initialized.
ExampleDim Derivative ( 5 ) As DoubleDim hfd, vfd, hsd, vsd, htd, vtd As Double
UserSpline2D.GetDerivatives 1.000000, Derivative
hfd = Derivative ( 0 )vfd = Derivative ( 1 )hsd = Derivative ( 2 )vsd = Derivative ( 3 )htd = Derivative ( 4 )vtd = Derivative ( 5 )
GetEndPoints
Gets the 2D spline start and end point coordinates.Syntax
GetEndPoints ( oEndPoints )oEndPoints as Double
A safe array with four elements :oEndPoints ( 0 ) the start point coordinate along the horizontal axis,oEndPoints ( 1 ) the start point coordinate along the vertical axis,oEndPoints ( 2 ) the end point coordinate along the horizontal axis,oEndPoints ( 3 ) the end point coordinate along the vertical axis,The array must be previously initialized.
ExampleDim EndPoints ( 3 ) As DoubleDim hsp, vsp, hep, ved As Double
UserSpline2D.GetEndPoints ( EndPoints )
hsp = EndPoints( 0 )vsp = EndPoints( 1 )hep = EndPoints( 2 )ved = EndPoints ( 3 )
GetLengthAtParam
Gets the 2D spline length between two parameters.Syntax
GetLengthAtParam ( iFirstParameter, iSecondParameter ) as DoubleiFirstParameter as Double
The first parameter.iSecondParameter as Double
The second parameter.Example
SplineLength = UserSpline2D.GetLengthAtParam ( 1.000000, 2.000000 )
GetParamAtLength
Gets a 2D spline parameter from a parameter and the length between them.Syntax
GetParamAtLength ( iParameter, iLength ) as DoubleiParameter as Double
The parameter.iLength as Double
The length.Example
SplineParameter = UserSpline2D.GetParamAtLength ( 1.000000, 10.000000 )
GetParamExtents
Gets the 2D spline start and end point parameters.Syntax
GetParamExtents ( oParameters )oParameters as Double
A safe array with two elements :oParameters ( 0 ) the start point parameter,oParameters ( 1 ) the end point parameter,The array must be previously initialized.
Example
Dim Parameters ( 1 ) As DoubleDim spp, epp As Double
UserSpline2D.GetParamExtents ( Parameters )
spp = Parameters ( 0 )epp = Parameters ( 1 )
GetPointAtParam
Gets the 2D spline point for a specified parameter.Syntax
GetPointAtParam iParameter, oPointiParameter as Double
The parameter.oPoint as Double
A safe array with two elements :oPoint ( 0 ) the point coordinate along the horizontal axis,oPoint ( 1 ) the point coordinate along the vertical axis,The array must be previously initialized.
ExampleDim Point ( 1 ) As DoubleDim hp, vp As Double
UserSpline2D.GetPointAtParam 1.000000, Point
hp = Point ( 0 )vp = Point ( 1 )
GetRangeBox
Gets the 2D spline points of its bounding box.Syntax
GetRangeBox ( oBoundingPoint )oBoundingPoint as Double
A safe array with four elements :oBoundingPoint ( 0 ) the minimum point coordinate along the horizontal axis,oBoundingPoint ( 1 ) the minimum point coordinate along the vertical axis,oBoundingPoint ( 2 ) the maximum point coordinate along the horizontal axis,oBoundingPoint ( 3 ) the maximum point coordinate along the vertical axis,The array must be previously initialized.
ExampleDim BoundingPoint ( 3 ) As DoubleDim hmin, vmin, hmax, vmax As Double
UserSpline2D.GetRangeBox ( BoundingPoint )
hmin = BoundingPoint ( 0 )vmin = BoundingPoint ( 1 )hmax = BoundingPoint ( 2 )vmax = BoundingPoint ( 3 )
GetTangent
Gets the 2D spline tangent direction unit vector for a specified parameter.Syntax
GetTangent iParameter, oTangentiParameter as Double
The parameter.oTangent as Double
A safe array with two elements :oCurvature ( 0 ) the unit vector coordinate along the horizontal axis,oCurvature ( 1 ) the unit vector coordinate along the vertical axis,The array must be previously initialized.
ExampleDim Tangent ( 2 ) As DoubleDim ht, vt As Double
UserSpline2D.GetTangent 1.000000, Tangent
ht = Tangent ( 0 )vt = Tangent ( 1 )
IsPeriodic
Gets the 2D spline periodicity.Syntax
IsPeriodic as Boolean= True, the spline is periodic.= False, the spline is not periodic.
ExampleUserSpline2D.IsPeriodic
SetData
Sets the control point coordinates.Syntax
SetData iH, iViH as Double
The point coordinate along the horizontal axis.iV as Double
The point coordinate along the vertical axis.Example
UserControlPoint2D.SetData 10.00000, 10.00000
Properties
Construction
Gets or sets the construction mode of the 2D spline or 2D control point.Syntax
Construction as Boolean= True, indicates that the spline is defined as construction 2D spline.= False, indicates that the spline is defined as standard 2D spline.
ExampleSpline2DConstructionMode = UserSpline2D.ConstructionUserSpline2D.Construction = TruePoint2DConstructionMode = UserControlPoint2D.ConstructionUserControlPoint2D.Construction = True
GeometricType
Gets the type of the geometrical element.Syntax
GeometricType as Long= 9, indicates that the geometrical element is a 2D spline.= 2, indicates that the geometrical element is a point in 2D space.
ExampleGeometricalElementType = UserSpline2D.GeometricType
GeometricalElementType = UserControlPoint2D.GeometricType
Continuity
Gets the geometric continuity highest level of the 2D spline.Syntax
Continuity as ShortExample
SplineContinuity = UserSpline2D.Continuity
ControlPoint2D
Dimensions an object as control point in 2D space.Example
Dim UserControlPoint2D as ControlPoint2D
EndPoint
Gets or sets the end point of the 2D spline.
SyntaxEndPoint as Point2D
ExampleSplineEndPoint = UserSpline2D.EndPointUserSpline2D.EndPoint = UserPoint2D
Period
Gets the period of the 2D spline.Syntax
Period as DoubleExample
SplinePeriod = UserSpline2D.Period
ReportName
Gets or sets the report name of the 2D spline or 2D control point.This label is used to define the BRep element identifier.Syntax
ReportName as LongThe label of the report name
ExampleSpline2DReportName = UserSpline2D.ReportNameUserSpline2D.ReportName = 15
Point2DReportName = UserControlPoint2D.ReportNameUserControlPoint2D.ReportName = 16
Spline2D
Dimensions an object as spline in 2D space.Example
Dim UserSpline2D as Spline2D
StartPoint
Gets or sets the start point of the 2D spline.Syntax
StartPoint as Point2DExample
SplineStartPoint = UserSpline2D.StartPointUserSpline2D.StartPoint = UserPoint2D
Running The MacroOpen the Spline1.CATPart document.1.
Load the Spline1.CATScript macro.2. Run the macro.3.
EllipseDefinitionAn ellipse is created from its center point, major axis, major and minor radius, according to thehorizontal axis (H) and the vertical axis (V) of the sketch.An ellipse in a sketch is named 2D ellipse according to the 2D space.
Methods
CreateClosedEllipse
Creates a new 2D ellipse within the 2D Factory of the sketch beeing edited.Syntax
CreateClosedEllipse ( iHCenter, iVCenter, iHMajor, iVMajor, iMajorRadius, iMinorRadius )as Ellipse2D
iHCenter as DoubleThe 2D ellipse center coordinate along the horizontal axis.
iVCenter as DoubleThe 2D ellipse center coordinate along the vertical axis.
iHMajor as DoubleThe 2D ellipse major axis direction coordinate along the horizontal axis.
iVMajor as DoubleThe 2D ellipse major axis direction coordinate along the vertical axis.
iMajorRadius as DoubleThe 2D ellipse major radius.
iMinorRadius as DoubleThe 2D ellipse minor radius.
ExampleSet UserEllipse2D = UserFactory2D.CreateClosedEllipse ( 0.000000, 0.000000, 1.000000,0.000000, 10.000000, 5.000000 )
CreateEllipse
Creates a new 2D ellipse within the 2D Factory of the sketch beeing edited.Syntax
CreateEllipse ( iHCenter, iVCenter, iHMajor, iVMajor, iMajorRadius, iMinorRadius,iStartParameter, iEndParameter ) as Ellipse2D
iHCenter as Double
The 2D ellipse center coordinate along the horizontal axis.iVCenter as Double
The 2D ellipse center coordinate along the vertical axis.iHMajor as Double
The 2D ellipse major axis direction coordinate along the horizontal axis.iVMajor as Double
The 2D ellipse major axis direction coordinate along the vertical axis.iMajorRadius as Double
The 2D ellipse major radius.iMinorRadius as Double
The 2D ellipse minor radius.iStartParameter as Double
The start parameter is an angle value between 0 included and 2PI excluded, defined fromthe horizontal axis.
iEndParameter as DoubleThe end parameter is an angle value between iStartParameter excluded and 4PI included,defined from the horizontal axis.
ExampleSet UserEllipse2D = UserFactory2D.CreateEllipse ( 0.000000, 0.000000, 10.000000,0.000000, 10.000000, 5.000000, 0.000000, 3.141593 )
GetCenter
Gets the 2D ellipse center coordinates.Syntax
GetCenter ( oCenter ) oCenter as Double
A safe array with two elements:oCenter ( 0 ) the center coordinate along the horizontal axis,oCenter ( 1 ) the center coordinate along the vertical axis,The array must be previously initialized.
ExampleDim Center ( 1 ) As DoubleDim h, v As Double
UserEllipse2D.GetCenter ( Center )
h = Center ( 0 )v = Center ( 1 )
GetCurvature
Gets the 2D ellipse curvature and curvature direction unit vector for a specified parameter.
SyntaxGetCurvature iParameter, oCurvature
iParameter as DoubleThe parameter.
oCurvature as DoubleA safe array with three elements:oCurvature ( 0 ) the curvature,oCurvature ( 1 ) the unit vector coordinate along the horizontal axis,oCurvature ( 2 ) the unit vector coordinate along the vertical axis,The array must be previously initialized.
ExampleDim Curvature ( 2 ) As DoubleDim c, hc, vc As Double
UserEllipse2D.GetCurvature 1.000000, Curvature
c = Curvature ( 0 )hc = Curvature ( 1 )vc = Curvature ( 2 )
GetDerivatives
Gets the 2D ellipse first, second and third derivatives for a specified parameter.Syntax
GetDerivatives iParameter, oDerivativeiParameter as Double
The parameter.oDerivative as Double
A safe array with six elements :oDerivative ( 0 ) the first derivative vector coordinate along the horizontal axis,oDerivative ( 1 ) the first derivative vector coordinate along the vertical axis,oDerivative ( 2 ) the second derivative vector coordinate along the horizontal axis,oDerivative ( 3 ) the second derivative vector coordinate along the vertical axis,oDerivative ( 4 ) the third derivative vector coordinate along the horizontal axis,oDerivative ( 5 ) the third derivative vector coordinate along the vertical axis,The array must be previously initialized.
ExampleDim Derivative ( 5 ) As DoubleDim hfd, vfd, hsd, vsd, htd, vtd As Double
UserEllipse2D.GetDerivatives 1.000000, Derivative
hfd = Derivative ( 0 )vfd = Derivative ( 1 )
hsd = Derivative ( 2 )vsd = Derivative ( 3 )htd = Derivative ( 4 )vtd = Derivative ( 5 )
GetEndPoints
Gets the 2D ellipse start and end point coordinates.Syntax
GetEndPoints ( oEndPoints )oEndPoints as Double
A safe array with four elements :oEndPoints ( 0 ) the start point coordinate along the horizontal axis,oEndPoints ( 1 ) the start point coordinate along the vertical axis,oEndPoints ( 2 ) the end point coordinate along the horizontal axis,oEndPoints ( 3 ) the end point coordinate along the vertical axis,The array must be previously initialized.
ExampleDim EndPoints ( 3 ) As DoubleDim hsp, vsp, hep, ved As Double
UserEllipse2D.GetEndPoints ( EndPoints )
hsp = EndPoints( 0 )vsp = EndPoints( 1 )hep = EndPoints( 2 )ved = EndPoints ( 3 )
GetLengthAtParam
Gets the 2D ellipse length between two parameters.Syntax
GetLengthAtParam ( iFirstParameter, iSecondParameter ) as DoubleiFirstParameter as Double
The first parameter.iSecondParameter as Double
The second parameter.Example
EllipseLength = UserEllipse2D.GetLengthAtParam ( 1.000000, 2.000000 )
GetMajorAxis
Gets the 2D ellipse unit vector of the major axis direction.Syntax
GetMajorAxis ( oMajorAxisDirection ) oMajorAxisDirection as Double
A safe array with two elements:oMajorAxisDirection ( 0 ) the unit vector coordinate along the horizontal axis,oMajorAxisDirection ( 1 ) the unit vector coordinate along the vertical axis,The array must be previously initialized.
ExampleDim MajorAxisDirection ( 1 ) As DoubleDim hu, vu As Double
UserEllipse2D.GetMajorAxis ( MajorAxisDirection )
hu = MajorAxisDirection ( 0 )vu = MajorAxisDirection ( 1 )
GetMinorAxis
Gets the 2D ellipse unit vector of the minor axis.Syntax
GetMinorAxis ( oMinorAxisDirection ) oMinorAxisDirection as Double
A safe array with two elements:oMinorAxisDirection ( 0 ) the unit vector coordinate along the horizontal axis,oMinorAxisDirection ( 1 ) the unit vector coordinate along the vertical axis,The array must be previously initialized.
ExampleDim MinorAxisDirection ( 1 ) As DoubleDim hu, vu As Double
UserEllipse2D.GetMinorAxis ( MinorAxisDirection )
hu = MinorAxisDirection ( 0 )vu = MinorAxisDirection ( 1 )
GetParamAtLength
Gets a 2D ellipse parameter from a parameter and the length between them.Syntax
GetParamAtLength ( iParameter, iLength ) as DoubleiParameter as Double
The parameter.iLength as Double
The length.Example
EllipseParameter = UserEllipse2D.GetParamAtLength ( 1.000000, 10.000000 )
GetParamExtents
Gets the 2D ellipse start and end point parameters.Syntax
GetParamExtents ( oParameters )oParameters as Double
A safe array with two elements :oParameters ( 0 ) the start point parameter,oParameters ( 1 ) the end point parameter,The array must be previously initialized.
ExampleDim Parameters ( 1 ) As DoubleDim spp, epp As Double
UserEllipse2D.GetParamExtents ( Parameters )
spp = Parameters ( 0 )epp = Parameters ( 1 )
GetPointAtParam
Gets the 2D ellipse point for a specified parameter.Syntax
GetPointAtParam iParameter, oPointiParameter as Double
The parameter.oPoint as Double
A safe array with two elements :oPoint ( 0 ) the point coordinate along the horizontal axis,oPoint ( 1 ) the point coordinate along the vertical axis,The array must be previously initialized.
ExampleDim Point ( 1 ) As DoubleDim hp, vp As Double
UserEllipse2D.GetPointAtParam 1.000000, Point
hp = Point ( 0 )vp = Point ( 1 )
GetRangeBox
Gets the 2D ellipse points of its bounding box.
SyntaxGetRangeBox ( oBoundingPoint )
oBoundingPoint as DoubleA safe array with four elements :oBoundingPoint ( 0 ) the minimum point coordinate along the horizontal axis,oBoundingPoint ( 1 ) the minimum point coordinate along the vertical axis,oBoundingPoint ( 2 ) the maximum point coordinate along the horizontal axis,oBoundingPoint ( 3 ) the maximum point coordinate along the vertical axis,The array must be previously initialized.
ExampleDim BoundingPoint ( 3 ) As DoubleDim hmin, vmin, hmax, vmax As Double
UserEllipse2D.GetRangeBox ( BoundingPoint )
hmin = BoundingPoint ( 0 )vmin = BoundingPoint ( 1 )hmax = BoundingPoint ( 2 )vmax = BoundingPoint ( 3 )
GetTangent
Gets the 2D ellipse tangent direction unit vector for a specified parameter.Syntax
GetTangent iParameter, oTangentiParameter as Double
The parameter.oTangent as Double
A safe array with two elements :oCurvature ( 0 ) the unit vector coordinate along the horizontal axis,oCurvature ( 1 ) the unit vector coordinate along the vertical axis,The array must be previously initialized.
ExampleDim Tangent ( 2 ) As DoubleDim ht, vt As Double
UserEllipse2D.GetTangent 1.000000, Tangent
ht = Tangent ( 0 )vt = Tangent ( 1 )
IsPeriodic
Gets the 2D ellipse periodicity.Syntax
IsPeriodic as Boolean= True, the ellipse is periodic.= False, the ellipse is not periodic.
ExampleUserEllipse2D.IsPeriodic
SetData
Sets the 2D ellipse center point, major axis direction, major radius and minor radius.Syntax
SetData iHCenter, iVCenter, iHMajor, iVMajor, iMajorRadius, iMinorRadiusiHCenter as Double
The 2D ellipse center coordinate along the horizontal axis.iVCenter as Double
The 2D ellipse center coordinate along the vertical axis.iHMajor as Double
The 2D ellipse major axis direction coordinate along the horizontal axis.iVMajor as Double
The 2D ellipse major axis direction coordinate along the vertical axis.iMajorRadius as Double
The 2D ellipse major radius.iMinorRadius as Double
The 2D ellipse minor radius.Example
UserEllipse2D.SetData 0.000000, 0.000000, 10.000000, 0.000000, 10.000000, 5.000000
Properties
CenterPoint
Gets the 2D ellipse center point.Syntax
CenterPoint as Point2DExample
UserEllipseCenterPoint = UserEllipse2D.CenterPoint
Construction
Gets or sets the construction mode of the 2D ellipse.Syntax
Construction as Boolean= True, indicates that the ellipse is defined as construction 2D ellipse.= False, indicates that the ellipse is defined as standard 2D ellipse.
ExampleEllipse2DConstructionMode = UserEllipse2D.ConstructionUserEllipse2D.Construction = True
Continuity
Gets the geometric continuity highest level of the 2D ellipse.Syntax
Continuity as ShortExample
EllipseContinuity = UserEllipse2D.Continuity
Ellipse2D
Dimensions an object as ellipse in 2D space.Example
Dim UserEllipse2D as Ellipse2D
EndPoint
Gets or sets the end point of the 2D ellipse.Syntax
EndPoint as Point2DExample
EllipseEndPoint = UserEllipse2D.EndPointUserEllipse2D.EndPoint = UserPoint2D
GeometricType
Gets the type of the geometrical element.Syntax
GeometricType as Long= 8, indicates that the geometrical element is a 2D ellipse.
ExampleGeometricalElementType = UserEllipse2D.GeometricType
MajorRadius
Gets the 2D ellipse major radius.Syntax
MajorRadius as Double
ExampleUserEllipseMajorRadius = UserEllipse2D.MajorRadius
MinorRadius
Gets the 2D ellipse major radius.Syntax
MinorRadius as DoubleExample
UserEllipseMinorRadius = UserEllipse2D.MinorRadius
Period
Gets the period of the 2D ellipse.Syntax
Period as DoubleExample
EllipsePeriod = UserEllipse2D.Period
ReportName
Gets or sets the report name of the 2D ellipse.This label is used to define the BRep element identifier.Syntax
ReportName as LongThe label of the report name
ExampleEllipse2DReportName = UserEllipse2D.ReportNameUserEllipse2D.ReportName = 15
StartPoint
Gets or sets the start point of the 2D ellipse.Syntax
StartPoint as Point2DExample
EllipseStartPoint = UserEllipse2D.StartPointUserEllipse2D.StartPoint = UserPoint2D
Running The MacroOpen the Ellipse1.CATPart document.1.
Load the Ellipse1.CATScript macro.2. Run the macro.3.
ParabolaDefinitionA parabola is created from its focus, axis, focal distance, according to the horizontal axis (H) andthe vertical axis (V) of the sketch.A parabola in a sketch is named 2D parabola according to the 2D space.
Methods
CreateParabola
Creates a new 2D parabola within the 2D Factory of the sketch beeing edited.Syntax
CreateParabola ( iHApex, iVApex, iHAxis, iVAxis, iFocalDistance ) as Parabola2DiHApex as Double
The 2D parabola apex coordinate along the horizontal axis.iVApex as Double
The 2D parabola apex coordinate along the vertical axis.iHAxis as Double
The 2D parabola axis direction coordinate along the horizontal axis.iVAxis as Double
The 2D parabola axis direction coordinate along the vertical axis.iFocalDistance as Double
The 2D parabola focal distance.Example
Set UserParabola2D = UserFactory2D.CreateParabola ( 0.000000, 0.000000, 1.000000,0.000000, 10.000000 )
GetAxis
Gets the 2D parabola unit vector of its axis.Syntax
GetAxis ( oAxisDirection ) oAxisDirection as Double
A safe array with two elements:oAxisDirection ( 0 ) the unit vector coordinate along the horizontal axis,oAxisDirection ( 1 ) the unit vector coordinate along the vertical axis,The array must be previously initialized.
Example
Dim AxisDirection ( 1 ) As DoubleDim hu, vu As Double
UserParabola2D.GetAxis ( AxisDirection )
hu = AxisDirection ( 0 )vu = AxisDirection ( 1 )
GetCenter
Gets the 2D parabola focus coordinates.Syntax
GetCenter ( oFocus )oFocus as Double
A safe array with two elements:oFocus ( 0 ) the focus coordinate along the horizontal axis,oFocus ( 1 ) the focus coordinate along the vertical axis,The array must be previously initialized.
ExampleDim Focus ( 1 ) As DoubleDim h, v As Double
UserParabola2D.GetCenter ( Focus )
h = Focus ( 0 )v = Focus ( 1 )
GetCurvature
Gets the 2D parabola curvature and curvature direction unit vector for a specified parameter.Syntax
GetCurvature iParameter, oCurvatureiParameter as Double
The parameter.oCurvature as Double
A safe array with three elements:oCurvature ( 0 ) the curvature,oCurvature ( 1 ) the unit vector coordinate along the horizontal axis,oCurvature ( 2 ) the unit vector coordinate along the vertical axis,The array must be previously initialized.
ExampleDim Curvature ( 2 ) As DoubleDim c, hc, vc As Double
UserParabola2D.GetCurvature 1.000000, Curvature
c = Curvature ( 0 )hc = Curvature ( 1 )vc = Curvature ( 2 )
GetDerivatives
Gets the 2D parabola first, second and third derivatives for a specified parameter.Syntax
GetDerivatives iParameter, oDerivativeiParameter as Double
The parameter.oDerivative as Double
A safe array with six elements :oDerivative ( 0 ) the first derivative vector coordinate along the horizontal axis,oDerivative ( 1 ) the first derivative vector coordinate along the vertical axis,oDerivative ( 2 ) the second derivative vector coordinate along the horizontal axis,oDerivative ( 3 ) the second derivative vector coordinate along the vertical axis,oDerivative ( 4 ) the third derivative vector coordinate along the horizontal axis,oDerivative ( 5 ) the third derivative vector coordinate along the vertical axis,The array must be previously initialized.
ExampleDim Derivative ( 5 ) As DoubleDim hfd, vfd, hsd, vsd, htd, vtd As Double
UserParabola2D.GetDerivatives 1.000000, Derivative
hfd = Derivative ( 0 )vfd = Derivative ( 1 )hsd = Derivative ( 2 )vsd = Derivative ( 3 )htd = Derivative ( 4 )vtd = Derivative ( 5 )
GetEndPoints
Gets the 2D parabola start and end point coordinates.Syntax
GetEndPoints ( oEndPoints )oEndPoints as Double
A safe array with four elements :oEndPoints ( 0 ) the start point coordinate along the horizontal axis,oEndPoints ( 1 ) the start point coordinate along the vertical axis,oEndPoints ( 2 ) the end point coordinate along the horizontal axis,oEndPoints ( 3 ) the end point coordinate along the vertical axis,
The array must be previously initialized.Example
Dim EndPoints ( 3 ) As DoubleDim hsp, vsp, hep, ved As Double
UserParabola2D.GetEndPoints ( EndPoints )
hsp = EndPoints( 0 )vsp = EndPoints( 1 )hep = EndPoints( 2 )ved = EndPoints ( 3 )
GetLengthAtParam
Gets the 2D parabola length between two parameters.Syntax
GetLengthAtParam ( iFirstParameter, iSecondParameter ) as DoubleiFirstParameter as Double
The first parameter.iSecondParameter as Double
The second parameter.Example
ParabolaLength = UserParabola2D.GetLengthAtParam ( 1.000000, 2.000000 )
GetParamAtLength
Gets a 2D parabola parameter from a parameter and the length between them.Syntax
GetParamAtLength ( iParameter, iLength ) as DoubleiParameter as Double
The parameter.iLength as Double
The length.Example
ParabolaParameter = UserParabola2D.GetParamAtLength ( 1.000000, 10.000000 )
GetParamExtents
Gets the 2D parabola start and end point parameters.Syntax
GetParamExtents ( oParameters )oParameters as Double
A safe array with two elements :
oParameters ( 0 ) the start point parameter,oParameters ( 1 ) the end point parameter,The array must be previously initialized.
ExampleDim Parameters ( 1 ) As DoubleDim spp, epp As Double
UserParabola2D.GetParamExtents ( Parameters )
spp = Parameters ( 0 )epp = Parameters ( 1 )
GetPointAtParam
Gets the 2D parabola point for a specified parameter.Syntax
GetPointAtParam iParameter, oPointiParameter as Double
The parameter.oPoint as Double
A safe array with two elements :oPoint ( 0 ) the point coordinate along the horizontal axis,oPoint ( 1 ) the point coordinate along the vertical axis,The array must be previously initialized.
ExampleDim Point ( 1 ) As DoubleDim hp, vp As Double
UserParabola2D.GetPointAtParam 1.000000, Point
hp = Point ( 0 )vp = Point ( 1 )
GetRangeBox
Gets the 2D parabola points of its bounding box.Syntax
GetRangeBox ( oBoundingPoint )oBoundingPoint as Double
A safe array with four elements :oBoundingPoint ( 0 ) the minimum point coordinate along the horizontal axis,oBoundingPoint ( 1 ) the minimum point coordinate along the vertical axis,oBoundingPoint ( 2 ) the maximum point coordinate along the horizontal axis,oBoundingPoint ( 3 ) the maximum point coordinate along the vertical axis,The array must be previously initialized.
ExampleDim BoundingPoint ( 3 ) As DoubleDim hmin, vmin, hmax, vmax As Double
UserParabola2D.GetRangeBox ( BoundingPoint )
hmin = BoundingPoint ( 0 )vmin = BoundingPoint ( 1 )hmax = BoundingPoint ( 2 )vmax = BoundingPoint ( 3 )
GetTangent
Gets the 2D parabola tangent direction unit vector for a specified parameter.Syntax
GetTangent iParameter, oTangentiParameter as Double
The parameter.oTangent as Double
A safe array with two elements :oCurvature ( 0 ) the unit vector coordinate along the horizontal axis,oCurvature ( 1 ) the unit vector coordinate along the vertical axis,The array must be previously initialized.
ExampleDim Tangent ( 2 ) As DoubleDim ht, vt As Double
UserParabola2D.GetTangent 1.000000, Tangent
ht = Tangent ( 0 )vt = Tangent ( 1 )
IsPeriodic
Gets the 2D parabola periodicity.Syntax
IsPeriodic as Boolean= True, the parabola is periodic.= False, the parabola is not periodic.
ExampleUserParabola2D.IsPeriodic
SetData
Sets the 2D parabola focus, axis direction and focal distance.
SyntaxSetData iHFocus, iVFocus, iHAxis, iVAxis, iFocalDistance
iHFocus as DoubleThe 2D parabola focus coordinate along the horizontal axis.
iVFocus as DoubleThe 2D parabola focus coordinate along the vertical axis.
iHAxis as DoubleThe 2D parabola axis direction coordinate along the horizontal axis.
iVAxisas DoubleThe 2D parabola axis direction coordinate along the vertical axis.
iFocalDistance as DoubleThe 2D parabola focal distance.
ExampleUserParabola2D.SetData 0.000000, 0.000000, 1.000000, 0.000000, 10.000000
Properties
Construction
Gets or sets the construction mode of the 2D parabola.Syntax
Construction as Boolean= True, indicates that the parabola is defined as construction 2D parabola.= False, indicates that the parabola is defined as standard 2D parabola.
ExampleParabola2DConstructionMode = UserParabola2D.ConstructionUserParabola2D.Construction = True
Continuity
Gets the geometric continuity highest level of the 2D parabola.Syntax
Continuity as ShortExample
ParabolaContinuity = UserParabola2D.Continuity
EndPoint
Gets or sets the end point of the 2D parabola.Syntax
EndPoint as Point2D
ExampleParabolaEndPoint = UserParabola2D.EndPointUserParabola2D.EndPoint = UserPoint2D
FocalDistance
Gets the 2D parabola focal distance.Syntax
FocalDistance as DoubleExample
UserParabolaFocalDistance = UserParabola2D.FocalDistance
GeometricType
Gets the type of the geometrical element.Syntax
GeometricType as Long= 7, indicates that the geometrical element is a 2D parabola.
ExampleGeometricalElementType = UserParabola2D.GeometricType
Parabola2D
Dimensions an object as parabola in 2D space.Example
Dim UserParabola2D as Parabola2D
Period
Gets the period of the 2D parabola.Syntax
Period as DoubleExample
ParabolaPeriod = UserParabola2D.Period
ReportName
Gets or sets the report name of the 2D parabola.This label is used to define the BRep element identifier.Syntax
ReportName as LongThe label of the report name
Example
Parabola2DReportName = UserParabola2D.ReportNameUserParabola2D.ReportName = 15
StartPoint
Gets or sets the start point of the 2D parabola.Syntax
StartPoint as Point2DExample
ParabolaStartPoint = UserParabola2D.StartPointUserParabola2D.StartPoint = UserPoint2D
Running The MacroOpen the Parabola1.CATPart document.1.
Load the Parabola1.CATScript macro.2. Run the macro.3.
HyperbolaDefinitionA hyperbola is created from its center, axis, radius and imaginary radius, according to thehorizontal axis (H) and the vertical axis (V) of the sketch.A hyperbola in a sketch is named 2D hyperbola according to the 2D space.
Methods
CreateHyperbola
Creates a new 2D hyperbola within the 2D Factory of the sketch beeing edited.Syntax
CreateHyperbola ( iHCenter, iVCenter, iHAxis, iVAxis, iRadius, iImaginaryRadius ) asHyperbola2D
iHCenter as DoubleThe 2D hyperbola center coordinate along the horizontal axis
iVCenter as DoubleThe 2D hyperbola center coordinate along the vertical axis.
iHAxis as DoubleThe 2D hyperbola axis direction coordinate along the horizontal axis.
iVAxis as DoubleThe 2D hyperbola axis direction coordinate along the vertical axis.
iRadius as DoubleThe 2D hyperbola radius.
iImaginaryRadius as DoubleThe 2D hyperbola imaginary radius.
ExampleSet UserHyperbola2D = UserFactory2D.CreateHyperbola ( 0.000000, 0.000000, 1.000000,0.000000, 10.000000, 15.00000 )
GetAxis
Gets the 2D hyperbola unit vector of its axis.Syntax
GetAxis ( oAxisDirection ) oAxisDirection as Double
A safe array with two elements:oAxisDirection ( 0 ) the unit vector coordinate along the horizontal axis,
oAxisDirection ( 1 ) the unit vector coordinate along the vertical axis,The array must be previously initialized.
ExampleDim AxisDirection ( 1 ) As DoubleDim hu, vu As Double
UserHyperbola2D.GetAxis ( AxisDirection )
hu = AxisDirection ( 0 )vu = AxisDirection ( 1 )
GetCenter
Gets the 2D hyperbola center coordinates.Syntax
GetCenter ( oCenter ) oCenter as Double
A safe array with two elements:oCenter ( 0 ) the center coordinate along the horizontal axis,oCenter ( 1 ) the center coordinate along the vertical axis,The array must be previously initialized.
ExampleDim Center ( 1 ) As DoubleDim h, v As Double
UserHyperbola2D.GetCenter ( Center )
h = Center ( 0 )v = Center ( 1 )
GetCurvature
Gets the 2D hyperbola curvature and curvature direction unit vector for a specified parameter.Syntax
GetCurvature iParameter, oCurvatureiParameter as Double
The parameter.oCurvature as Double
A safe array with three elements:oCurvature ( 0 ) the curvature,oCurvature ( 1 ) the unit vector coordinate along the horizontal axis,oCurvature ( 2 ) the unit vector coordinate along the vertical axis,The array must be previously initialized.
Example
Dim Curvature ( 2 ) As DoubleDim c, hc, vc As Double
UserHyperbola2D.GetCurvature 1.000000, Curvature
c = Curvature ( 0 )hc = Curvature ( 1 )vc = Curvature ( 2 )
GetDerivatives
Gets the 2D hyperbola first, second and third derivatives for a specified parameter.Syntax
GetDerivatives iParameter, oDerivativeiParameter as Double
The parameter.oDerivative as Double
A safe array with six elements :oDerivative ( 0 ) the first derivative vector coordinate along the horizontal axis,oDerivative ( 1 ) the first derivative vector coordinate along the vertical axis,oDerivative ( 2 ) the second derivative vector coordinate along the horizontal axis,oDerivative ( 3 ) the second derivative vector coordinate along the vertical axis,oDerivative ( 4 ) the third derivative vector coordinate along the horizontal axis,oDerivative ( 5 ) the third derivative vector coordinate along the vertical axis,The array must be previously initialized.
ExampleDim Derivative ( 5 ) As DoubleDim hfd, vfd, hsd, vsd, htd, vtd As Double
UserHyperbola2D.GetDerivatives 1.000000, Derivative
hfd = Derivative ( 0 )vfd = Derivative ( 1 )hsd = Derivative ( 2 )vsd = Derivative ( 3 )htd = Derivative ( 4 )vtd = Derivative ( 5 )
GetEndPoints
Gets the 2D hyperbola start and end point coordinates.Syntax
GetEndPoints ( oEndPoints )oEndPoints as Double
A safe array with four elements :
oEndPoints ( 0 ) the start point coordinate along the horizontal axis,oEndPoints ( 1 ) the start point coordinate along the vertical axis,oEndPoints ( 2 ) the end point coordinate along the horizontal axis,oEndPoints ( 3 ) the end point coordinate along the vertical axis,The array must be previously initialized.
ExampleDim EndPoints ( 3 ) As DoubleDim hsp, vsp, hep, ved As Double
UserHyperbola2D.GetEndPoints ( EndPoints )
hsp = EndPoints( 0 )vsp = EndPoints( 1 )hep = EndPoints( 2 )ved = EndPoints ( 3 )
GetLengthAtParam
Gets the 2D hyperbola length between two parameters.Syntax
GetLengthAtParam ( iFirstParameter, iSecondParameter ) as DoubleiFirstParameter as Double
The first parameter.iSecondParameter as Double
The second parameter.Example
HyperbolaLength = UserHyperbola2D.GetLengthAtParam ( 1.000000, 2.000000 )
GetParamAtLength
Gets a 2D hyperbola parameter from a parameter and the length between them.Syntax
GetParamAtLength ( iParameter, iLength ) as DoubleiParameter as Double
The parameter.iLength as Double
The length.Example
HyperbolaParameter = UserHyperbola2D.GetParamAtLength ( 1.000000, 10.000000 )
GetParamExtents
Gets the 2D hyperbola start and end point parameters.Syntax
GetParamExtents ( oParameters )oParameters as Double
A safe array with two elements :oParameters ( 0 ) the start point parameter,oParameters ( 1 ) the end point parameter,The array must be previously initialized.
ExampleDim Parameters ( 1 ) As DoubleDim spp, epp As Double
UserHyperbola2D.GetParamExtents ( Parameters )
spp = Parameters ( 0 )epp = Parameters ( 1 )
GetPointAtParam
Gets the 2D hyperbola point for a specified parameter.Syntax
GetPointAtParam iParameter, oPointiParameter as Double
The parameter.oPoint as Double
A safe array with two elements :oPoint ( 0 ) the point coordinate along the horizontal axis,oPoint ( 1 ) the point coordinate along the vertical axis,The array must be previously initialized.
ExampleDim Point ( 1 ) As DoubleDim hp, vp As Double
UserHyperbola2D.GetPointAtParam 1.000000, Point
hp = Point ( 0 )vp = Point ( 1 )
GetRangeBox
Gets the 2D hyperbola points of its bounding box.Syntax
GetRangeBox ( oBoundingPoint )oBoundingPoint as Double
A safe array with four elements :oBoundingPoint ( 0 ) the minimum point coordinate along the horizontal axis,
oBoundingPoint ( 1 ) the minimum point coordinate along the vertical axis,oBoundingPoint ( 2 ) the maximum point coordinate along the horizontal axis,oBoundingPoint ( 3 ) the maximum point coordinate along the vertical axis,The array must be previously initialized.
ExampleDim BoundingPoint ( 3 ) As DoubleDim hmin, vmin, hmax, vmax As Double
UserHyperbola2D.GetRangeBox ( BoundingPoint )
hmin = BoundingPoint ( 0 )vmin = BoundingPoint ( 1 )hmax = BoundingPoint ( 2 )vmax = BoundingPoint ( 3 )
GetTangent
Gets the 2D hyperbola tangent direction unit vector for a specified parameter.Syntax
GetTangent iParameter, oTangentiParameter as Double
The parameter.oTangent as Double
A safe array with two elements :oCurvature ( 0 ) the unit vector coordinate along the horizontal axis,oCurvature ( 1 ) the unit vector coordinate along the vertical axis,The array must be previously initialized.
ExampleDim Tangent ( 2 ) As DoubleDim ht, vt As Double
UserHyperbola2D.GetTangent 1.000000, Tangent
ht = Tangent ( 0 )vt = Tangent ( 1 )
IsPeriodic
Gets the 2D hyperbola periodicity.Syntax
IsPeriodic as Boolean= True, the parabola is periodic.= False, the parabola is not periodic.
Example
UserHyperbola2D.IsPeriodic
SetData
Sets the 2D parabola focus, axis direction and focal distance.Syntax
SetData iHCenter, iVCenter, iHAxis, iVAxis, iRadius, iImaginaryRadiusiHCenter as Double
The 2D hyperbola center coordinate along the horizontal axisiVCenter as Double
The 2D hyperbola center coordinate along the vertical axis.iHAxis as Double
The 2D hyperbola axis direction coordinate along the horizontal axis.iVAxis as Double
The 2D hyperbola axis direction coordinate along the vertical axis.iRadius as Double
The 2D hyperbola radius.iImaginaryRadius as Double
The 2D hyperbola imaginary radius.Example
UserHyperbola2D.SetData 0.000000, 0.000000, 1.000000, 0.000000, 10.000000,15.000000
Properties
Construction
Gets or sets the construction mode of the 2D hyperbola.Syntax
Construction as Boolean= True, indicates that the parabola is defined as construction 2D hyperbola.= False, indicates that the parabola is defined as standard 2D hyperbola.
ExampleParabola2DConstructionMode = UserHyperbola2D.ConstructionUserHyperbola2D.Construction = True
Continuity
Gets the geometric continuity highest level of the 2D hyperbola.Syntax
Continuity as Short
ExampleHyperbolaContinuity = UserHyperbola2D.Continuity
EndPoint
Gets or sets the end point of the 2D hyperbola.Syntax
EndPoint as Point2DExample
HyperbolaEndPoint = UserHyperbola2D.EndPointUserHyperbola2D.EndPoint = UserPoint2D
GeometricType
Gets the type of the geometrical element.Syntax
GeometricType as Long= 6, indicates that the geometrical element is a 2D hyperbola.
ExampleGeometricalElementType = UserHyperbola2D.GeometricType
Hyperbola2D
Dimensions an object as hyperbola in 2D space.Example
Dim UserHyperbola2D as Hyperbola2D
Period
Gets the period of the 2D hyperbola.Syntax
Period as DoubleExample
HyperbolaPeriod = UserHyperbola2D.Period
ReportName
Gets or sets the report name of the 2D hyperbola.This label is used to define the BRep element identifier.Syntax
ReportName as LongThe label of the report name
ExampleHyperbola2DReportName = UserHyperbola2D.ReportName
UserHyperbola2D.ReportName = 15
StartPoint
Gets or sets the start point of the 2D hyperbola.Syntax
StartPoint as Point2DExample
HyperbolaStartPoint = UserHyperbola2D.StartPointUserHyperbola2D.StartPoint = UserPoint2D
Running The MacroOpen the Hyperbola1.CATPart document.1.
Load the Hyperbola1.CATScript macro.2. Run the macro.3.
Creates a ConicDefinitionA arc combines Point, conic (Ellipse or, Parabola or Hyperbola) and Constraints methods andproperties, and there are no dedicated methods or properties to manage it.
LineDefinitionA line is created from its start and end points, according to the horizontal axis (H) and the verticalaxis (V) of the sketch.A line in a sketch is named 2D line according to the 2D space.
Methods
CreateLine
Creates a new 2D line within the 2D Factory of the sketch beeing edited.Syntax
CreateLine ( iH1, iV1, iH2, iV2 ) as Line2DiH1 as Double
The first point coordinate along the horizontal axis.iV1 as Double
The first point coordinate along the vertical axis.iH2 as Double
The second point coordinate along the horizontal axis.iV2 as Double
The second point coordinate along the vertical axis.Example
Set UserLine2D = UserFactory2D.CreateLine ( 80.000000, 30.000000, 0.000000,10.000000 )
CreateLineFromVector
Creates a new 2D line within the 2D Factory of the sketch beeing edited.Syntax
CreateLineFromVector ( iH, iV, iHu, iVu ) as Line2DiH as Double
The line origin point coordinate along the horizontal axis.iV as Double
The line origin point coordinate along the vertical axis.iHu as Double
The vector coordinate along the horizontal axis.iVu as Double
The vector coordinate along the vertical axis.Example
Set UserLine2D = UserFactory2D.CreateLineFromVector ( 80.000000, 30.000000,1.000000, 1.000000 )
GetCurvature
Gets the 2D line curvature and curvature direction unit vector for a specified parameter.Syntax
GetCurvature iParameter, oCurvatureiParameter as Double
The parameter.oCurvature as Double
A safe array with three elements:oCurvature ( 0 ) the curvature,oCurvature ( 1 ) the unit vector coordinate along the horizontal axis,oCurvature ( 2 ) the unit vector coordinate along the vertical axis,The array must be previously initialized.
ExampleDim Curvature ( 2 ) As DoubleDim c, hc, vc As Double
UserLine2D.GetCurvature 1.000000, Curvature
c = Curvature ( 0 )hc = Curvature ( 1 )vc = Curvature ( 2 )
GetDerivatives
Gets the 2D line first, second and third derivatives for a specified parameter.Syntax
GetDerivatives iParameter, oDerivativeiParameter as Double
The parameter.oDerivative as Double
A safe array with six elements :oDerivative ( 0 ) the first derivative vector coordinate along the horizontal axis,oDerivative ( 1 ) the first derivative vector coordinate along the vertical axis,oDerivative ( 2 ) the second derivative vector coordinate along the horizontal axis,oDerivative ( 3 ) the second derivative vector coordinate along the vertical axis,oDerivative ( 4 ) the third derivative vector coordinate along the horizontal axis,oDerivative ( 5 ) the third derivative vector coordinate along the vertical axis,The array must be previously initialized.
ExampleDim Derivative ( 5 ) As DoubleDim hfd, vfd, hsd, vsd, htd, vtd As Double
UserLine2D.GetDerivatives 1.000000, Derivative
hfd = Derivative ( 0 )vfd = Derivative ( 1 )hsd = Derivative ( 2 )vsd = Derivative ( 3 )htd = Derivative ( 4 )vtd = Derivative ( 5 )
GetDirection
Gets the 2D line direction unit vector.Syntax
GetDirection ( oDirection ) oDirection as Double
A safe array with two elements:oDirection ( 0 ) the line direction unit vector coordinate along H,oDirection ( 1 ) the line direction unit vector coordinate along V,The array must be previously initialized.
ExampleDim Direction ( 1 ) As DoubleDim hu, vu As Double
UserLine2D.GetDirection ( Direction )
hu = Direction ( 0 )vu = Direction ( 1 )
GetEndPoints
Gets the 2D line start and end point coordinates.Syntax
GetEndPoints ( oEndPoints )oEndPoints as Double
A safe array with four elements :oEndPoints ( 0 ) the start point coordinate along the horizontal axis,oEndPoints ( 1 ) the start point coordinate along the vertical axis,oEndPoints ( 2 ) the end point coordinate along the horizontal axis,oEndPoints ( 3 ) the end point coordinate along the vertical axis,The array must be previously initialized.
Example
Dim EndPoints ( 3 ) As DoubleDim hsp, vsp, hep, ved As Double
UserLine2D.GetEndPoints ( EndPoints )
hsp = EndPoints( 0 )vsp = EndPoints( 1 )hep = EndPoints( 2 )ved = EndPoints ( 3 )
GetLengthAtParam
Gets the 2D line length between two parameters.Syntax
GetLengthAtParam ( iFirstParameter, iSecondParameter ) as DoubleiFirstParameter as Double
The first parameter.iSecondParameter as Double
The second parameter.Example
LineLength = UserLine2D.GetLengthAtParam ( 1.000000, 2.000000 )
GetOrigin
Gets the line origin point coordinates.Syntax
GetOrigin ( oOriginPoint ) oOriginPoint as Double
A safe array with two elements:oOriginPoint ( 0 ) the line origin point coordinate along H,oOriginPoint ( 1 ) the line origin point coordinate along V,The array must be previously initialized.
ExampleDim OriginPoint ( 1 ) As DoubleDim h, v As Double
UserLine2D.GetOrigin ( OriginPoint )
h = OriginPoint ( 0 )v = OriginPoint ( 1 )
GetParamAtLength
Gets a 2D line parameter from a parameter and the length between them.
SyntaxGetParamAtLength ( iParameter, iLength ) as Double
iParameter as DoubleThe parameter.
iLength as DoubleThe length.
ExampleLineParameter = UserLine2D.GetParamAtLength ( 1.000000, 10.000000 )
GetParamExtents
Gets the 2D line start and end point parameters.Syntax
GetParamExtents ( oParameters )oParameters as Double
A safe array with two elements :oParameters ( 0 ) the start point parameter,oParameters ( 1 ) the end point parameter,The array must be previously initialized.
ExampleDim Parameters ( 1 ) As DoubleDim spp, epp As Double
UserLine2D.GetParamExtents ( Parameters )
spp = Parameters ( 0 )epp = Parameters ( 1 )
GetPointAtParam
Gets the 2D line point for a specified parameter.Syntax
GetPointAtParam iParameter, oPointiParameter as Double
The parameter.oPoint as Double
A safe array with two elements :oPoint ( 0 ) the point coordinate along the horizontal axis,oPoint ( 1 ) the point coordinate along the vertical axis,The array must be previously initialized.
ExampleDim Point ( 1 ) As DoubleDim hp, vp As Double
UserLine2D.GetPointAtParam 1.000000, Point
hp = Point ( 0 )vp = Point ( 1 )
GetRangeBox
Gets the 2D line points of its bounding box.Syntax
GetRangeBox ( oBoundingPoint )oBoundingPoint as Double
A safe array with four elements :oBoundingPoint ( 0 ) the minimum point coordinate along the horizontal axis,oBoundingPoint ( 1 ) the minimum point coordinate along the vertical axis,oBoundingPoint ( 2 ) the maximum point coordinate along the horizontal axis,oBoundingPoint ( 3 ) the maximum point coordinate along the vertical axis,The array must be previously initialized.
ExampleDim BoundingPoint ( 3 ) As DoubleDim hmin, vmin, hmax, vmax As Double
UserLine2D.GetRangeBox ( BoundingPoint )
hmin = BoundingPoint ( 0 )vmin = BoundingPoint ( 1 )hmax = BoundingPoint ( 2 )vmax = BoundingPoint ( 3 )
GetTangent
Gets the 2D line tangent direction unit vector for a specified parameter.Syntax
GetTangent iParameter, oTangentiParameter as Double
The parameter.oTangent as Double
A safe array with two elements :oCurvature ( 0 ) the unit vector coordinate along the horizontal axis,oCurvature ( 1 ) the unit vector coordinate along the vertical axis,The array must be previously initialized.
ExampleDim Tangent ( 2 ) As DoubleDim ht, vt As Double
UserLine2D.GetTangent 1.000000, Tangent
ht = Tangent ( 0 )vt = Tangent ( 1 )
IsPeriodic
Gets the 2D line periodicity.Syntax
IsPeriodic as Boolean= True, the line is periodic.= False, the line is not periodic.
ExampleUserLine2D.IsPeriodic
SetData
Sets the 2D line origin point and vector coordinates.Syntax
SetData iH, iV, iHu,iH as Double
The point coordinate along the horizontal axis.iV as Double
The point coordinate along the vertical axis.iHu as Double
The vector coordinate along the horizontal axis.iVu as Double
The vector coordinate along the vertical axis.Example
UserLine2D.SetData 10.00000, 10.00000, 1.000000, 0.000000
Properties
Construction
Gets or sets the construction mode of the 2D line.Syntax
Construction as Boolean= True, indicates that the line is defined as construction 2D line.= False, indicates that the line is defined as standard 2D line.
Example
Line2DConstructionMode = UserLine2D.ConstructionUserLine2D.Construction = True
Continuity
Gets the geometric continuity highest level of the 2D line.Syntax
Continuity as ShortExample
LineContinuity = UserLine2D.Continuity
EndPoint
Gets or sets the end point of the 2D line.Syntax
EndPoint as Point2DExample
LineEndPoint = UserLine2D.EndPointUserLine2D.EndPoint = UserPoint2D
GeometricType
Gets the type of the geometrical element.Syntax
GeometricType as Long= 3, indicates that the geometrical element is a 2D line.
ExampleGeometricalElementType = UserLine2D.GeometricType
Line2D
Dimensions an object as 2D line.Example
Dim UserLine2D as Line2D
Period
Gets the period of the 2D line.Syntax
Period as DoubleExample
LinePeriod = UserLine2D.Period
ReportName
Gets or sets the report name of the 2D line.This label is used to define the BRep element identifier.Syntax
ReportName as LongThe label of the report name
ExampleLine2DReportName = UserLine2D.ReportNameUserLine2D.ReportName = 15
StartPoint
Gets or sets the start point of the 2D line.Syntax
StartPoint as Point2DExample
LineStartPoint = UserLine2D.StartPointUserLine2D.StartPoint = UserPoint2D
Running The MacroOpen the Line1.CATPart document.1.
Load the Line1.CATScript macro.2. Run the macro.3.
Bitangent LineDefinitionA bitangent line combines Point, Line and Constraints methods and properties, and there are nodedicated methods or properties to manage it.
Point by ClickingDefinitionA point by clicking combines Point and Constraints methods and properties, and there are nodedicated methods or properties to manage it.
PointDefinitionA point is created according to the horizontal axis (H) and the vertical axis (V) of the sketch.A point in a sketch is named 2D point according to the 2D space.
Methods
CreatePoint
Creates a new 2D point within the 2D Factory of the sketch beeing edited.The 2D point is created as construction 2D point, see Construction.Syntax
CreatePoint ( iH, iV ) as Point2DiH as Double
The 2D point coordinate along the horizontal axis.iV as Double
The 2D point coordinate along the vertical axis.Example
Set UserPoint2D = UserFactory2D.CreatePoint ( 80.000000, 30.000000 )
GetCoordinates
Gets the 2D point coordinates.Syntax
GetCoordinates ( oPoint ) oPoint as Double
A safe array with two elements:oPoint ( 0 ) the 2D point coordinate along the horizontal axis,oPoint ( 1 ) the 2D point coordinate along the vertical axis,The array must be previously initialized.
ExampleDim Point ( 1 ) As DoubleDim h, v As Double
UserPoint2D.GetCoordinates ( Point )
h = Point ( 0 )v = Point ( 1 )
SetData
Sets the 2D point coordinates.Syntax
SetData iH, iViH as Double
The 2D point coordinate along the horizontal axis.iV as Double
The 2D point coordinate along the vertical axis.Example
UserPoint2D.SetData 10.00000, 10.00000
Properties
Construction
Gets or sets the construction mode of the 2D point.Syntax
Construction as Boolean= True, indicates that the point is defined as construction 2D point.= False, indicates that the point is defined as standard 2D point.
ExamplePoint2DConstructionMode = UserPoint2D.ConstructionUserPoint2D.Construction = True
GeometricType
Gets the type of the geometrical element.Syntax
GeometricType as Long= 2, indicates that the geometrical element is a 2D point.
ExampleGeometricalElementType = UserPoint2D.GeometricType
Point2D
Dimensions an object as 2D point.Example
Dim UserPoint2D as Point2D
ReportName
Gets or sets the report name of the 2D point.This label is used to define the BRep element identifier.Syntax
ReportName as LongThe label of the report name
ExamplePoint2DReportName = UserPoint2D.ReportNameUserPoint2D.ReportName = 15
Running The MacroOpen the Point1.CATPart document.1.
Load the Point1.CATScript macro.2. Run the macro.3.
Equidistant PointsDefinitionEquidistant points are created on a curve, constrained with it and between them.Equidistant points combine Point , curve (Circle, Spline, Ellipse, Parabola, Hyperbola, Line) andConstraints methods and properties, and there are no dedicated methods or properties tomanage it.
CATPart Document
CornerChamfer
TrimBreak
SymmetryTranslation
RotationScalingOffset
Contour Offset
CornerDefinitionA corner combines Point , curve (Circle, Spline, Ellipse, Parabola, Hyperbola, Line) andConstraints methods and properties, and there are no dedicated methods or properties tomanage it.
ChamferDefinitionA chamfer combines Point , curve (Circle, Spline, Ellipse, Parabola, Hyperbola, Line) andConstraints methods and properties, and there are no dedicated methods or properties tomanage it.
TrimDefinitionA trim combines Point , curve (Circle, Spline, Ellipse, Parabola, Hyperbola, Line) andConstraints methods and properties, and there are no dedicated methods or properties tomanage it.
BreakDefinitionA break combines Point , curve (Circle, Spline, Ellipse, Parabola, Hyperbola, Line) andConstraints methods and properties, and there are no dedicated methods or properties tomanage it.
SymmetryDefinitionA symmetry combines Point , curve (Circle, Spline, Ellipse, Parabola, Hyperbola, Line) andConstraints methods and properties, and there are no dedicated methods or properties tomanage it.
TranslationDefinitionA translation combines Point , curve (Circle, Spline, Ellipse, Parabola, Hyperbola, Line) andConstraints methods and properties, and there are no dedicated methods or properties tomanage it.
RotationDefinitionA rotation combines Point , curve (Circle, Spline, Ellipse, Parabola, Hyperbola, Line) andConstraints methods and properties, and there are no dedicated methods or properties tomanage it.
ScalingDefinitionA scaling combines Point , curve (Circle, Spline, Ellipse, Parabola, Hyperbola, Line) andConstraints methods and properties, and there are no dedicated methods or properties tomanage it.
OffsetDefinitionAn offset combines Point , curve (Circle, Spline, Ellipse, Parabola, Hyperbola, Line) andConstraints methods and properties, and there are no dedicated methods or properties tomanage it.
Contour OffsetDefinitionA contour offset combines Point , curve (Circle, Spline, Ellipse, Parabola, Hyperbola, Line) andConstraints methods and properties, and there are no dedicated methods or properties tomanage it.
Sketcher Basics
PropertiesReference Axis
PropertiesDefinitionSketch properties.
Methods
CloseEdition
Closes the sketch edition.Syntax
CloseEditionExample
UserSketch.CloseEdition
GetAbsoluteAxisData
Gets the 3D reference of the sketch.Syntax
GetAbsoluteAxisData oSketchReferenceoSketchReference as Double
A safe array with nine elements:oSketchReference ( 0 ) the sketch origin point coordinate along the x axis,oSketchReference ( 1 ) the sketch origin point coordinate along the y axis,oSketchReference ( 2 ) the sketch origin point coordinate along the z axis,oSketchReference ( 3 ) the sketch horizontal axis vector coordinate along the x axis,oSketchReference ( 4 ) the sketch horizontal axis vector coordinate along the y axis,oSketchReference ( 5 ) the sketch horizontal axis vector coordinate along the z axis,oSketchReference ( 6 ) the sketch vertical axis vector coordinate along the x axis,oSketchReference ( 7 ) the sketch vertical axis vector coordinate along the y axis,oSketchReference ( 8 ) the sketch vertical axis vector coordinate along the z axis,The array must be previously initialized..
ExampleDim SketchReference ( 8 ) As DoubleDim ox, oy, oz, hx, hy, hz, vx, vy, vz As Double
UserSketch.GetAbsoluteAxisData SketchReference
ox = SketchReference ( 0 )oy = SketchReference ( 1 )oz = SketchReference ( 2 )hx = SketchReference ( 3 )
hy = SketchReference ( 4 )hz = SketchReference ( 5 )vx = SketchReference ( 6 )vy = SketchReference ( 7 )vz = SketchReference ( 8 )
InverseOrientation
Inverses the sketch orientation.Syntax
InverseOrientationExample
UserSketch.InverseOrientation
OpenEdition
Opens the sketch edition.Syntax
OpenEdition as Factory2DExample
Set UserFactory2D = UserSketch.OpenEdition
SetAbsoluteAxisData
Sets the 3D reference of the sketch.Syntax
SetAbsoluteAxisData iSketchReferenceiSketchReference as Double
A safe array with nine elements:iSketchReference ( 0 ) the sketch origin point coordinate along the x axis,iSketchReference ( 1 ) the sketch origin point coordinate along the y axis,iSketchReference ( 2 ) the sketch origin point coordinate along the z axis,iSketchReference ( 3 ) the sketch horizontal axis vector coordinate along the x axis,iSketchReference ( 4 ) the sketch horizontal axis vector coordinate along the y axis,iSketchReference ( 5 ) the sketch horizontal axis vector coordinate along the z axis,iSketchReference ( 6 ) the sketch vertical axis vector coordinate along the x axis,iSketchReference ( 7 ) the sketch vertical axis vector coordinate along the y axis,iSketchReference ( 8 ) the sketch vertical axis vector coordinate along the z axis,The array must be previously initialized..
ExampleDim SketchReference ( 8 ) As Double
SketchReference ( 0 ) = 0.000000SketchReference ( 1 ) = 0.000000SketchReference ( 2 ) = 0.000000
SketchReference ( 3 ) = 1.000000SketchReference ( 4 ) = 0.000000SketchReference ( 5 ) = 0.000000SketchReference ( 6 ) = 0.000000SketchReference ( 7 ) = 1.000000SketchReference ( 8 ) = 0.000000
UserSketch.SetAbsoluteAxisData SketchReference
Properties
AbsoluteAxis
Returns the absolute axis of the sketch.Syntax
AbsoluteAxis as Axis2DExample
SketchAbsoluteAxis = UserSketch.AbsoluteAxis
CenterLine
Returns the center line of the sketch.Syntax
CenterLine as Line2DExample
SketchCenterLine = UserSketch.CenterLine
Constraints
Returns the collection object containing the constraints of the sketch.Syntax
Constraints as ConstraintsExample
SketchConstraintsCollection = UserSketch.Constraints
Factory2D
Returns the 2D factory of the sketch.Syntax
Factory2D as Factory2DExample
SketchFactory2D = UserSketch.Factory2D
GeometricElements
Returns the collection object containing the geometrical elements of the sketch.Syntax
GeometricElement as GeometricElementsExample
SketchGeometricElementsCollection = UserSketch.GeometricElements
Sketch
Defines an object as Sketch.Example
Dim UserSketch as Sketch
Sketches
Defines an object as a sketches collection of a body.Example
Dim UserSketches as Sketches
Reference AxisDefinitionReference axis are the horizontal axis (H) and the vertical axis (V) defining the sketch in 2Dspace.Reference axis of the sketch are named 2D axis according to the 2D space.
Methods
GetItem
Gets the sketch axis references from their feature names.Syntax
GetItem ( iFeatureName ) as Line2DExample
SketchHorizontalReference = UserAxis2D.GetItem ( "HDirection" )SketchVerticalReference = UserAxis2D.GetItem ( "VDirection" )
Properties
Axis2D
Dimensions an object as 2D axis.Example
Dim UserAxis2D as Axis2D
GeometricType
Gets the type of the geometrical element.Syntax
GeometricType as Long= 1, indicates that the geometrical element is a 2D axis.
ExampleGeometricalElementType = UserAxis2D.GeometricType
HorizontalReference
Gets the horizontal reference of the sketch.Syntax
HorizontalReference as Line2DExample
SketchHorizontalReference = UserAxis2D.HorizontalReference
VerticalReference
Gets the vertical reference of the sketch.Syntax
VerticalReference as Line2DExample
SketchVerticalReference = UserAxis2D.VerticalReference
Sketcher Constraints
ConstraintsTangent Constraint
ConstraintsDefinitionConstraints sketcher geometric elements.
Methods
AddMonoEltCst
Creates a new constraint applying to a single geometric element and adds it to the constraintscollection.Syntax
AddMonoEltCst ( iConstraintType, iElement ) as ConstraintiConstraintType as Long
The constraint type.See Type syntax.
iElement as ReferenceThe geometric element to be constrained.
ExampleSet UserConstraint = CATIA.ActiveDocument.Part.Constraints.AddMonoEltCst ( 0,UserReference )
AddBiEltCst
Creates a new constraint applying to two geometric elements and adds it to the constraintscollection.Syntax
AddBiEltCst ( iConstraintType, iFirstElement, iSecondElement ) as ConstraintiConstraintType as Long
The constraint type.See Type syntax.
iFirstElement as ReferenceThe first geometric element to be constrained.
iSecondElement as ReferenceThe second geometric element to be constrained.
ExampleSet UserConstraint = CATIA.ActiveDocument.Part.Constraints.AddBiEltCst ( 0,UserReference1, UserReference2 )
AddTriEltCst
Creates a new constraint applying to three geometric elements and adds it to the constraintscollection.Syntax
AddTriEltCst ( iConstraintType, iFirstElement, iSecondElement, iThirdElement ) asConstraint
iConstraintType as LongThe constraint type.See Type syntax.
iFirstElement as ReferenceThe first geometric element to be constrained.
iSecondElement as ReferenceThe second geometric element to be constrained.
iThirdElement as ReferenceThe second geometric element to be constrained.
ExampleSet UserConstraint = CATIA.ActiveDocument.Product.Constraints.AddTriEltCst ( 0,UserReference1, UserReference2, UserReference3 )
Activate
Activates a constraint.An activated constraint is take into account during the update process.Syntax
ActivateExample
UserConstraint.Activate
Deactivate
Deactivates a constraint.An deactivated constraint is not take into account during the update process.Syntax
DeactivateExample
UserConstraint.Deactivate
IsInactive
Indicates if a constraint is take into account during the update process.Syntax
IsInactive as Boolean
= True, the constraint is not active= False, the constraint is active.
ExampleConstraintActivity = UserConstraint.IsInactive
GetConstraintElement
Gets a constraint's element.Syntax
GetConstraintElement ( iElementIndex ) as ReferenceiElementIndex as Long
The index of the element of the constraint to be returned.= 1 for the first element.= 2 for the second element.Notice it must not exceed the total number of elements of the constraint. See Type syntax.
ExampleUserReference = UserConstraint.GetConstraintElement ( 1 )
SetConstraintElement
Sets a constraint's element.Syntax
SetConstraintElement ( iElementIndex, iElement ) as ReferenceiElementIndex as Long
The index of the element of the constraint to be replaced.= 1 for the first element.= 2 for the second element.Notice it must not exceed the total number of elements of the constraint. See Type syntax.
iElement as ReferenceThe element to be constrained.
ExampleUserConstraint.GetConstraintElement ( 2, UserReference )
GetConstraintVisuLocation
Returns the constraint's visualisation location.When displayed on screen, the constraint is visualized as a dimension positioned close to theconstrained geometric elements.This method retrieves the data used to position this representation within the 3D space.Syntax
GetConstraintVisuLocation ( oAnchorPoint, oAnchorVector )
oAnchorPoint as DoubleA safe array with 3 elements : x, y, z point coordinates where the constraint value isdisplayed.The array must be previously initialized.
oAnchorVector as DoubleA safe array with 3 elements : x, y, z vector normal to the plane coordinates onto which theconstraint value is displayed.The array must be previously initialized.
ExampleDim ConstraintAnchorPoint ( 2 ), ConstraintAnchorVector ( 2 ) As DoubleDim xp, yp, zp, xv, yv, zv As Double
UserConstraint.GetConstraintVisuLocation ( ConstraintAnchorPoint,ConstraintAnchorVector )
xp = ConstraintAnchorPoint ( 0 )yp = ConstraintAnchorPoint ( 1 )zp = ConstraintAnchorPoint ( 2 ) xv = ConstraintAnchorVector ( 0 )yv = ConstraintAnchorVector ( 1 )zv = ConstraintAnchorVector ( 2 )
SetConstraintVisuLocation
Sets the constraint's visualisation location.Syntax
SetConstraintVisuLocation ( iX, iY, iZ )iX, iY, iZ as Double
Origin point x, y, z absolute coordinates.Example
UserConstraint.SetConstraintVisuLocation 10.000000, 0.000000, 0.000000
Item
Returns a constraint using its index or its name from the Constraints collection.Syntax
Item ( iIndex ) as ConstraintiIndex as Long
The index or the name of the constraint to retrieve from the collection of constraints.As a numerics, this index is the rank of the constraint in the collection.The index of the first constraint in the collection is 1, and the index of the last constraint isCount.:
Example
Set UserConstraint = CATIA.ActiveDocument.Part.Constraints.Item ( 1 )
Remove
Returns a constraint using its index or its name from the Constraints collection.Syntax
Remove ( iIndex ) as ConstraintiIndex as Long
The index or the name of the constraint to remove from the collection of constraints.As a numerics, this index is the rank of the constraint in the collection.The index of the first constraint in the collection is 1, and the index of the last constraint isCount.:
ExampleSet UserConstraint = CATIA.ActiveDocument.Part.Constraints.Remove ( 1 )
Properties
AngleSector
Gets or sets the constraint's angle (or angular) sector, for angle constraint only, Type = 6.The geometric elements of an angle constraint (e.g. : 2 lines or 2 planes) divide the space in 4regions which are called angle or angular sectors, numbered from 0 to 3. By default, the constraint is created in the sector number 0.One angle sector corresponds exactly to particular values of Dimension.Value, Side andOrientation.When changing the angle sector, Dimension.Value, Side and Orientation are also modified.Syntax
AngleSector as Long= 0, Dimension.Value = angle, Orientation = 0, Side = 0= 1, if angle>180: Dimension.Value= angle-180, otherwise: Dimension.Value=abs(angle)+180, Orientation = 1, Side = 0.= 2, if angle>180: Dimension.Value = abs(540-angle), otherwise: Dimension.Value =180-abs(angle), Orientation = 1, Side = 1.= 3, Dimension.Value = 360-abs(angle), Orientation = 0, Side = 1.
ExampleConstraintAngleSector = UserConstraint.AngleSectorUserConstraint.AngleSector = 0
BrokenConstraintsCount
Gets the number of broken constraints from the constraints collection.Syntax
BrokenConstraintsCount as LongExample
BrokenConstraints = UserConstraintsCollection.BrokenConstraintsCount
Constraint
Dimensions an object as constraint.Example
Dim UserConstraint as Constraint
Constraints
Dimensions an object as a constraints collection.Example
Dim UserConstraintsCollection as Constraints
Dimension.Value
Gets or sets the constraint's dimension.The dimension may be meaningless for some types of constraints such as tangency constraints,or if the constraint is not currently checked, see Status syntax.Syntax
Dimension.Value as DoubleExample
ConstraintDimension = UserConstraint.Dimension.Value UserConstraint.Dimension.Value = 50.00000
DistanceConfig
Gets or sets the constraint's distance configuration, for distance constraint only, Type = 1.Distance constraints between lines and cylinders offer often more degrees of freedom togeometry than acually desired.This property allows user to limit these degrees of freedom without having to redefine additionalconstraints.Syntax
DistanceConfig as Long= 0, no additional condition is set on the constraint.= 1, in addition to being positioned at a specified distance, constrained elements arerequired to be parallel.Their orientation can be the same or opposite.= 2, in addition to being positioned at a specified distance, constrained elements arerequired to be parallel, and their orientations are required to be the same.= 3, in addition to being positioned at a specified distance, constrained elements arerequired to be parallel, and their orientations are required to be opposite.
Example
ConstraintDistanceConfiguration = UserConstraint.DistanceConfigUserConstraint.DistanceConfig = 0
DistanceDirection
Gets or sets the distance's constraint direction.This property is useless for constraints whose type is not Distance, Type =1.Distance constraints may be measured along a particular direction.This property will be used if the direction is a reference axis.Syntax
DistanceDirection as Long= 0, no direction has been specified. The constraint is measured as usual.= 1, the constraint is measured along the X axis.= 2, the constraint is measured along the Y axis.= 3, the constraint is measured along the Z axis.
ExampleConstraintDistanceDirection = UserConstraint.DistanceDirectionUserConstraint.DistanceDirection = 0
Mode
Gets or sets the constraint's driving mode.For constraint types supporting the concept of value, such as distance constraints, the drivingmode tells whether the constraint value actually drives the geometry position, or, conversely, isdriven by it.Syntax
Mode as Long= 0, the constraint mode, the value assigned to the constraint drives the actual position ofthe constrained geometry.= 1, the measure mode, the constraint value only reflects what can be observed from theactual position of the constrained geometry.
ExampleConstraintMode = UserConstraint.ModeUserConstraint.Mode = 1
Orientation
Gets or sets the constraint's orientation.This is used for constraints that involve two geometric elements and specifies the orientation forthe second geometric element with regard to the first one, when several possible orientations areall satisfying the constraint.Syntax
Orientation as Long= 0, the characteristic vectors associated to the constrained elements have sameorientation.
= 1, the characteristic vectors associated to the constrained elements have oppositeorientation.= 2, the relative orientation of the characteristic vectors associated to the constrainedelements is not specified.
ExampleConstraintOrientation = UserConstraint.OrientationUserConstraint.Orientation = 0
Side
Gets or sets the constraint's side.Some constraint types need to relatively position the constrained geometries, when severalpossible configurations are all satisfying the constraint.Syntax
Side as Long= 0, the first constrained element characteristic vector points towards the secondconstrained element.Arithmetic sign of constraint value is ignored, only its absolute value is taken into account.= 1, the first constrained element characteristic vector points is opposite to the secondconstrained element.Arithmetic sign of constraint value is ignored, only its absolute value is taken into account.= 2, the arithmetic sign of constraint value specifies where the second element lies withregard to the first one: a positive value means in the direction of first constrained elementcharacteristic vector, a negative value in the opposite direction.= 3, Arithmetic sign of constraint value specifies where second element lies with regard tofirst one: a negative value means in the direction of first constrained element characteristicvector, a positive value in the opposite direction.= 4, the relative positionning of constrained elements is not defined.
ExampleConstraintSide = UserConstraint.SideUserConstraint.Side = 1
Status
Gets the constraint's status.The constraint's status is a diagnosis if the constraint is checked.Syntax
Status as Long= 0, the constraint is checked.= 1, the constraint is strongly not checked (e.g. distance constraint between two planes,which are not currently parallel).= 2, the constraint is not checked because of the wrong orientation or side of its geometricelements (e.g. planes are parallel and at the specified distance, but their orientation isinverted with respect to the one specified by the constraint).= 3, the constraint is not checked because of its value (e.g. planes are parallel and at the
specified orientation and side but not at the specified distance).= 4, the constraint is not checked because of the wrong type of its geometric elements(e.g. angle between a point and a plane).= 5, the constraint is not checked because a geometric element is missing.
ExampleConstraintStatus = UserConstraint.Status
Type
Gets or sets the constraint's type.Syntax
Type as Long= 0, Fix only with AddMonoEltCst.= 1, Distance only with AddBiEltCst.= 2, Coincidence only with AddBiEltCst.= 3, Concentricity only with AddBiEltCst.= 4, Tangency only with AddBiEltCst.= 5, Length only with AddMonoEltCst.= 6, Angle only with AddBiEltCst.= 8, Parallelism only with AddBiEltCst.= 10, Horizontality only with AddMonoEltCst.= 11, Perpendicularity only with AddBiEltCst.= 13, Verticality only with AddMonoEltCst.= 14, Radius only with AddMonoEltCst.= 15, Symmetry only with AddTriEltCst.= 16, Middle point only with AddBiEltCst.= 17, Equidistant point only with AddTriEltCst.= 18, Major Radius only with AddMonoEltCst.= 19, Minor Radius only with AddMonoEltCst.= 26, Cylinder Radius only with AddBiEltCst.
ExampleConstraintType = UserConstraint.TypeUserConstraint.Type = 1
UnUpdatedConstraintsCount
Gets the number of not updated constraints from the constraints collection.Syntax
BrokenConstraintsCount as Long
ExampleBrokenConstraints = UserConstraintsCollection.BrokenConstraintsCount
Tangent ConstraintDefinitionSets a tangent constraints between sketch elements. These macros use the methods andproperties described in Sketcher Constraints.
Running The MacroOpen the Constraint1.CATPart document.
1.
Load the Constraint1.CATScript macro.2. Run the macro.
3.
Open the Constraint2.CATPart document.
4.
Load the Constraint2.CATScript macro.5. Run the macro.
6.
GlossaryA
autoconstraint A constraint applied to an iso-element (a group of elements).autodetection An assistant for visualizing and, if needed, creating constraints between
elements using the Sketcher.
Ccartesian coordinate The coordinates of an element defined according to the horizontal and
vertical position of this element. consecutive element An element that does not intersect with another element.constraint A geometric or dimension relation either on one element or between two
or three elements.
construction elementA construction element is an element that is internal to, and onlyvisualized by, the sketch. This element is used as positioning reference.It is not used for creating solid primitives.
control point A control point is a point which a spline (tangent) passes through.chamfer A cut through the thickness of the feature of an angle.
Ddriving constraint A constraint that drives the behaviour of the corresponding geometry.
Iisobarycenter A center of gravity created between previously selected elements.
Ooffset A distance at which a duplicated line type element or curve type element
can be positioned.
Ppolar coordinate The coordinates of an element defined according to the radius and the
angle of this element.
profile An open or closed shape including arcs and lines created by the profilecommand in the Sketcher workbench.
Rrotation An operation for moving elements via duplication.
Sscaling An operation that resizes features to a percentage of their initial sizes.
sketch A set of geometric elements created in the Sketcher workbench. Forinstance, a sketch may include a profile, construction lines and points.
SmartPick An assistant for visualizing and, if needed, creating constraints betweenelements using the Sketcher.
standard element Any type of element.
symmetry An operation for repeating elements.
Ttranslation An operation for moving elements or creating several copies
of two-dimensional elements.trace A result from the intersection between an element and sketch face.
Uuse edge A 2D trace resulting from a 3D projection or intersection.
IndexA
AbsoluteAxis Activate AddBiEltCst AddMonoEltCst AddTriEltCst AngleSector Axis2D
BBrokenConstraintsCount
CCenterLine CenterPoint , Circle2D CloseEdition Constraint Constraints , Construction , , , , , , Continuity , , , , , ControlPoint2D CreateCircle CreateClosedCircle CreateClosedEllipse CreateControlPoint CreateEllipse CreateHyperbola CreateLine CreateLineFromVector CreateParabola
CreatePoint CreateSpline
DDeactivate Dimension.Value DistanceConfig DistanceDirection Documents.Add Documents.Open
EEllipse2D EndPoint , , , , ,
FFactory2D FocalDistance
GGeometricElements GeometricType , , , , , , , GetAbsoluteAxisData GetAxis , GetCenter , , , GetConstraintElement GetConstraintVisuLocation GetControlPoints GetCoordinates , GetCurvature , , , , , GetDerivatives , , , , , GetDirection
GetEndPoints , , , , , GetItem GetLengthAtParam , , , . , GetMajorAxis GetMinorAxis GetOrigin GetParamAtLength , , , , , GetParamExtents , , , , , GetPointAtParam , , , , , GetRangeBox , , , , , GetTangent , , , , ,
HHorizontalReference Hyperbola2D
IInverseOrientation IsInactive IsPeriodic , , , , , Item
LLine2D
MMajorRadius MinorRadius Mode
OOpenEdition Orientation
PParabola2D Period , , , , , Point2D
RRadius Remove ReportName , , , , , ,
SSetAbsoluteAxisData SetConstraintElement SetConstraintVisuLocation SetData , , , , , , Side Sketch Sketches Spline2D StartPoint , , , , , Status
TType
UUnUpdatedConstraintsCount
VVerticalReference