Table Of Content

The CATIA - Sketcher Journaling Guide has been designed to show you how to ... The information contained in this guide is specific to Version 5 Release 5 of the ... Note the reference planes and the part body are implicitly created, see Part ...
2MB taille 83 téléchargements 380 vues
Sketcher Journaling Preface Basic Tasks Glossary Index

© Dassault Systèmes 1994-2000. All rights reserved.

Preface The CATIA - Sketcher Journaling Guide has been designed to show you how to create sketch starting from a CATIA script document. This book aims at illustrating the several stages of creation 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 under the AIX, IRIX, SUN OS and HP-UX operating system.

Basic Tasks

CATPart Document Sketcher Profiles Transformation Profiles Sketcher Basics Sketcher Constraints

CATPart Document New CATPart Open CATPart

Create a CATPart Document Definition Creates a new part. Note the reference planes and the part body are implicitly created, see Part Properties and Part Body 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 which becomes the active window. Syntax Documents.Add ( iDocType ) as Document iDocType as String The type of the document to be created, here a CATPart. = "Part" Example CATIA.Documents.Add ( "Part" )

Running The Macro 1. Open CATIA. 2. Load the CreateCATPart1.CATScript macro. 3. Run the macro.

Open a CATPart Document Definition Open an existing part.

Methods Documents.Open Opens and reads a document stored in a file, displays it in a new window, adds the document to the documents collection and the window to the windows collection, and makes both the document and the window the active ones. Syntax Documents.Add ( iFileName ) as Document iFileName as String The string containing the document name and path to be opened. Example CATIA.Documents.Open ( "C:\PartDirectory\UserPart.CATPart" )

Running The Macro 1. Open CATIA. 2. Check in OpenCATPart1.CATScript the path to the Sketcher Journaling Guide directory sample. 3. Load the OpenCATPart1.CATScript macro. 4. Run the macro.

CATPart Document Profile Rectangle Oriented Rectangle Parallelogram Elongated Hole Cylindrical Elongated Hole Keyhole Hexagon Circle Three Points Circle Circle Using Coordinates Tritangent Circle Three Points Arc Three Points Arc Starting With Limits Arc of Circle Spline Ellipse Parabola Hyperbola Creates a Conic Line Bitangent Line Point by Clicking Point Equidistant Points

Profile Definition A profile combines Point, Line, Circle and Constraints methods and properties, and there are no dedicated methods or properties to manage it.

Rectangle Definition A rectangle combines Point, Line and Constraints methods and properties, and there are no dedicated methods or properties to manage it.

Oriented Rectangle Definition An oriented rectangle combines Point, Line and Constraints methods and properties, and there are no dedicated methods or properties to manage it.

Parallelogram Definition A parallelogram combines Point, Line and Constraints methods and properties, and there are no dedicated methods or properties to manage it.

Elongated Hole Definition An elongated hole combines Point, Line, Circle and Constraints methods and properties, and there are no dedicated methods or properties to manage it.

Cylindrical Elongated Hole Definition A cylindrical elongated hole combines Point, Circle and Constraints methods and properties, and there are no dedicated methods or properties to manage it.

Keyhole Definition A keyhole combines Point, Line, Circle and Constraints methods and properties, and there are no dedicated methods or properties to manage it.

Hexagon Definition A hexagon combines Point, Line and Constraints methods and properties, and there are no dedicated methods or properties to manage it.

Circle Definition A circle is created from its center, start and end points, according to the horizontal axis (H) and the 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 Circle2D iHCenter 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 from the horizontal axis. iEndParameter as Double The end parameter is an angle value between iStartParameter excluded and 4PI included, defined from the horizontal axis. Example Set 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 Circle2D iHCenter 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. Example Dim Center ( 1 ) As Double Dim 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, oCurvature iParameter 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 Double Dim 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, oDerivative iParameter 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. Example Dim Derivative ( 5 ) As Double Dim 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 Double Dim 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 Double iFirstParameter 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 Double iParameter 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. Example Dim Parameters ( 1 ) As Double Dim 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, oPoint iParameter 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. Example Dim Point ( 1 ) As Double Dim 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.

Example Dim BoundingPoint ( 3 ) As Double Dim 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, oTangent iParameter 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. Example Dim Tangent ( 2 ) As Double Dim 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. Example UserCircle2D.IsPeriodic

SetData Sets the 2D circle center point and radius.

Syntax SetData iHCenter, iVCenter, iRadius iHCenter 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 UserCircle2D.SetData 0.00000, 0.00000, 10.000000

Properties CenterPoint Gets the 2D circle center point. Syntax CenterPoint as Point2D Example 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. Example Circle2DConstructionMode = UserCircle2D.Construction UserCircle2D.Construction = True

Continuity Gets the geometric continuity highest level of the 2D circle.

Syntax Continuity as Short Example CircleContinuity = UserCircle2D.Continuity

EndPoint Gets or sets the end point of the 2D circle. Syntax EndPoint as Point2D Example CircleEndPoint = UserCircle2D.EndPoint UserCircle2D.EndPoint = UserPoint2D

GeometricType Gets the type of the geometrical element. Syntax GeometricType as Long = 5, indicates that the geometrical element is a 2D circle. Example GeometricalElementType = UserCircle2D.GeometricType

Period Gets the period of the 2D circle. Syntax Period as Double Example CirclePeriod = UserCircle2D.Period

Radius Gets the 2D circle radius. Syntax Radius as Double Example UserCircleRadius = UserCircle2D.Radius

ReportName Gets or sets the report name of the 2D circle. This label is used to define the BRep element identifier.

Syntax ReportName as Long The label of the report name Example Circle2DReportName = UserCircle2D.ReportName UserCircle2D.ReportName = 15

StartPoint Gets or sets the start point of the 2D circle. Syntax StartPoint as Point2D Example CircleStartPoint = UserCircle2D.StartPoint UserCircle2D.StartPoint = UserPoint2D

Running The Macro 1. Open the Circle1.CATPart document.

2. Load the Circle1.CATScript macro. 3. Run the macro.

Three Points Circle Definition A three point circle combines Point, Circle and Constraints methods and properties, and there are no dedicated methods or properties to manage it.

Circle Using Coordinates Definition A circle using coordinates combines Point, Circle and Constraints methods and properties, and there are no dedicated methods or properties to manage it.

Tritangent Circle Definition A tritangent circle combines Point, Circle and Constraints methods and properties, and there are no dedicated methods or properties to manage it.

Three Points Arc Definition A three points arc combines Point, Circle and Constraints methods and properties, and there are no dedicated methods or properties to manage it.

Three Points Arc Starting With Limits Definition A three points arc starting with limits combines Point, Circle and Constraints methods and properties, and there are no dedicated methods or properties to manage it.

Arc of Circle Definition A arc combines Point, Circle and Constraints methods and properties, and there are no dedicated methods or properties to manage it.

Spline Definition A spline is created from a set of control points, themselves created from their coordinates according to the 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 point according 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 ControlPoint2D iH 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 Spline2D iControlPoints 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 Example Dim UserControlPoints ( 2 ) As ControlPoint2D Set UserControlPoints ( 0 ) = FirstControlPoint2D Set UserControlPoints ( 1 ) = SecondControlPoint2D Set UserControlPoints ( 2 ) = ThirdControlPoint2D Set UserSpline2D = UserFactory2D.CreateSpline ( UserControlPoints )

GetControlPoints Gets the 2D spline 2D control points.

Syntax GetControlPoints ( oControlPoints ) oControlPoints as ControlPoint2D A safe array containing all the 2D spline 2D control points: oControlPoints ( i ) a 2D control points, The array must be previously initialized. Example Dim 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. Example Dim ControlPoint ( 1 ) As Double Dim 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, oCurvature iParameter 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 Double Dim 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, oDerivative iParameter 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. Example Dim Derivative ( 5 ) As Double Dim 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.

Example Dim EndPoints ( 3 ) As Double Dim 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 Double iFirstParameter 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 Double iParameter 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 Double Dim 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, oPoint iParameter 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. Example Dim Point ( 1 ) As Double Dim 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. Example Dim BoundingPoint ( 3 ) As Double Dim 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, oTangent iParameter 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. Example Dim Tangent ( 2 ) As Double Dim 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. Example UserSpline2D.IsPeriodic

SetData Sets the control point coordinates. Syntax SetData iH, iV iH 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. Example Spline2DConstructionMode = UserSpline2D.Construction UserSpline2D.Construction = True Point2DConstructionMode = UserControlPoint2D.Construction UserControlPoint2D.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. Example GeometricalElementType = UserSpline2D.GeometricType GeometricalElementType = UserControlPoint2D.GeometricType

Continuity Gets the geometric continuity highest level of the 2D spline. Syntax Continuity as Short Example 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.

Syntax EndPoint as Point2D Example SplineEndPoint = UserSpline2D.EndPoint UserSpline2D.EndPoint = UserPoint2D

Period Gets the period of the 2D spline. Syntax Period as Double Example 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 Long The label of the report name Example Spline2DReportName = UserSpline2D.ReportName UserSpline2D.ReportName = 15 Point2DReportName = UserControlPoint2D.ReportName UserControlPoint2D.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 Point2D Example SplineStartPoint = UserSpline2D.StartPoint UserSpline2D.StartPoint = UserPoint2D

Running The Macro 1. Open the Spline1.CATPart document.

2. Load the Spline1.CATScript macro. 3. Run the macro.

Ellipse Definition An ellipse is created from its center point, major axis, major and minor radius, according to the horizontal 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 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 Set 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 from the horizontal axis. iEndParameter as Double The end parameter is an angle value between iStartParameter excluded and 4PI included, defined from the horizontal axis. Example Set 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. Example Dim Center ( 1 ) As Double Dim 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.

Syntax GetCurvature iParameter, oCurvature iParameter 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 Double Dim 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, oDerivative iParameter 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. Example Dim Derivative ( 5 ) As Double Dim 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. Example Dim EndPoints ( 3 ) As Double Dim 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 Double iFirstParameter 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. Example Dim MajorAxisDirection ( 1 ) As Double Dim 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. Example Dim MinorAxisDirection ( 1 ) As Double Dim 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 Double iParameter 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. Example Dim Parameters ( 1 ) As Double Dim 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, oPoint iParameter 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. Example Dim Point ( 1 ) As Double Dim 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.

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. Example Dim BoundingPoint ( 3 ) As Double Dim 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, oTangent iParameter 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. Example Dim Tangent ( 2 ) As Double Dim 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. Example UserEllipse2D.IsPeriodic

SetData Sets the 2D ellipse center point, major axis direction, major radius and minor radius. Syntax SetData iHCenter, iVCenter, iHMajor, iVMajor, iMajorRadius, iMinorRadius 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. 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 Point2D Example 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. Example Ellipse2DConstructionMode = UserEllipse2D.Construction UserEllipse2D.Construction = True

Continuity Gets the geometric continuity highest level of the 2D ellipse. Syntax Continuity as Short Example 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 Point2D Example EllipseEndPoint = UserEllipse2D.EndPoint UserEllipse2D.EndPoint = UserPoint2D

GeometricType Gets the type of the geometrical element. Syntax GeometricType as Long = 8, indicates that the geometrical element is a 2D ellipse. Example GeometricalElementType = UserEllipse2D.GeometricType

MajorRadius Gets the 2D ellipse major radius. Syntax MajorRadius as Double

Example UserEllipseMajorRadius = UserEllipse2D.MajorRadius

MinorRadius Gets the 2D ellipse major radius. Syntax MinorRadius as Double Example UserEllipseMinorRadius = UserEllipse2D.MinorRadius

Period Gets the period of the 2D ellipse. Syntax Period as Double Example 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 Long The label of the report name Example Ellipse2DReportName = UserEllipse2D.ReportName UserEllipse2D.ReportName = 15

StartPoint Gets or sets the start point of the 2D ellipse. Syntax StartPoint as Point2D Example EllipseStartPoint = UserEllipse2D.StartPoint UserEllipse2D.StartPoint = UserPoint2D

Running The Macro 1. Open the Ellipse1.CATPart document.

2. Load the Ellipse1.CATScript macro. 3. Run the macro.

Parabola Definition A parabola is created from its focus, axis, focal distance, according to the horizontal axis (H) and the 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 Parabola2D iHApex 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 Double Dim 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. Example Dim Focus ( 1 ) As Double Dim 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, oCurvature iParameter 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 Double Dim 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, oDerivative iParameter 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. Example Dim Derivative ( 5 ) As Double Dim 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 Double Dim 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 Double iFirstParameter 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 Double iParameter 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. Example Dim Parameters ( 1 ) As Double Dim 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, oPoint iParameter 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. Example Dim Point ( 1 ) As Double Dim 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.

Example Dim BoundingPoint ( 3 ) As Double Dim 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, oTangent iParameter 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. Example Dim Tangent ( 2 ) As Double Dim 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. Example UserParabola2D.IsPeriodic

SetData Sets the 2D parabola focus, axis direction and focal distance.

Syntax SetData iHFocus, iVFocus, iHAxis, iVAxis, iFocalDistance iHFocus as Double The 2D parabola focus coordinate along the horizontal axis. iVFocus as Double The 2D parabola focus coordinate along the vertical axis. iHAxis as Double The 2D parabola axis direction coordinate along the horizontal axis. iVAxisas Double The 2D parabola axis direction coordinate along the vertical axis. iFocalDistance as Double The 2D parabola focal distance. Example UserParabola2D.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. Example Parabola2DConstructionMode = UserParabola2D.Construction UserParabola2D.Construction = True

Continuity Gets the geometric continuity highest level of the 2D parabola. Syntax Continuity as Short Example ParabolaContinuity = UserParabola2D.Continuity

EndPoint Gets or sets the end point of the 2D parabola. Syntax EndPoint as Point2D

Example ParabolaEndPoint = UserParabola2D.EndPoint UserParabola2D.EndPoint = UserPoint2D

FocalDistance Gets the 2D parabola focal distance. Syntax FocalDistance as Double Example 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. Example GeometricalElementType = 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 Double Example 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 Long The label of the report name Example

Parabola2DReportName = UserParabola2D.ReportName UserParabola2D.ReportName = 15

StartPoint Gets or sets the start point of the 2D parabola. Syntax StartPoint as Point2D Example ParabolaStartPoint = UserParabola2D.StartPoint UserParabola2D.StartPoint = UserPoint2D

Running The Macro 1. Open the Parabola1.CATPart document.

2. Load the Parabola1.CATScript macro. 3. Run the macro.

Hyperbola Definition A hyperbola is created from its center, axis, radius and imaginary radius, according to the horizontal 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 ) as Hyperbola2D iHCenter as Double The 2D hyperbola center coordinate along the horizontal axis iVCenter 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 Set 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. Example Dim AxisDirection ( 1 ) As Double Dim 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. Example Dim Center ( 1 ) As Double Dim 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, oCurvature iParameter 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 Double Dim 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, oDerivative iParameter 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. Example Dim Derivative ( 5 ) As Double Dim 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. Example Dim EndPoints ( 3 ) As Double Dim 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 Double iFirstParameter 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 Double iParameter 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. Example Dim Parameters ( 1 ) As Double Dim 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, oPoint iParameter 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. Example Dim Point ( 1 ) As Double Dim 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. Example Dim BoundingPoint ( 3 ) As Double Dim 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, oTangent iParameter 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. Example Dim Tangent ( 2 ) As Double Dim 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, iImaginaryRadius iHCenter as Double The 2D hyperbola center coordinate along the horizontal axis iVCenter 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. Example Parabola2DConstructionMode = UserHyperbola2D.Construction UserHyperbola2D.Construction = True

Continuity Gets the geometric continuity highest level of the 2D hyperbola. Syntax Continuity as Short

Example HyperbolaContinuity = UserHyperbola2D.Continuity

EndPoint Gets or sets the end point of the 2D hyperbola. Syntax EndPoint as Point2D Example HyperbolaEndPoint = UserHyperbola2D.EndPoint UserHyperbola2D.EndPoint = UserPoint2D

GeometricType Gets the type of the geometrical element. Syntax GeometricType as Long = 6, indicates that the geometrical element is a 2D hyperbola. Example GeometricalElementType = 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 Double Example 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 Long The label of the report name Example Hyperbola2DReportName = UserHyperbola2D.ReportName

UserHyperbola2D.ReportName = 15

StartPoint Gets or sets the start point of the 2D hyperbola. Syntax StartPoint as Point2D Example HyperbolaStartPoint = UserHyperbola2D.StartPoint UserHyperbola2D.StartPoint = UserPoint2D

Running The Macro 1. Open the Hyperbola1.CATPart document.

2. Load the Hyperbola1.CATScript macro. 3. Run the macro.

Creates a Conic Definition A arc combines Point, conic (Ellipse or, Parabola or Hyperbola) and Constraints methods and properties, and there are no dedicated methods or properties to manage it.

Line Definition A line is created from its start and end points, according to the horizontal axis (H) and the vertical axis (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 Line2D iH1 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 Line2D iH 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, oCurvature iParameter 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 Double Dim 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, oDerivative iParameter 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.

Example Dim Derivative ( 5 ) As Double Dim 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. Example Dim Direction ( 1 ) As Double Dim 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 Double Dim 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 Double iFirstParameter 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. Example Dim OriginPoint ( 1 ) As Double Dim 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.

Syntax GetParamAtLength ( iParameter, iLength ) as Double iParameter as Double The parameter. iLength as Double The length. Example LineParameter = 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. Example Dim Parameters ( 1 ) As Double Dim 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, oPoint iParameter 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. Example Dim Point ( 1 ) As Double Dim 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. Example Dim BoundingPoint ( 3 ) As Double Dim 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, oTangent iParameter 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. Example Dim Tangent ( 2 ) As Double Dim 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. Example UserLine2D.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.Construction UserLine2D.Construction = True

Continuity Gets the geometric continuity highest level of the 2D line. Syntax Continuity as Short Example LineContinuity = UserLine2D.Continuity

EndPoint Gets or sets the end point of the 2D line. Syntax EndPoint as Point2D Example LineEndPoint = UserLine2D.EndPoint UserLine2D.EndPoint = UserPoint2D

GeometricType Gets the type of the geometrical element. Syntax GeometricType as Long = 3, indicates that the geometrical element is a 2D line. Example GeometricalElementType = 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 Double Example 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 Long The label of the report name Example Line2DReportName = UserLine2D.ReportName UserLine2D.ReportName = 15

StartPoint Gets or sets the start point of the 2D line. Syntax StartPoint as Point2D Example LineStartPoint = UserLine2D.StartPoint UserLine2D.StartPoint = UserPoint2D

Running The Macro 1. Open the Line1.CATPart document.

2. Load the Line1.CATScript macro. 3. Run the macro.

Bitangent Line Definition A bitangent line combines Point, Line and Constraints methods and properties, and there are no dedicated methods or properties to manage it.

Point by Clicking Definition A point by clicking combines Point and Constraints methods and properties, and there are no dedicated methods or properties to manage it.

Point Definition A 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 Point2D iH 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. Example Dim Point ( 1 ) As Double Dim h, v As Double UserPoint2D.GetCoordinates ( Point ) h = Point ( 0 ) v = Point ( 1 )

SetData Sets the 2D point coordinates. Syntax SetData iH, iV iH 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. Example Point2DConstructionMode = UserPoint2D.Construction UserPoint2D.Construction = True

GeometricType Gets the type of the geometrical element. Syntax GeometricType as Long = 2, indicates that the geometrical element is a 2D point. Example GeometricalElementType = 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 Long The label of the report name Example Point2DReportName = UserPoint2D.ReportName UserPoint2D.ReportName = 15

Running The Macro 1. Open the Point1.CATPart document.

2. Load the Point1.CATScript macro. 3. Run the macro.

Equidistant Points Definition Equidistant points are created on a curve, constrained with it and between them. Equidistant points combine Point , curve (Circle, Spline, Ellipse, Parabola, Hyperbola, Line) and Constraints methods and properties, and there are no dedicated methods or properties to manage it.

CATPart Document Corner Chamfer Trim Break Symmetry Translation Rotation Scaling Offset Contour Offset

Corner Definition A corner combines Point , curve (Circle, Spline, Ellipse, Parabola, Hyperbola, Line) and Constraints methods and properties, and there are no dedicated methods or properties to manage it.

Chamfer Definition A chamfer combines Point , curve (Circle, Spline, Ellipse, Parabola, Hyperbola, Line) and Constraints methods and properties, and there are no dedicated methods or properties to manage it.

Trim Definition A trim combines Point , curve (Circle, Spline, Ellipse, Parabola, Hyperbola, Line) and Constraints methods and properties, and there are no dedicated methods or properties to manage it.

Break Definition A break combines Point , curve (Circle, Spline, Ellipse, Parabola, Hyperbola, Line) and Constraints methods and properties, and there are no dedicated methods or properties to manage it.

Symmetry Definition A symmetry combines Point , curve (Circle, Spline, Ellipse, Parabola, Hyperbola, Line) and Constraints methods and properties, and there are no dedicated methods or properties to manage it.

Translation Definition A translation combines Point , curve (Circle, Spline, Ellipse, Parabola, Hyperbola, Line) and Constraints methods and properties, and there are no dedicated methods or properties to manage it.

Rotation Definition A rotation combines Point , curve (Circle, Spline, Ellipse, Parabola, Hyperbola, Line) and Constraints methods and properties, and there are no dedicated methods or properties to manage it.

Scaling Definition A scaling combines Point , curve (Circle, Spline, Ellipse, Parabola, Hyperbola, Line) and Constraints methods and properties, and there are no dedicated methods or properties to manage it.

Offset Definition An offset combines Point , curve (Circle, Spline, Ellipse, Parabola, Hyperbola, Line) and Constraints methods and properties, and there are no dedicated methods or properties to manage it.

Contour Offset Definition A contour offset combines Point , curve (Circle, Spline, Ellipse, Parabola, Hyperbola, Line) and Constraints methods and properties, and there are no dedicated methods or properties to manage it.

Sketcher Basics Properties Reference Axis

Properties Definition Sketch properties.

Methods CloseEdition Closes the sketch edition. Syntax CloseEdition Example UserSketch.CloseEdition

GetAbsoluteAxisData Gets the 3D reference of the sketch. Syntax GetAbsoluteAxisData oSketchReference oSketchReference 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.. Example Dim SketchReference ( 8 ) As Double Dim 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 InverseOrientation Example UserSketch.InverseOrientation

OpenEdition Opens the sketch edition. Syntax OpenEdition as Factory2D Example Set UserFactory2D = UserSketch.OpenEdition

SetAbsoluteAxisData Sets the 3D reference of the sketch. Syntax SetAbsoluteAxisData iSketchReference iSketchReference 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.. Example Dim SketchReference ( 8 ) As Double SketchReference ( 0 ) = 0.000000 SketchReference ( 1 ) = 0.000000 SketchReference ( 2 ) = 0.000000

SketchReference ( 3 ) = 1.000000 SketchReference ( 4 ) = 0.000000 SketchReference ( 5 ) = 0.000000 SketchReference ( 6 ) = 0.000000 SketchReference ( 7 ) = 1.000000 SketchReference ( 8 ) = 0.000000 UserSketch.SetAbsoluteAxisData SketchReference

Properties AbsoluteAxis Returns the absolute axis of the sketch. Syntax AbsoluteAxis as Axis2D Example SketchAbsoluteAxis = UserSketch.AbsoluteAxis

CenterLine Returns the center line of the sketch. Syntax CenterLine as Line2D Example SketchCenterLine = UserSketch.CenterLine

Constraints Returns the collection object containing the constraints of the sketch. Syntax Constraints as Constraints Example SketchConstraintsCollection = UserSketch.Constraints

Factory2D Returns the 2D factory of the sketch. Syntax Factory2D as Factory2D Example SketchFactory2D = UserSketch.Factory2D

GeometricElements Returns the collection object containing the geometrical elements of the sketch. Syntax GeometricElement as GeometricElements Example 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 Axis Definition Reference axis are the horizontal axis (H) and the vertical axis (V) defining the sketch in 2D space. 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 Line2D Example 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. Example GeometricalElementType = UserAxis2D.GeometricType

HorizontalReference Gets the horizontal reference of the sketch. Syntax

HorizontalReference as Line2D Example SketchHorizontalReference = UserAxis2D.HorizontalReference

VerticalReference Gets the vertical reference of the sketch. Syntax VerticalReference as Line2D Example SketchVerticalReference = UserAxis2D.VerticalReference

Sketcher Constraints Constraints Tangent Constraint

Constraints Definition Constraints sketcher geometric elements.

Methods AddMonoEltCst Creates a new constraint applying to a single geometric element and adds it to the constraints collection. Syntax AddMonoEltCst ( iConstraintType, iElement ) as Constraint iConstraintType as Long The constraint type. See Type syntax. iElement as Reference The geometric element to be constrained. Example Set UserConstraint = CATIA.ActiveDocument.Part.Constraints.AddMonoEltCst ( 0, UserReference )

AddBiEltCst Creates a new constraint applying to two geometric elements and adds it to the constraints collection. Syntax AddBiEltCst ( iConstraintType, iFirstElement, iSecondElement ) as Constraint iConstraintType as Long The constraint type. See Type syntax. iFirstElement as Reference The first geometric element to be constrained. iSecondElement as Reference The second geometric element to be constrained. Example Set UserConstraint = CATIA.ActiveDocument.Part.Constraints.AddBiEltCst ( 0, UserReference1, UserReference2 )

AddTriEltCst Creates a new constraint applying to three geometric elements and adds it to the constraints collection. Syntax AddTriEltCst ( iConstraintType, iFirstElement, iSecondElement, iThirdElement ) as Constraint iConstraintType as Long The constraint type. See Type syntax. iFirstElement as Reference The first geometric element to be constrained. iSecondElement as Reference The second geometric element to be constrained. iThirdElement as Reference The second geometric element to be constrained. Example Set 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 Activate Example UserConstraint.Activate

Deactivate Deactivates a constraint. An deactivated constraint is not take into account during the update process. Syntax Deactivate Example 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. Example ConstraintActivity = UserConstraint.IsInactive

GetConstraintElement Gets a constraint's element. Syntax GetConstraintElement ( iElementIndex ) as Reference iElementIndex 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. Example UserReference = UserConstraint.GetConstraintElement ( 1 )

SetConstraintElement Sets a constraint's element. Syntax SetConstraintElement ( iElementIndex, iElement ) as Reference iElementIndex 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 Reference The element to be constrained. Example UserConstraint.GetConstraintElement ( 2, UserReference )

GetConstraintVisuLocation Returns the constraint's visualisation location. When displayed on screen, the constraint is visualized as a dimension positioned close to the constrained geometric elements. This method retrieves the data used to position this representation within the 3D space. Syntax GetConstraintVisuLocation ( oAnchorPoint, oAnchorVector )

oAnchorPoint as Double A safe array with 3 elements : x, y, z point coordinates where the constraint value is displayed. The array must be previously initialized. oAnchorVector as Double A safe array with 3 elements : x, y, z vector normal to the plane coordinates onto which the constraint value is displayed. The array must be previously initialized. Example Dim ConstraintAnchorPoint ( 2 ), ConstraintAnchorVector ( 2 ) As Double Dim 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 Constraint iIndex 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 is Count.: 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 Constraint iIndex 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 is Count.: Example Set 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 4 regions 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 and Orientation. 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. Example ConstraintAngleSector = UserConstraint.AngleSector UserConstraint.AngleSector = 0

BrokenConstraintsCount Gets the number of broken constraints from the constraints collection. Syntax

BrokenConstraintsCount as Long Example 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 Double Example 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 to geometry than acually desired. This property allows user to limit these degrees of freedom without having to redefine additional constraints. 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 are required to be parallel. Their orientation can be the same or opposite. = 2, in addition to being positioned at a specified distance, constrained elements are required to be parallel, and their orientations are required to be the same. = 3, in addition to being positioned at a specified distance, constrained elements are required to be parallel, and their orientations are required to be opposite. Example

ConstraintDistanceConfiguration = UserConstraint.DistanceConfig UserConstraint.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. Example ConstraintDistanceDirection = UserConstraint.DistanceDirection UserConstraint.DistanceDirection = 0

Mode Gets or sets the constraint's driving mode. For constraint types supporting the concept of value, such as distance constraints, the driving mode tells whether the constraint value actually drives the geometry position, or, conversely, is driven by it. Syntax Mode as Long = 0, the constraint mode, the value assigned to the constraint drives the actual position of the constrained geometry. = 1, the measure mode, the constraint value only reflects what can be observed from the actual position of the constrained geometry. Example ConstraintMode = UserConstraint.Mode UserConstraint.Mode = 1

Orientation Gets or sets the constraint's orientation. This is used for constraints that involve two geometric elements and specifies the orientation for the second geometric element with regard to the first one, when several possible orientations are all satisfying the constraint. Syntax Orientation as Long = 0, the characteristic vectors associated to the constrained elements have same orientation.

= 1, the characteristic vectors associated to the constrained elements have opposite orientation. = 2, the relative orientation of the characteristic vectors associated to the constrained elements is not specified. Example ConstraintOrientation = UserConstraint.Orientation UserConstraint.Orientation = 0

Side Gets or sets the constraint's side. Some constraint types need to relatively position the constrained geometries, when several possible configurations are all satisfying the constraint. Syntax Side as Long = 0, the first constrained element characteristic vector points towards the second constrained 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 second constrained 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 with regard to the first one: a positive value means in the direction of first constrained element characteristic vector, a negative value in the opposite direction. = 3, Arithmetic sign of constraint value specifies where second element lies with regard to first one: a negative value means in the direction of first constrained element characteristic vector, a positive value in the opposite direction. = 4, the relative positionning of constrained elements is not defined. Example ConstraintSide = UserConstraint.Side UserConstraint.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 geometric elements (e.g. planes are parallel and at the specified distance, but their orientation is inverted 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. Example ConstraintStatus = 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. Example ConstraintType = UserConstraint.Type UserConstraint.Type = 1

UnUpdatedConstraintsCount Gets the number of not updated constraints from the constraints collection. Syntax BrokenConstraintsCount as Long

Example BrokenConstraints = UserConstraintsCollection.BrokenConstraintsCount

Tangent Constraint Definition Sets a tangent constraints between sketch elements. These macros use the methods and properties described in Sketcher Constraints.

Running The Macro 1. Open the Constraint1.CATPart document. 2. Load the Constraint1.CATScript macro. 3. Run the macro. 4. Open the Constraint2.CATPart document. 5. Load the Constraint2.CATScript macro. 6. Run the macro.

Glossary A autoconstraint autodetection

A constraint applied to an iso-element (a group of elements). An assistant for visualizing and, if needed, creating constraints between elements using the Sketcher.

C cartesian 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. A construction element is an element that is internal to, and only construction element visualized 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.

D driving constraint

A constraint that drives the behaviour of the corresponding geometry.

I isobarycenter

A center of gravity created between previously selected elements.

O offset

A distance at which a duplicated line type element or curve type element can be positioned.

P polar coordinate profile

The coordinates of an element defined according to the radius and the angle of this element. An open or closed shape including arcs and lines created by the profile command in the Sketcher workbench.

R rotation

An operation for moving elements via duplication.

S scaling

An operation that resizes features to a percentage of their initial sizes.

sketch

A set of geometric elements created in the Sketcher workbench. For instance, a sketch may include a profile, construction lines and points.

SmartPick

An assistant for visualizing and, if needed, creating constraints between elements using the Sketcher.

standard element

Any type of element.

symmetry

An operation for repeating elements.

T translation

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.

U use edge

A 2D trace resulting from a 3D projection or intersection.

Index A AbsoluteAxis Activate AddBiEltCst AddMonoEltCst AddTriEltCst AngleSector Axis2D

B BrokenConstraintsCount

C CenterLine CenterPoint

,

Circle2D CloseEdition Constraint Constraints

,

Construction Continuity

, ,

, ,

, ,

ControlPoint2D CreateCircle CreateClosedCircle CreateClosedEllipse CreateControlPoint CreateEllipse CreateHyperbola CreateLine CreateLineFromVector CreateParabola

, ,

, ,

,

CreatePoint CreateSpline

D Deactivate Dimension.Value DistanceConfig DistanceDirection Documents.Add Documents.Open

E Ellipse2D EndPoint

,

,

,

,

,

F Factory2D FocalDistance

G GeometricElements GeometricType

,

,

,

,

,

GetAbsoluteAxisData GetAxis

,

GetCenter

,

,

,

GetConstraintElement GetConstraintVisuLocation GetControlPoints GetCoordinates GetCurvature GetDerivatives GetDirection

, ,

, ,

, ,

, ,

, ,

,

,

,

GetEndPoints

,

,

,

,

,

GetItem GetLengthAtParam

,

,

,

.

,

,

,

,

,

,

GetMajorAxis GetMinorAxis GetOrigin GetParamAtLength GetParamExtents

,

,

,

,

,

GetPointAtParam

,

,

,

,

,

GetRangeBox

,

,

,

,

GetTangent

, ,

,

,

,

,

H HorizontalReference Hyperbola2D

I InverseOrientation IsInactive IsPeriodic Item

L Line2D

M MajorRadius MinorRadius Mode

,

,

,

,

,

O OpenEdition Orientation

P Parabola2D Period

,

,

,

,

,

Point2D

R Radius Remove ReportName

,

,

,

,

,

S SetAbsoluteAxisData SetConstraintElement SetConstraintVisuLocation SetData

,

,

,

,

,

,

Side Sketch Sketches Spline2D StartPoint Status

,

,

,

,

,

,

T Type

U UnUpdatedConstraintsCount

V VerticalReference