Table Of Content

The CATIA - Part Design Journaling Guide has been designed to show you how ...... Creates and returns a new assembly operation within the current body, see ...
5MB taille 265 téléchargements 578 vues
Part Design Journaling Preface Basic Tasks Advanced Tasks Glossary Index

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

Preface The CATIA - Part Design Journaling Guide has been designed to show you how to create ap art 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 - Part Design 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 Sketch-Based Features Dress-Up Features Surface-Based Features Transformation Features Part Basics Part 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 Properties and 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 Part Design Journaling Guide directory sample. 3. Load the OpenCATPart1.CATScript macro. 4. Run the macro.

Sketch-Based Features Pad Drafted Filleted Pad Pocket Drafted Filleted Pocket Shaft Groove Hole Rib Slot Stiffener

Pad Definition A pad is created by extruding a profile represented by a sketch in one or two opposite directions. It is a "positive" shape: it adds material to the body it belongs to.

Methods ShapeFactory.AddNewPad Creates a new pad within the current body from a sketch and a height. Syntax ShapeFactory.AddNewPad ( iSketch, iHeight ) as Pad iSketch as Sketch The sketch defining the pad base. iHeight as Double The pad height. Example Set UserPad = CATIA.ActiveDocument.Part.ShapeFactory.AddNewPad ( UserSketch, 20.000000 )

ShapeFactory.AddNewPadFromRef Creates a new pad within the current body from a reference and a height. Syntax ShapeFactory.AddNewPadFromRef ( iProfileElement, iHeight ) as Pad iProfileElement as Reference The reference on the element defining the pad base. iHeight as Double The pad height. Example Set UserPad = CATIA.ActiveDocument.Part.ShapeFactory.AddNewPadFromRef ( UserReference, 20.000000 )

GetDirection Gets the pad direction with absolute coordinates. Syntax GetDirection ( oDirection )

oDirection as Double A safe array with three elements : x, y, z direction coordinates. The array must be previously initialized. Example Dim PadDirection ( 2 ) As Double Dim x, y, z As Double UserPad.GetDirection ( PadDirection ) x = PadDirection ( 0 ) y = PadDirection ( 1 ) z = PadDirection ( 2 )

SetDirection Sets the pad associative direction. Syntax SetDirection ( iDirection ) iDirection as Reference The pad direction. Example UserPad.SetDirection ( UserReference )

ReverseInnerSide Reverses the pad inner side when the profile is open. This is useful for finding the shape to reach. Syntax ReverseInnerSide Example UserPad.ReverseInnerSide

Properties DirectionType Gets or sets the pad direction type. Syntax DirectionType as Long = 0, the pad direction is normal to its sketch. = 1, otherwise. Example

PadDirectionType = UserPad.DirectionType UserPad.DirectionType = 0

DirectionOrientation Gets or sets the pad direction orientation. Syntax DirectionOrientation as Long = 0, the pad is extruded with the same orientation as the one given by its extrusion direction vector. = 1, the pad is extruded with the reverse orientation as the one given by its extrusion direction vector. Example PadDirectionOrientation = UserPad.DirectionOrientation UserPad.DirectionOrientation = 0

FirstLimit.Dimension.Value Gets or sets the pad first limit length. This property is valid for the offset limit mode only: FirstLimit.LimitMode = 0 Syntax FirstLimit.Dimension.Value as Double Example PadFirstLimitDimension = UserPad.FirstLimit.Dimension.Value UserPad.FirstLimit.Dimension.Value = 20.000000

FirstLimit.LimitMode Gets or sets the pad first limit type. Syntax FirstLimit.LimitMode as Long = 0, length. = 1, up to next. = 2, up to last. = 3, up to plane. = 4, up to surface. Example PadFirstLimitLimitMode = UserPad.FirstLimit.LimitMode UserPad.FirstLimit.LimitMode = 0

FirstLimit.LimitingElement Gets or sets the pad first limiting element. This property is valid when the limiting object is a surface or a plane: FirstLimit.LimitMode = 3 or

4 Syntax FirstLimit.LimitingElement as Reference Example PadFirstLimitLimitingElement = UserPad.FirstLimit.LimitingElement UserPad.FirstLimit.LimitingElement = UserReference

IsSymmetric Gets or sets the pad symmetry flag. Syntax IsSymmetric as Boolean = True, the pad is symmetric. = False, the pad is not symmetric. Example PadSymmetry = UserPad.IsSymmetric UserPad.IsSymmetric = True

Pad Dimensions an object as pad. Example Dim UserPad as Pad

SecondLimit.Dimension.Value Gets or sets the pad second limit length. This property is valid for the offset limit mode only: SecondLimit.LimitMode = 0 Syntax SecondLimit.Dimension.Value as Double Example PadSecondLimitDimension = UserPad.SecondLimit.Dimension.Value UserPad.SecondLimit.Dimension.Value = 20.000000

SecondLimit.LimitMode Gets or sets the pad second limit type. Syntax SecondLimit.LimitMode as Long = 0, length. = 1, up to next. = 2, up to last. = 3, up to plane.

= 4, up to surface. Example PadSecondLimitLimitMode = UserPad.SecondLimit.LimitMode UserPad.SecondLimit.LimitMode = 0

SecondLimit.LimitingElement Gets or sets the pad second limiting element. This property is valid when the limiting object is a surface or a plane: SecondLimit.LimitMode = 3 or 4 Syntax SecondLimit.LimitingElement as Reference Example PadSecondLimitLimitingElement = UserPad.SecondLimit.LimitingElement UserPad.SecondLimit.LimitingElement = UserReference

Shapes.Item Gets a shape using its index or its name from the Shapes collection. Syntax Shapes.Item ( iIndex ) as Pad iIndex The index or the name of the shape to retrieve from the collection of shapes. As a numerics, this index is the rank of the shape in the collection. Example Set UserPad= UserBody.Shapes.Item ( "Pad.1" )

Sketch Gets the pad's sketch. Syntax Sketch as Sketch Example Set SketchOfUserPad = UserPad.Sketch

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

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

Drafted Filleted Pad Definition A pad is created by extruding a profile represented by a sketch in one direction, while drafting its lateral faces and filleting its edges. The drafted filleted pad combines Pad, Draft Angle and Edge Fillet methods and properties. It is a "positive" shape: it adds material to the body it belongs to.

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

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

Pocket Definition A pocket is created by extruding a profile represented by a sketch in one or two opposite directions. It is a "negative" shape: it removes material to the body it belongs to.

Methods ShapeFactory.AddNewPocket Creates a new pocket within the current body from a sketch and a height. Syntax ShapeFactory.AddNewPocket ( iSketch, iHeight ) as Pocket iSketch as Sketch The sketch defining the pocket base. iHeight as Double The pocket height. Example Set UserPocket = CATIA.ActiveDocument.Part.ShapeFactory.AddNewPocket ( UserSketch, 20.000000 )

ShapeFactory.AddNewPocketFromRef Creates a new pad within the current body from a reference and a height. Syntax ShapeFactory.AddNewPocketFromRef ( iProfileElement, iHeight ) as Pocket iProfileElement as Reference The reference on the element defining the pocket base. iHeight as Double The pocket height. Example Set UserPocket = CATIA.ActiveDocument.Part.ShapeFactory.AddNewPocketFromRef ( UserReference, 20.000000 )

GetDirection Gets the pocket direction with absolute coordinates. Syntax

GetDirection (oDirection) oDirection A safe array with three elements : x, y, z direction coordinates. The array must be previously initialized. Example Dim PocketDirection ( 2 ) As Double Dim x, y, z As Double UserPocket.GetDirection ( PocketDirection ) x = PocketDirection ( 0 ) y = PocketDirection ( 1 ) z = PocketDirection ( 2 )

ReverseInnerSide Reverses the pocket inner side when the profile is open. This is useful for finding the shape to reach. Syntax ReverseInnerSide Example UserPocket.ReverseInnerSide

SetDirection Sets the pocket associative direction. Syntax SetDirection ( iDirection ) iDirection as Reference The pocket direction. Example UserPocket.SetDirection ( UserReference )

Properties DirectionType Gets or sets the pocket direction type. Syntax DirectionType as Long = 0, the pocket direction is normal to its sketch. = 1, otherwise.

Example PocketDirectionType = UserPocket.DirectionType UserPocket.DirectionType = 0

DirectionOrientation Gets or sets the pocket direction orientation. Syntax DirectionOrientation as Long = 0, the pocket is extruded with the same orientation as the one given by its extrusion direction vector. = 1, the pocket is extruded with the reverse orientation as the one given by its extrusion direction vector. Example PocketDirectionOrientation = UserPocket.DirectionOrientation UserPocket.DirectionOrientation = 0

FirstLimit.Dimension.Value Gets or sets the pocket first limit depth. This property is valid for the offset limit mode only: FirstLimit.LimitMode = 0 Syntax FirstLimit.Dimension.Value as Double Example PocketFirstLimitDimension = UserPocket.FirstLimit.Dimension.Value UserPocket.FirstLimit.Dimension.Value = 20.000000

FirstLimit.LimitMode Gets or sets the pocket first limit type. Syntax FirstLimit.LimitMode as Long = 0, length. = 1, up to next. = 2, up to last. = 3, up to plane. = 4, up to surface. Example PocketFirstLimitLimitMode = UserPocket.FirstLimit.LimitMode UserPocket.FirstLimit.LimitMode = 0

FirstLimit.LimitingElement Gets or sets the pocket first limiting element.

This property is valid when the limiting object is a surface or a plane: FirstLimit.LimitMode = 3 or 4 Syntax FirstLimit.LimitingElement as Reference Example PocketFirstLimitLimitingElement = UserPocket.FirstLimit.LimitingElement UserPocket.FirstLimit.LimitingElement = UserReference

IsSymmetric Gets or sets the pocket symmetry flag. Syntax IsSymmetric as Boolean = True, the pocket is symmetric. = False, the pocket is not symmetric. Example PocketSymmetry = UserPocket.IsSymmetric UserPocket.IsSymmetric = True

Pocket Dimensions an object as pocket. Example Dim UserPocket as Pocket

SecondLimit.Dimension.Value Gets or sets the pocket second limit depth . This property is valid for the offset limit mode only: SecondLimit.LimitMode = 0 Syntax SecondLimit.Dimension.Value as Double Example PocketSecondLimitDimension = UserPocket.SecondLimit.Dimension.Value UserPocket.SecondLimit.Dimension.Value = 20.000000

SecondLimit.LimitMode Gets or sets the pocket second limit type. Syntax SecondLimit.LimitMode as Long = 0, length. = 1, up to next. = 2, up to last. = 3, up to plane.

= 4, up to surface. Example PocketSecondLimitLimitMode = UserPocket.SecondLimit.LimitMode UserPocket.SecondLimit.LimitMode = 0

SecondLimit.LimitingElement Gets or sets the pocket second limiting element. This property is valid when the limiting object is a surface or a plane: SecondLimit.LimitMode = 3 or 4 Syntax SecondLimit.LimitingElement as Reference Example PocketSecondLimitLimitingElement = UserPocket.SecondLimit.LimitingElement UserPocket.SecondLimit.LimitingElement = UserReference

Shapes.Item Returns a shape using its index or its name from the Shapes collection. Syntax Shapes.Item (iIndex) as Pocket iIndex The index or the name of the shape to retrieve from the collection of shapes. As a numerics, this index is the rank of the shape in the collection. Example Set UserPocket= UserBody.Shapes.Item ( "Pocket.1" )

Sketch Gets the pocket's sketch. Syntax Sketch as Sketch Example Set SketchOfUserPocket = UserPocket.Sketch

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

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

Drafted Filleted Pocket Definition A pocket is created by extruding a profile represented by a sketch in one direction, while drafting its lateral faces and filleting its edges. The drafted filleted pocket combines Pocket, Draft Angle and Edge Fillet methods and properties. It is a "negative" shape: it removes material to the body it belongs to.

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

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

Shaft Definition A shaft is made up of a sketch, used as the shaft profile, and containing an axis, used as the revolution axis, and two limiting angles around this axis. This is a "positive" shape: it adds material to the body it belongs to.

Methods ShapeFactory.AddNewShaft Creates a new shaft within the current body from a sketch. Syntax ShapeFactory.AddNewShaft ( iSketch ) as Shaft iSketch as Sketch The sketch defining the shaft section. If the shaft applies to the current body, then the sketch must contain a contour and an axis that will be used to rotate the contour in the space, thus defining the shaft. If the shaft is the first shape defined, there is not current body to apply to. In such a case, the sketch must contain a curve whose end points are linked by an axis. By rotating the curve in the space around the axis, the shaft operation will define a revolution shape. This also works if the sketch contains a closed contour and an axis outside of this contour: in that case a revolution shape will be created, for example a torus. Example Set UserPad = CATIA.ActiveDocument.Part.ShapeFactory.AddNewShaft ( UserSketch )

Properties FirstAngle.Value Gets or sets the revolution first angle. This angle is computed around the revolution axis, starting from the sketch plane trace on the plane perpendicular to the revolution axis, and is counted positive clockwise when looking at this plane in the revolution axis direction. Syntax FirstAngle.Value as Double Example ShaftFirstAngle = UserShaft.FirstAngle.Value UserShaft.FirstAngle.Value = 0.000000

SecondAngle.Value Gets or sets the revolution second angle. This angle is computed around the revolution axis, starting from the sketch plane trace on the plane perpendicular to the revolution axis, and is counted positive counterclockwise when looking at this plane in the revolution axis direction. Its default value is 0. Syntax SecondAngle.Value as Double Example ShaftSecondAngle = UserShaft.SecondAngle.Value UserShaft.SecondAngle.Value = 360.000000

Shaft Dimensions an object as shaft. Example Dim UserShaft as Shaft

Sketch Gets the shaft's sketch. Syntax Sketch as Sketch Example Set SketchOfUserShaft = UserShaft.Sketch

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

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

Groove Definition A groove is made up of a sketch, used as the groove profile, and containing an axis, used as the revolution axis, and two limiting angles around this axis. This is a "negative" shape: it adds material to the body it belongs to.

Methods ShapeFactory.AddNewGroove Creates a new groove within the current body from a sketch. Syntax ShapeFactory.AddNewGroove ( iSketch ) as Groove iSketch as Sketch The sketch defining the groove section. The sketch must contain a contour and an axis that will be used to rotate the contour in the space, thus defining the groove. The contour has to penetrate in 3D space the current shape. Example Set UserGroove = CATIA.ActiveDocument.Part.ShapeFactory.AddNewGroove ( UserSketch )

Properties FirstAngle.Value Gets or sets the revolution first angle. This angle is computed around the revolution axis, starting from the sketch plane trace on the plane perpendicular to the revolution axis, and is counted positive clockwise when looking at this plane in the revolution axis direction. Syntax FirstAngle.Value as Double Example GrooveFirstAngle = UserGroove.FirstAngle.Value UserGroove.FirstAngle.Value = 0.000000

Groove Dimensions an object as Groove.

Example Dim UserGroove as Groove

SecondAngle.Value Gets or sets the revolution second angle. This angle is computed around the revolution axis, starting from the sketch plane trace on the plane perpendicular to the revolution axis, and is counted positive counterclockwise when looking at this plane in the revolution axis direction. Its default value is 0. Syntax SecondAngle.Value as Double Example GrooveSecondAngle = UserGroove.SecondAngle UserGroove.SecondAngle.Value = 360.000000

Sketch Gets the groove's sketch. Syntax Sketch as Sketch Example Set SketchOfUserGroove = UserGroove.Sketch

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

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

Hole Definition A hole is created by removing material from a body. Various shapes of standard holes can be created. It is a "negative" shape: it adds material to the body it belongs to.

Methods ShapeFactory.AddNewHole Creates a new hole within the current shape. Actual hole shape is defined by editing hole properties after its creation. Syntax ShapeFactory.AddNewHole ( iSupport, iDepth ) as Hole iSupport as Reference The support defining the hole reference plane. Anchor point is located at the barycenter of the support. The hole axis in 3D passes through that point and is normal to the plane. iDepth as Double The hole depth. Example Set UserHole= CATIA.ActiveDocument.Part.ShapeFactory.AddNewHole ( UserSupport, 10.000000 )

ShapeFactory.AddNewHoleFromPoint Creates a new hole within the current shape. Actual hole shape is defined by editing hole properties after its creation. Syntax ShapeFactory.AddNewHoleFromPoint ( iX, iY, iZ, iSupport, iDepth ) as Hole iX, iY, iZ as Double Origin point x, y, z absolute coordinates. Sets the origin point which the hole is anchored to. If mandatory, the entry point will be projected onto a tangent plane. iSupport as Reference The support defining the hole reference plane. iDepth as Double The hole depth.

Example Set UserHole= CATIA.ActiveDocument.Part.ShapeFactory.AddNewHoleFromPoint ( 0.000000, 0.000000, 0.000000, UserSupport, 10.000000 )

ShapeFactory.AddNewHoleFromRefPoint Creates a new hole within the current shape. Actual hole shape is defined by editing hole properties after its creation. Syntax ShapeFactory.AddNewHoleFromRefPoint ( iOrigin, iSupport, iDepth ) as Hole iOrigin as Reference The origin point which the hole is anchored to. iSupport as Reference The support defining the hole reference plane. iDepth as Double The hole depth. Example Set UserHole= CATIA.ActiveDocument.Part.ShapeFactory.AddNewHoleFromRefPoint ( UserOrigin, UserSupport, 10.000000 )

ShapeFactory.AddNewHoleFromSketch Creates a new hole within the current shape. Actual hole shape is defined by editing hole properties after its creation. Syntax ShapeFactory.AddNewHoleFromSketch ( iSketch, iDepth ) as Hole iSketch as Sketch The sketch defining the hole reference plane and anchor point. This sketch must contain a single point that defines the hole axis: the hole axis in 3D passes through that point and is normal to the sketch plane. iDepth as Double The hole depth. Example Set UserHole= CATIA.ActiveDocument.Part.ShapeFactory.AddNewHoleFromSketch( UserSketch, 10.000000 )

ShapeFactory.AddNewHoleWithConstraint Creates a new hole within the current shape. Actual hole shape is defined by editing hole properties after its creation. Syntax ShapeFactory.AddNewHoleWithConstraint ( iX, iY, iZ, iEdge, iSupport, iDepth ) as Hole

iX, iY, iZ as Double Origin point x, y, z absolute coordinates. Sets the origin point which the hole is anchored to. If mandatory, the entry point will be projected onto a tangent plane. iEdge as Reference The edge which the hole is constrained to. If edge is circular, the origin of the hole will be concentric to the edge (iX, iY, iZ will be overridden). If not, the origin of the hole will have a length constraint with the edge. iSupport as Reference The support defining the hole reference plane. iDepth as Double The hole depth. Example Set UserHole= CATIA.ActiveDocument.Part.ShapeFactory.AddNewHoleWithConstraint ( 0.000000, 0.000000, 0.000000, UserEdge, UserOrigin, UserSupport, 10.000000 )

ShapeFactory.AddNewHoleWith2Constraints Creates a new hole within the current shape. Actual hole shape is defined by editing hole properties after its creation. Syntax ShapeFactory.AddNewHoleWith2Constraints ( iX, iY, iZ, iEdge1, iEdge2, iSupport, iDepth ) as Hole iX, iY, iZ as Double Origin point x, y, z absolute coordinates. Sets the origin point which the hole is anchored to. If mandatory, the entry point will be projected onto a tangent plane. iEdge1 as Reference The first edge which the hole is constrained to. The origin of the hole will have a length constraint with the first edge. iEdge2 as Reference The second edge which the hole is constrained to. The origin of the hole will have a length constraint with the second edge. iSupport as Reference The support defining the hole reference plane. iDepth as Double The hole depth. Example Set UserHole= CATIA.ActiveDocument.Part.ShapeFactory.AddNewHoleWith2Constraints ( 0.000000, 0.000000, 0.000000, UserEdge1, UserEdge2, UserOrigin, UserSupport, 10.000000 )

GetDirection Gets the hole direction with absolute coordinates. Syntax GetDirection (oDirection) oDirection as Double A safe array with three elements : x, y, z direction coordinates. The array must be previously initialized. Example Dim HoleDirection ( 2 ) As Double Dim x, y, z As Double UserHole.GetDirection ( HoleDirection ) x = HoleDirection ( 0 ) y = HoleDirection ( 1 ) z = HoleDirection ( 2 )

SetDirection Sets the hole associative direction. Syntax SetDirection as Reference Example UserHole.SetDirection = UserReference

GetOrigin Gets the origin point which the hole is anchored to. This point belongs to a tangent plane. Syntax GetOrigin (oOrigin) oOrigin as Double A safe array with three elements : x, y, z hole origin point coordinates. The array must be previously initialized. Example Dim HoleOrigin ( 2 ) As Double Dim x, y, z As Double UserHole.GetOrigin ( HoleOrigin ) x = HoleOrigin ( 0 ) y = HoleOrigin ( 1 )

z = HoleOrigin ( 2 )

SetOrigin Sets the origin point which the hole is anchored to. If mandatory, the entry point will be projected onto a tangent plane. Syntax SetOrigin ( iX, iY, iZ ) iX, iY, iZ as Double Origin point x, y, z absolute coordinates. Example UserHole.SetOrigin ( 0.000000, 0.000000, 0.000000 )

Reverse Reverses the hole direction. Syntax Reverse Example UserHole.Reverse

Properties AnchorMode Gets or sets the hole anchor mode. This property is valid when the hole type is counterbored or counterdrilled: Type = 2 or 3 Syntax AnchorMode as Long = 0, the hole is anchored with the top of its head = 1, the hole is anchored with the bottom of its head Example HoleAnchorMode = UserHole.AnchorMode UserHole.AnchorMode = 0

BottomAngle.Value Gets or sets the hole bottom angle. This property is valid when the hole bottom type is conic: BottomType = 1 Syntax BottomAngle.Value as Double Example

HoleBottomAngle = UserHole.BottomAngle.Value UserHole.BottomAngle.Value = 120.000000

BottomLimit.Dimension.Value Gets or sets the hole limit depth. This property is valid for the hole extension type is blind: BottomLimit.LimitMode = 0 Syntax BottomLimit.Dimension.Value as Double Example HoleBottomLimitDimension = UserHole.BottomLimit.Dimension.Value UserHole.BottomLimit.Dimension.Value = 20.000000

BottomLimit.LimitMode Gets or sets the hole extension type. Syntax BottomLimit.LimitMode as Long = 0, blind. = 1, up to next. = 2, up to last. = 3, up to plane. = 4, up to surface. Example HoleBottomLimitLimitMode = UserHole.BottomLimit.LimitMode UserHole.BottomLimit.LimitMode = 0

BottomLimit.LimitingElement Gets or sets the limiting element ot the hole bottom. This property is valid when the limiting object is a surface or a plane: BottomLimit.LimitMode = 3 or 4 Syntax FirstLimit.LimitingElement as Reference Example HoleFirstLimitLimitingElement = UserHole.FirstLimit.LimitingElement UserHole.FirstLimit.LimitingElement = UserReference

BottomType Gets or sets the hole bottom type. This property is valid when the hole type is simple: Type = 0 Syntax BottomType as Long

= 0, the hole bottom is flat = 1, the hole bottom is conic Example HoleBottomType = UserHole.BottomType UserHole.BottomType = 0

Diameter.Value Gets or sets the hole diameter. Syntax Diameter.Value as Double Example HoleDiameter = UserHole.Diameter.Value UserHole.Diameter.Value = 10.000000

HeadAngle.Value Gets or sets the hole head angle. This property is valid when the hole type is tapered or counterbored or counterdrilled: Type = 1 or 2 or 3 Syntax HeadAngle.Value as Double Example HoleHeadAngle = UserHole.HeadAngle.Value UserHole.HeadAngle.Value = 20.000000

HeadDepth.Value Gets or sets the hole head depth. This property is valid when the hole type is counterbored or counterdrilled or countersunk: Type = 2 or 3 or 4 Syntax HeadDepth.Value as Double Example HoleHeadDepth = UserHole.HeadDepth.Value UserHole.HeadDepth.Value = 20.000000

HeadDiameter.Value Gets or sets the hole head diameter. This property is valid when the hole type is counterbored or counterdrilled: Type = 2 or 3 Syntax HeadDiameter.Value as Double Example

HoleHeadDiameter = UserHole.HeadDiameter.Value UserHole.HeadDiameter.Value = 20.000000

Hole Dimensions an object as hole . Example Dim UserHole as hole

Sketch Gets the hole's sketch. Syntax Sketch as Sketch Example Set SketchOfUserHole = UserHole.Sketch

ThreadDepth.Value Gets or sets the hole threading depth. This property is valid when the hole is threaded: ThreadingMode = 0 Syntax ThreadDepth.Value as Double Example HoleThreadDepth = UserHole.ThreadDepth.Value UserHole.ThreadDepth = 5.000000

ThreadDiameter.Value Gets or sets the hole threading diameter. This property is valid when the hole is threaded: ThreadingMode = 0 Syntax ThreadDiameter.Value as Double Example HoleThreadDiameter = UserHole.ThreadDiameter.Value UserHole.ThreadDiameter.Value = 10.000000

ThreadPitch.Value Gets or sets the hole threading pitch. This property is valid when the hole is threaded: ThreadingMode = 0 Syntax ThreadPitch.Value as Double Example

HoleThreadPitch = UserHole.ThreadPitch.Value UserHole.ThreadPitch.Value = 1.000000

ThreadSide Gets or sets the hole threading side. This property is valid when the hole is threaded: ThreadingMode = 0 Syntax ThreadSide as Long = 0, the hole is right-threaded. = 1, the hole is left-threaded. Example HoleThreadSide = UserHole.ThreadSide UserHole.ThreadSide = 0

ThreadingMode Gets or sets the hole threading mode. Syntax ThreadingMode as Long = 0, the hole is threaded = 1, the hole is not threaded Example HoleThreadingMode = UserHole.ThreadingMode UserHole.ThreadingMode = 0

Type Gets or sets the hole type. Syntax Type as Long = 0, simple hole = 1, tapered hole = 2, counterbored hole = 3, countersunk hole = 4, counterdrilled hole Example HoleType = UserHole.Type UserHole.Type = 0

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

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

Rib Definition The rib shape is made up of a profile represented by a sketch swept along a center curve represented by another sketch. This is a "positive" shape: it adds material to the body it belongs to.

Methods ShapeFactory.AddNewRib Creates a new rib within the current body. Syntax ShapeFactory.AddNewRib ( iSketch, iCenterCurve ) as Rib iSketch as Sketch The sketch defining the rib section. iCenterCurve as Sketch The sketched curve that defines the rib center curve. It must cross the section definition sketch iSketch within the inner part of its contour. Example Set UserRib = CATIA.ActiveDocument.Part.ShapeFactory.AddNewRib ( UserSketch, UserCenterCurve )

SetKeepAngleOption Sets the Keep angle profil control option. Syntax SetKeepAngleOption Example UserRib.SetKeepAngleOption

Properties CenterCurveElement Gets or sets the rib's center curve. The rib is built along this reference. Syntax

CenterCurveElement as Reference Example UserRib.CenterCurveElement = UserReference Set CenterCurveElementOfUserRib = UserRib.CenterCurveElement

MergeMode Gets or sets the rib's Merge ends option. Syntax MergeMode as Long = 0, deativates the Merge ends option. = 1, activates the Merge ends option. Example RibMergeMode = UserRib.MergeMode UserRib.MergeMode = 0

PullingDirElement Gets or sets the rib's pulling direction. Sets the Pulling direction control profil option when you set a rib's pulling direction. Syntax PullingDirElement as Reference Example UserRib.PullingDirElement = UserReference Set PullingDirectionOfUserRib = UserRib.PullingDirElement

ReferenceSurfaceElement Gets or sets the rib's reference surface. Sets the Reference surface control profil option when you set a rib's reference surface. Syntax ReferenceSurfaceElement as Reference Example UserRib.ReferenceSurface = UserReference Set ReferenceSurfaceOfUserRib = UserRib.ReferenceSurfaceElement

Rib Dimensions an object as Rib. Example Dim UserRib as Rib

Sketch Gets the rib's sketch. Syntax Sketch as Sketch Example Set SketchOfUserRib = UserRib.Sketch

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

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

Slot Definition The slot shape is made up of a profile represented by a sketch swept along a center curve represented by another sketch. This is a "negative" shape: it removes material from the body it belongs to. The profile sketch is usually drawn on another shape face.

Methods ShapeFactory.AddNewSlot Creates a new slot within the current body. Syntax ShapeFactory.AddNewSlot ( iSketch, iCenterCurve ) as Slot iSketch as Sketch The sketch defining the slot section. iCenterCurve as Sketch The sketched curve that defines the slot center curve. It must cross the section definition sketch iSketch within the inner part of its contour. Example Set UserSlot = CATIA.ActiveDocument.Part.ShapeFactory.AddNewSlot ( UserSketch, UserCenterCurve )

SetKeepAngleOption Sets the Keep angle profil control option. Syntax SetKeepAngleOption Example UserSlot.SetKeepAngleOption

Properties CenterCurveElement Gets or sets the slot's center curve. The slot is built along this reference. Syntax

CenterCurveElement as Reference Example UserSlot.CenterCurveElement = UserReference Set CenterCurveElementOfUserSlot = UserSlot.CenterCurveElement

MergeMode Gets or sets the slot's Merge ends option. Syntax MergeMode as Long = 0, deativates the Merge ends option. = 1, activates the Merge ends option. Example SlotMergeMode = UserSlot.MergeMode UserSlot.MergeMode = 0

PullingDirElement Gets or sets the slot's pulling direction. Sets the Pulling direction control profil option when you set a slot's pulling direction. Syntax PullingDirElement as Reference Example UserSlot.PullingDirElement = UserReference Set PullingDirectionOfUserSlot = UserSlot.PullingDirElement

ReferenceSurfaceElement Gets or sets the slot's reference surface. Sets the Reference surface control profil option when you set a slot's reference surface. Syntax ReferenceSurfaceElement as Reference Example UserSlot.ReferenceSurface = UserReference Set ReferenceSurfaceOfUserSlot = UserSlot.ReferenceSurfaceElement

Sketch Gets the slot's sketch Syntax Sketch as Sketch Example

Set SketchOfUserSlot = UserSlot.Sketch

Slot Dimensions an object as Slot. Example Dim UserSlot as Slot

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

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

Stiffener Definition A stiffener is made up of a sketch used as the stiffener profile, that is extruded (offset) and that fills the nearest shape. This is a "positive" shape: it adds material to the body it belongs to.

Methods ShapeFactory.AddNewStiffener Creates a new stiffener within the current body. A stiffener is made up of a sketch used as the stiffener profile, that is extruded (offset) and that fills the nearest shape. Syntax ShapeFactory.AddNewStiffener ( iSketch ) as Stiffener iSketch as Sketch The sketch defining the stiffener border. It must contain a line or a curve that does not cross in 3D space the faces to be stiffened. Example Set UserStiffener = CATIA.ActiveDocument.Part.ShapeFactory.AddNewStiffener ( UserSketch )

ReverseDepth Reverses the stiffener direction. This is useful for finding the shape to reach. Syntax ReverseDepth Example UserStiffener.ReverseDepth

ReverseThickness Reverses the stiffener thickness direction. The stiffener thickness is swapped with respect to the base sketch. Syntax ReverseThickness Example UserStiffener.ReverseThickness

Properties IsSymmetric Gets or sets the stiffener symmetry flag. Syntax IsSymmetric as Long = True, the stiffener is symmetric. = False, the stiffener is not symmetric. Example StiffenerSymmetry = UserStiffener.IsSymmetric UserStiffener.IsSymmetric = True

Sketch Gets the stiffener's sketch. Syntax Sketch as Sketch Example Set SketchOfUserStiffener = UserStiffener.Sketch

Stiffener Dimensions an object as Stiffener. Example Dim UserStiffener as Stiffener

Thickness.Value Gets or sets the stiffener thickness. This is half of the thickness if the stiffener is symmetrical, and the thickness otherwise. Syntax Thickness.Value as Double Example StiffenerThickness = UserStiffener.Thickness.Value UserStiffener.Thickness.Value = 10.000000

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

2. Load the Stiffener1.CATScript macro.

3. Run the macro.

Dress-Up Feature Edge Fillet Variable Radius Fillet Face-Face Fillet Tritangent Fillet Chamfer Draft Angle Draft Reflect Line Shell Thickness

Edge Fillet Definition The resulting shape is made up of edge fillets built with a constant radius.

Methods ShapeFactory.AddNewEdgeFilletWithConstantRadius Creates a new edge fillet with a constant radius within the current body. Syntax ShapeFactory.AddNewEdgeFilletWithConstantRadius ( iEdgeToFillet, ) as ConstRadEdgeFillet iEdgeToFillet as Reference The first edge to be filleted. iEdgePropagation as Long Controls whether other edges found adjacent to the first one should also be filleted in the same operation. See EdgePropagation syntax. iRadius as Double The fillet radius. Example Set UserEdgeFillet = CATIA.ActiveDocument.Part.ShapeFactory.AddNewEdgeFilletWithConstantRadius ( UserEdge, 1, 5.000000 )

AddEdgeToKeep Adds a new edge to be kept by the filleting operation. The edge to be kept is not modified by the fillet. Syntax AddEdgeToKeep ( iEdgeToBeKept ) iEdgeToBeKept as Reference The edge to be kept by the filleting operation. Example UserEdgeFillet.AddEdgeToKeep ( UserEdge )

WithdrawEdgeToKeep Removes an edge from those kept by a filleting operation. Syntax WithdrawEdgeToKeep ( iRemoveEdgeToBeKept ) iRemoveEdgeToBeKept as Reference The edge to be removed from those kept by the filleting operation. Example UserEdgeFillet.WithdrawEdgeToKeep ( UserEdge )

AddObjectToFillet Adds a new element to be filleted. This element is usually an edge. Syntax AddObjectToFillet ( iObjectToBeFilleted ) iObjectToBeFilleted as Reference The new element to be filleted. Example UserEdgeFillet.AddObjectToFillet ( UserEdge )

WithdrawObjectToFillet Removes a element from those to be filleted. This element is usually an edge. Syntax WithdrawObjectToFillet ( iObjectToBeRemoved ) iObjectToBeRemoved as Reference The element to be removed. Example UserEdgeFillet.WithdrawObjectToFillet ( UserEdge )

Properties ConstRadEdgeFillet Dimensions an object as edge fillet. Example Dim UserEdgeFillet as ConstRadEdgeFillet

EdgePropagation Gets or sets the edge fillet propagation mode.

This propagation mode is used when computing the edges to be filleted. Syntax EdgePropagation as Long = 0, the fillet is applied only to the selected edge and propagated to the first natural relimitation. = 1, the fillet is propagated to all the tangent contiguous edges. Example EdgeFilletEdgePropagation = UserEdgeFillet.EdgePropagation UserEdgeFillet.EdgePropagation = 0

EdgesToKeep Gets the collection of edges to be kept by the edge fillet. Syntax EdgesToKeep as References Example Set EdgesKeptCollection = UserEdgeFillet.EdgesToKeep

ObjectsToFillet Gets the collection of reference elements to be filleted. Syntax ObjectsToFillet as References Example Set FilletedObjectsCollection = UserEdgeFillet.ObjectsToFillet

Radius.Value Gets or sets the edge fillet constant radius. Syntax Radius.Value as Double Example EdgeFilletRadius = UserEdgeFillet.Radius.Value UserEdgeFillet.Radius.Value = 5.000000

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

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

Variable Radius Fillet Definition The resulting shape is made up of edges fillets controlled by couples of radius/vertex.

Methods ShapeFactory.AddNewEdgeFilletWithVaryingRadius Creates a new edge fillet with a variable radius within the current body. Syntax ShapeFactory.AddNewEdgeFilletWithVaryingRadius ( iEdgeToFillet, iEdgePropagation, iFilletVariation, iDefaultRadius ) as VarRadEdgeFillet iEdgeToFillet as Reference The first edge to be filleted. iEdgePropagation as Long Controls whether other edges found adjacent to the first one should also be filleted in the same operation. See EdgePropagation syntax. iFilletVariation as Long Controls the law of evolution for the fillet radius between specified control points, such as edges extremities. See FilletVariation syntax. iDefaultRadius as Double The fillet radius. Example Set UserVariableRadiusFillet = CATIA.ActiveDocument.Part.ShapeFactory.AddNewEdgeFilletWithVaryingRadius ( UserEdge, 0, 1, 5.000000 )

AddEdgeToKeep Adds a new edge to be kept by the filleting operation. The edge to be kept is not modified by the fillet. Syntax AddEdgeToKeep ( iEdgeToBeKept ) iEdgeToBeKept as Reference The edge to be kept by the filleting operation. Example

UserVariableRadiusFillet.AddEdgeToKeep ( UserEdge )

WithdrawEdgeToKeep Removes an edge from those kept by a filleting operation. Syntax WithdrawEdgeToKeep ( iRemoveEdgeToBeKept ) iRemoveEdgeToBeKept as Reference The edge to be removed from those kept by the filleting operation. Example UserVariableRadiusFillet.WithdrawEdgeToKeep ( UserEdge )

AddEdgeToFillet Adds a new edge to the variable radius edge fillet. Syntax AddEdgeToFillet ( iEdge, iRadius ) iEdge as Reference The edge to be filleted. iRadius as Double The radius to impose along the edge. This radius is imposed at both end points of the edge. Example UserVariableRadiusFillet.AddEdgeToFillet ( UserEdge, 10.000000 )

WithdrawEdgeToFillet Removes an edge from the variable radius fillet. Syntax WithdrawEdgeToFillet ( iEdge ) iEdge as Reference The edge to be removed. Example UserVariableRadiusFillet.WithdrawEdgeToFillet ( UserEdge )

AddImposedVertex Adds a new control couple. A control couple is made up of a vertex and a radius. Syntax AddImposedVertex ( iVertex, iRadius ) iVertex as Reference

The vertex where to impose the radius. iRadius as Double The radius to be imposed with iVertex. Example UserVariableRadiusFillet.AddImposedVertex ( UserVertex, 10.000000 )

WithdrawImposedVertex Removes a control couple. A control couple is made up of a vertex and a radius. Syntax WithdrawImposedVertex ( iVertex ) iVertex as Reference The vertex where the radius is imposed to be removed. Example UserVariableRadiusFillet.WithdrawImposedVertex ( UserVertex )

Properties EdgePropagation Gets or sets the edge fillet propagation mode. This propagation mode is used when computing the edges to be filleted. Syntax EdgePropagation as Long = 0, the fillet is applied only to the selected edge and propagated to the first natural relimitation. = 1, the fillet is propagated to all the tangent contiguous edges. Example VariableRadiusFilletEdgePropagation = UserVariableRadiusFillet.EdgePropagation UserVariableRadiusFillet.EdgePropagation = 0

EdgesToFillet Gets the collection of edges to be filleted. Syntax EdgesToFillet as References Example Set FilletedEdgesCollection = UserVariableRadiusFillet.EdgesToFillet

EdgesToKeep Gets the collection of edges to be kept by the edge fillet. Syntax EdgesToKeep as References Example Set EdgesKeptCollection = UserVariableRadiusFillet.EdgesToKeep

FilletVariation Gets or sets the edge fillet radius variation mode. Syntax FilletVariation as Long = 0, the fillet radius varies in a linear mode. = 1, the fillet radius varies in a cubic mode. Example VariableRadiusFilletFilletVariation = UserVariableRadiusFillet.FilletVariation UserVariableRadiusFillet.FilletVariation = 0

ImposedVertexRadius Gets the fillet radius on an imposed vertex. Syntax ImposedVertexRadius ( iImposedVertex ) as Double iImposedVertex as Reference The vertex where to retrieve the fillet radius. Example UserVertexRadius = UserVariableRadiusFillet.ImposedVertices ( UserVertex )

ImposedVertices Gets the collection of vertices where a radius has been imposed. Syntax ImposedVertices as References Example Set ImposedVerticesCollection = UserVariableRadiusFillet.ImposedVertices

VarRadEdgeFillet Dimensions an object as variable radius fillet. Example Dim UserVariableRadiusFillet as VarRadEdgeFillet

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

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

Face-Face Fillet Definition A face fillet shape is built between two faces with a fillet radius.

Methods ShapeFactory.AddNewFaceFillet Creates a new face-face fillet within the current body. Syntax ShapeFactory.AddNewFaceFillet ( iF1, iF2, iRadius ) as FaceFillet iF1 as Reference The first face that will support the fillet. iF2 as Reference The second face that will support the fillet. iRadius as Double The fillet radius. Example Set UserFaceFaceFillet = CATIA.ActiveDocument.Part.ShapeFactory.AddNewFaceFillet ( UserFace1, UserFace2, 10.000000 )

Properties FaceFillet Dimensions an object as FaceFillet. Example Dim UserFaceFaceFillet as FaceFillet

FirstFace Gets or sets the first limiting face. Syntax FirstFace as Reference Example FaceFaceFilletFirstFace = UserFaceFaceFillet.FirstFace UserFaceFaceFillet.FirstFace = UserFace

Radius.Value Gets or sets the face fillet radius. Syntax Radius.Value as Double Example FaceFaceFilletRadius = UserFaceFaceFillet.Radius.Value UserFaceFaceFillet.Radius.Value = 5.000000

SecondFace Gets or sets the second limiting face. Syntax SecondFace as Reference Example FaceFaceFilletSecondFace = UserFaceFaceFillet.SecondFace UserFaceFaceFillet.SecondFace = UserFace

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

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

Tritangent Fillet Definition The Tritangent Fillet feature: a fillet is built between three faces, two faces will be relimited, the third one ("face to remove") will be used for fillet tangency and will disappear within the resulting shape.

Methods ShapeFactory.AddNewTritangentFillet Creates a new tritangent filletwithin the current body. Syntax ShapeFactory.AddNewTritangentFillet ( iF1, iF2, iRemovedFace ) as TritangentFillet iF1 as Reference The starting face for the fillet. iF2 as Reference The ending face for the fillet. iRemovedFace as Reference The face used as an intermediate tangent support for the fillet during its course from iF1 to iF2. This face will be removed at the end of the filleting operation. Example Set UserTritangentFillet = CATIA.ActiveDocument.Part.ShapeFactory.AddNewTritangentFillet ( UserFace1, UserFace2, UserFace3 )

Properties FaceToRemove Gets or sets the face to be removed by the tritangent fillet. Syntax FaceToRemove as Reference Example TritangentFilletFaceToRemove = UserTritangentFillet.FaceToRemove UserTritangentFillet.FaceToRemove = UserFace

FirstFace Gets or sets the first face limiting the tritangent fillet. Syntax FirstFace as Reference Example TritangentFilletFirstFace = UserTritangentFillet.FirstFace UserTritangentFillet.FirstFace = UserFace

SecondFace Gets or sets the second face limiting the tritangent fillet. Syntax SecondFace as Reference Example TritangentFilletSecondFace = UserTritangentFillet.SecondFace UserTritangentFillet.SecondFace = UserFace

TritangentFillet Dimensions an object as TritangentFillet. Example Dim UserTritangentFillet as TritangentFillet

Running The Macro

1. Open the TritangentFillet1.CATPart document.

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

Chamfer Definition A chamfer is made up of a list of geometrical elements to process, such as faces, and is defined using a couple of parameters, such as two lengthes, or a length and an angle.

Methods ShapeFactory.AddNewChamfer Creates a new chamfer within the current body. Syntax ShapeFactory.AddNewChamfer ( iObjectToChamfer, iPropagation, iMode, iOrientation, iLength1, iLength2OrAngle ) as Chamfer iObjectToChamfer as Reference The first edge or face to be chamfered. iPropagation as Long Controls if and how the chamfering operation should propagate beyond when the first chamfer element iObjectToChamfer is an edge. See Propagation syntax. iMode as Long Controls if the chamfer is defined with two lengthes, or with an angle and a length The value of this argument changes the way the arguments iLength1 and iLength2OrAngle should be interpreted. See Mode syntax. iOrientation as Long Defines the relative meaning of arguments iLength1 and iLength2OrAngle when defining a chamfer with two lengthes. See Orientation syntax. iLength1 as Double The first value for chamfer dimensioning. It represents the chamfer first length if the chamfer is defined with two lengthes, or the chamfer length if the chamfer is defined with a length and an angle. iLength2OrAngle as Double The second value for chamfer dimensioning. It represents the chamfer second length if the chamfer is defined with two lengthes, or the chamfer angle if the chamfer is defined with a length and an angle. Example Set UserChamfer = CATIA.ActiveDocument.Part.ShapeFactory.AddNewChamfer (

UserFace1, UserFace2, UserFace3 )

AddElementToChamfer Adds a new geometrical element to be chamfered. Syntax AddElementToChamfer ( iElementToChamfer ) iElementToChamfer The new element to be chamfered. Example UserChamfer.AddElementToChamfer ( UserReference )

WithdrawElementToChamfer Removes a geometrical element from those to be chamfered. Syntax WithdrawElementToChamfer (iElementToRemove) iElementToRemove as Reference The element to be removed. Example UserChamfer.AddElementToChamfer ( UserReference )

Properties Angle.Value Gets or sets chamfer angle. This is the angle if the chamfer is defined with a length and an angle: Mode = 1 Syntax Angle.Value as Double Example ChamferAngle = UserChamfer.Angle.Value UserChamfer.Angle.Value = 45.000000

Chamfer Dimensions an object as Chamfer. Example Dim UserChamfer as Chamfer

ElementsToChamfer Gets the collection of geometrical elements to be chamfered. Syntax ElementsToChamfer as References Example Set ChamferedElementsCollection = UserChamfer.ElementsToChamfer

Length1.Value Gets or sets chamfer first length. This is the first length if the chamfer is defined with two lengthes, or the length if the chamfer is defined with a length and an angle. Syntax Length1.Value as Double Example ChamferLength1 = UserChamfer.Length1.Value UserChamfer.Length1.Value = 2.000000

Length2.Value Gets or sets chamfer second length. This is the second length if the chamfer is defined with two lengthes: Mode = 0 Syntax Length2.Value as Double Example ChamferLength2 = UserChamfer.Length2.Value UserChamfer.Length2.Value = 2.000000

Mode Gets or sets the chamfer definition mode. The chamfer definition mode enables the chamfer to be defined using either two lengthes or a length and an angle. Syntax Mode as Long = 0, the chamfer is defined using two lengthes. = 1, the chamfer is defined using a length and an angle. Example ChamferMode = UserChamfer.Mode UserChamfer.Mode = 0

Orientation Gets or sets the chamfer orientation. Syntax Orientation as Long = 0, the chamfer reference face is the face selected or determined by CATIA = 1, the chamfer reference face is the other face. Example ChamferOrientation = UserChamfer.Orientation UserChamfer.Orientation = 0

Propagation Gets or sets the propagation mode of the geometrical elements to be chamfered. Syntax Propagation as Long = 0, the chamfer operation also chamfers any other edges found at the first edge extremities, as long as they are tangent with it. This process repeats until no more tangent edges to chamfer are found at extremities of already. chamfered ones. = 1, the chamfer operation stops as soon as an edge to chamfer cuts one or the two chamfer created edges. Example ChamferPropagation = UserChamfer.Propagation UserChamfer.Propagation = 0

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

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

Draft Angle Definition A draft angle shape is made up of draft domains (at least one) and of a parting element.

Methods ShapeFactory.AddNewDraft Creates a new draft within the current body. Syntax ShapeFactory.AddNewDraft ( iFaceToDraft, iNeutral, iNeutralPropagationMode, iParting, iDirX, iDirY, iDirZ, iMode, iAngle, iMultiselectionMode ) as Draft iFaceToDraft as Reference The first face to draft in the body. This face should be adjacent to the iFaceToDraft face. If several faces are to be drafted, only the first one is specified here, the others being inferred by propagating the draft operation onto faces adjacent to this first face. This is controlled by the iNeutralMode argument. iNeutral as Reference The reference face for the draft. The draft needs a reference face on the body, that will remain unchanged in the draft operation, while faces adjacent to it and specified for drafting will be rotated according to the draft angle iAngle. iNeutralPropagationMode as Long Controls if and how the drafting operation should be propagated beyond the first face to draft iFaceToDraft to other adjacent faces. See NeutralPropagationMode syntax. iParting as Reference The draft parting plane, face or surface. It specifies the element within the body to draft that represents the bottom of the mold. This element can be located either somewhere in the middle of the body or be one of its boundary faces. When located in the middle of the body, it crosses the faces to draft, and as a result, those faces are drafted with a positive angle on one side of the parting surface, and with a negative angle on the other side. iDirX, iDirY, iDirZ as Double The X, Y, and Z components of the absolute vector representing the drafting direction (i.e. the mold extraction direction). iMode as Long The draft connecting mode to its reference face iFaceToDraft. See Mode syntax. iAngle as Double

The draft angle. iMultiselectionMode as Long The elements to be drafted can be selected explicitly or can implicitly selected as neighbors of the neutral face. iMultiselectionMode = 0, the elements to be drafted can be selected explicitly. iMultiselectionMode = 1, the elements to be drafted are the neighbors of the neutral face. Example Set UserDraft = CATIA.ActiveDocument.Part.ShapeFactory.AddNewDraft ( UserFace, UserReference1, 0, UserReference2, 1.000000, 1.000000, 1.000000, 0, 2.000000, 0 )

AddFaceToDraft Adds a face to those to be drafted. Syntax AddFaceToDraft ( iFace ) Example UserDraftDomain.AddFaceToDraft ( UserFace )

RemoveFaceToDraft Removes a face to those to be drafted. Syntax RemoveFaceToDraft ( iFace ) Example UserDraftDomain.RemoveFaceToDraft ( UserFace )

GetPullingDirection Gets the draft pulling direction. Syntax UserDraftDomain( oDirection ) oDirection as Double A safe array with three elements : x, y, z direction coordinates. The array must be previously initialized. Example Dim DraftPullingDirection ( 2 ) As Double Dim x, y, z As Double UserDraftDomain.UserDraftDomain ( DraftPullingDirection ) x = DraftPullingDirection ( 0 ) y = DraftPullingDirection ( 1 ) z = DraftPullingDirection ( 2 )

SetPullingDirection Sets the draft pulling direction. Syntax SetPullingDirection iX, iY, iZ iX, iY, iZ as Double The draft pulling direction coordinates. Example UserDraftDomain.SetPullingDirection 10.000000, 10.000000, 5.000000

DraftDomains.Item Returns a draft domain using its index or its name from the DraftDomains collection. Syntax DraftDomains.Item ( iIndex ) as DraftDomains iIndex as Long The index or the name of the draft domain to retrieve from the collection of draft domains. As a numerics, this index is the rank of the draft domain in the collection. The index of the first draft domain in the collection is 1, and the index of the last draft domain is Count. Example Set UserDraftDomain = UserDraft.DraftDomains.Item ( 1 )

Properties Draft Dimensions an object as Draft. Example Dim UserDraft as Draft

DraftAngle.Value Gets or sets the draft angle. Syntax DraftAngle.Value as Double Example DraftAngle = UserDraftDomain.DraftAngle.Value UserDraftDomain.DraftAngle.Value= 10.000000

DraftDomain Dimensions an object as DraftDomain. Example Dim UserDraftDomain as DraftDomain

FacesToDraft Gets the faces to be drafted collection. Syntax FacesToDraft as References Example Set FacesToDraftCollection = UserDraftDomain.FacesToDraft

Mode Gets or sets the draft definition mode. Syntax Mode as Long = 0, the draft's neutral element must be input. = 1, the draft's neutral element is computed while maintaining the adjacent faces. = 2, the draft's neutral element is computed while maintaining the adjacent edges. Example DraftMode = UserDraft.Mode UserDraft.Mode = 0

MultiselectionMode Gets or sets the multiselection mode. Syntax MultiselectionMode as Long = 0, the elements to be drafted can be selected explicitly. = 1, the elements to be drafted are the neighbors of the neutral face. Example DraftMultiselectionMode = UserDraftDomain.MultiselectionMode UserDraftDomain.MultiselectionMode = 0

NeutralElement Gets or sets the draft neutral element. Syntax NeutralElement as Reference Example

DraftNeutralElement = UserDraftDomain.NeutralElement UserDraftDomain.NeutralElement = UserReference

NeutralPropagationMode Gets or sets the draft propagation mode. Syntax NeutralPropagationMode as Long = 0, the neutral element consists in only the selected surface. = 1, the neutral element consists in the selected surface and all its adjacent tangent surfaces. Example DraftNeutralPropagationMode = UserDraftDomain.NeutralPropagationMode UserDraftDomain.NeutralPropagationMode = 0

PartingElement Gets or sets the draft parting element. Syntax PartingElement as Reference Example DraftPartingElement = UserDraft.PartingElement UserDraft.PartingElement = UserReference

PullingDirectionElement Gets or sets the draft pulling direction element. Syntax PullingDirectionElement as Reference Example DraftPullingDirectionElement = UserDraftDomain.PullingDirectionElement UserDraftDomain.PullingDirectionElement = UserReference

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

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

Draft Reflect Line Definition A draft reflect line shape is made up of draft domains (at least one) and of a parting element, and draft a face by using reflect lines as neutral lines from which the resulting faces will be generated The draft reflect line reuses Draft Angle methods and properties.

Methods and Properties

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

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

Shell Definition A shell shape is made up of a list of faces to process and two thickness parameters.

Methods ShapeFactory.AddNewShell Creates a new shell within the current body. Syntax ShapeFactory.AddNewShell ( iFaceToRemove, iInternalThickness, iExternalThickness ) as Shell iFaceToRemove as Reference The first face to be removed in the shell process. iInternalThickness as Double The thickness of material to be added on the internal side of all the faces during the shell process, except for those to be removed. iExternalThickness as Double The thickness of material to be added on the external side of all the faces during the shell process, except for those to be removed. Example Set UserShell = CATIA.ActiveDocument.Part.ShapeFactory.AddNewShell ( UserFace, 1.000000, 1.000000 )

AddFaceToRemove Adds a new face to those to be removed by the shell process. Syntax AddFaceToRemove ( iAddFaceToRemove ) iAddFaceToRemove as Reference The face to be added to the shell. Example UserShell.AddFaceToRemove ( UserFace )

WithdrawFaceToRemove Removes a new face to those to be removed by the shell process. Syntax

WithdrawFaceToRemove ( iRemoveFaceToRemove ) iRemoveFaceToRemove as Reference The face to be removed from the shell. Example UserShell.WithdrawFaceToRemove ( UserFace )

Properties Shell Dimensions an object as Shell. Example Dim UserShell as Shell

ExternalThickness.Value Gets or sets the shell external thickness. Syntax ExternalThickness.Value as Double Example ShellExternalThickness = UserShell.ExternalThickness.Value UserShell.ExternalThickness.Value = 1.000000

FacesToRemove Gets the collection of faces to be removed by the shell process. Syntax FacesToRemove as References Example Set FacesToRemoveCollection = UserShell.FacesToRemove

InternalThickness.Value Gets or sets the shell internal thickness. Syntax InternalThickness.Value as Double Example ShellInternalThickness = UserShell.InternalThickness.Value UserShell.InternalThickness.Value = 1.000000

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

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

Thickness Definition The thickness shape is made up of a collection of faces to process and an offset parameter.

Methods ShapeFactory.AddNewThickness Creates a new thickness within the current body. Syntax ShapeFactory.AddNewThickness ( iFaceToThicken, iOffset ) as Thickness iFaceToThicken as Reference The first face to thicken in the thickening process. New faces to thicken can be added to the thickness afterwards by using methods offered by the created thickness. iOffset as Double The thickness of material to be added on the external side of the face iFaceToThicken during the thickening process. Example Set UserThickness = CATIA.ActiveDocument.Part.ShapeFactory.AddNewThickness ( UserFace, 5.000000 )

AddFaceToThicken Adds a new face to be thickened. Syntax AddFaceToThicken ( iFaceToThicken ) iFaceToThicken as Reference The new face to be processed. Example UserThickness.AddFaceToThicken ( UserFace )

WithdrawFaceToThicken Removes an existing thickened face. Syntax WithdrawFaceToThicken ( iFaceToRemove ) iFaceToRemove as Reference

The face to be removed. Example UserThickness.WithdrawFaceToThicken ( UserFace )

Properties Offset.Value Gets or sets the thickness offset. Syntax Offset.Value as Double Example ThicknessOffset = UserThickness.Offset.Value UserThickness.Offset.Value = 5.000000

Thickness Dimensions an object as Thickness. Example Dim UserThickness as Thickness

FacesToThicken Gets the collection of faces to be thickened. Syntax FacesToThicken as Reference Example Set FacesToThickenCollection = UserThickness.FacesToThicken

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

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

Surface-Based Feature Split Thick Surface Close Surface Sew Surface

Split Definition Splits a shape using a splitting element, such as a surface, a face or a plane.

Methods ShapeFactory.AddNewSplit Creates a new split operation within the current body. Syntax ShapeFactory.AddNewSplit ( iSplittingElement, ) as Split iSplittingElement as Reference The face or plane that will split the current body. iSplittingSide as Long The specification for which side of the current body should be kept at the end of the split operation. See SplittingSide syntax. Example Set UserSplit = CATIA.ActiveDocument.Part.ShapeFactory.AddNewSplit ( UserSurface, 0 )

Properties Split Dimensions an object as Split. Example Dim UserSplit as Split

SplittingSide Gets or sets the splitting side. Syntax SplittingSide as Long = 0, material in the splitted element should be removed in the direction indicated by the splitting element normal vector. This vector is oriented towards the outside of the material when a face is selected = 1, material in the splitted element should be removed in the reverse direction to the one

indicated by the splitting element normal vector. Example SplitSplittingSide = UserSplit.SplittingSide UserSplit.SplittingSide = 0

Surface Gets or sets the splitting surface. Syntax Surface as Reference Example SplitSurface = UserSplit.Surface UserSplit.Surface = UserSurface

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

2. Load the Split1.CATScript macro.

3. Run the macro.

Thick Surface Definition Thicks surface using an offset element (such as a surface or a skin) and two offset values: Top offset and Bottom offset. Top offset is the offset between the offset element and the top skin of the feature. Bottom offset is the offset between the offset element and the bottom skin of the feature.

Methods ShapeFactory.AddNewThickSurface Creates a new thick surface operation within the current body. Syntax ShapeFactory.AddNewThickSurface ( iOffsetElement, iOffsetSide, iTopOffset, iBottomOffset ) as ThickSurface iOffsetElement as Reference The skin that will be thicken and added with the current body. iOffsetSide as Long The direction of the offset in regard to the direction of the normal. See OffsetSide syntax. iTopOffset as Double The Offset between the iOffsetElement and the upper skin of the resulting feature. iBottomOffset as Double The Offset between the iOffsetElement and the lower skin of the resulting feature. Example Set UserThickSurface = CATIA.ActiveDocument.Part.ShapeFactory.AddNewThickSurface ( UserSurface, 0, 15.00000, 10.000000 )

swap_OffsetSide Swaps the side of the offset. Syntax swap_OffsetSide Example UserThickSurface.swap_OffsetSide

Properties BotOffset.Value Gets or sets the thick surface bottom offset length. Syntax BotOffset.Value as Double Example ThickSurfaceBottomOffset = UserThickSurface.BotOffset.Value UserThickSurface.BotOffset.Value = 10.000000

OffsetSide Gets or sets the direction of the offset in regard to the direction of the normal. Syntax OffsetSide as Long = 0, the offset direction is same direction of the normal. = 1, the offset direction is reverse direction of the normal. Example ThickSurfaceOffsetSide = UserThickSurface.OffsetSide UserThickSurface.OffsetSide = 1

SplittingSide Gets or sets the splitting side. Syntax SplittingSide as Long = 0, material in the splitted element should be removed in the direction indicated by the splitting element normal vector. This vector is oriented towards the outside of the material when a face is selected = 1, material in the splitted element should be removed in the reverse direction to the one indicated by the splitting element normal vector. Example ThickSurfaceSplittingSide = UserThickSurface.SplittingSide UserThickSurface.SplittingSide = 0

Surface Gets or sets the surface to be thicken. Syntax Surface as Reference Example

ThickSurfaceSurface = UserThickSurface.Surface UserThickSurface.Surface = UserSurface

ThickSurface Dimensions an object as ThickSurface. Example Dim UserThickSurface as ThickSurface

TopOffset.Value Gets or sets the thick surface top offset length. Syntax TopOffset.Value as Double Example ThickSurfaceTopOffset = UserThickSurface.TopOffset.Value UserThickSurface.TopOffset.Value = 15.000000

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

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

Close Surface Definition Closes a skin surface.

Methods ShapeFactory.AddNewCloseSurface Creates and returns a new close surface operation within the current body. Syntax ShapeFactory.AddNewCloseSurface ( iCloseElement ) as CloseSurface iCloseElement as Reference The skin that will be closed and added with the current body. Example Set UserCloseSurface = CATIA.ActiveDocument.Part.ShapeFactory.AddNewCloseSurface ( UserSurface )

Properties CloseSurface Dimensions an object as CloseSurface. Example Dim UserCloseSurface as CloseSurface

Surface Gets or sets the surface to be closed. Syntax Surface as Reference Example CloseSurfaceSurface = UserCloseSurface.Surface UserCloseSurface.Surface = UserSurface

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

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

Sew Surface Definition Sews a shape using a sewing element, such as a surface or a face.

Methods ShapeFactory.AddNewSewSurface Creates a new sew surface operation within the current body. Syntax ShapeFactory.AddNewSewSurface ( iSewingElement, iSewingSide ) as SewSurface iSewingElement as Reference The face or skin or surface that will be sewn on the current body. iSewingSide as Long The specification for which side of the current body should be kept at the end of the sewing operation. See SewingSide syntax. Example Set UserSewSurface = CATIA.ActiveDocument.Part.ShapeFactory.AddNewSewSurface ( UserSurface )

Properties SewingSide Gets or sets the sewing side. The sewing side is the side of the body kept after the sewing. A positive side refers to the same orientation than the sewing element normal vector. Syntax SewingSide as Long = 0, material in the splitted element should be removed in the direction indicated by the splitting element normal vector. This vector is oriented towards the outside of the material when a face is selected. = 1, material in the splitted element should be removed in the direction opposite to the one indicated by the splitting element normal vector. Example SewSurface.SewingSide = UserSewSurface.SewingSide

UserSewSurface.SewingSide = 0

SewSurface Dimensions an object as SewSurface. Example Dim UserSewSurface as SewSurface

Surface Gets or sets the surface to be sewn. Syntax Surface as Reference Example SewSurfaceSurface = UserSewSurface.Surface UserSewSurface.Surface = UserSurface

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

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

Transformation Features Mirror Rectangular Pattern Circular Pattern User Pattern

Mirror Definition Duplicates a body according to a planar mirroring element, such as a planar face or a plane.

Methods ShapeFactory.AddNewMirror Creates and returns a new mirror within the current body. A mirror allows user to duplicate the current body by symmetry according to a symmetry plane. Syntax ShapeFactory.AddNewMirror ( iMirroringElement ) iMirroringElement The plane used by the mirror as the symmetry plane. Example Set UserMirror = CATIA.ActiveDocument.Part.ShapeFactory.AddNewMirror ( UserPlane )

AddObjectToMirror Adds an object to the mirror. Syntax AddObjectToMirror ( iMirroringObject ) iMirroringObject as AnyObject The object to added. Example UserMirror.AddObjectToMirror ( UserObject )

Properties Mirror Dimensions an object as Mirror. Example Dim UserMirror as Mirror

MirroringObject Gets the object to be mirrored.

Syntax MirroringPlane as AnyObject Example MirrorMirroringObject = UserMirror.MirroringPlane

MirroringPlane Gets or sets the mirroring reference plane. It can be a plane, or a plane face. Syntax MirroringPlane as Reference Example MirrorMirroringPlane = UserMirror.MirroringPlane UserMirror.MirroringPlane = UserPlane

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

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

Rectangular Pattern Definition Copies a shape along two directions. Two linear distributions control the shape copy.

Methods ShapeFactory.AddNewRectPattern Creates and returns a new rectangular pattern within the current body. Syntax ShapeFactory.AddNewRectPattern ( iShapeToCopy, iFirstDirectionInstancesNumber, iSecondDirectionInstancesNumber, iFirstDirectionOffset, iSecondDirectionOffset, iFirstDirectionPosition, iSecondDirectionPosition, iFirstDirection, iSecondDirection, iFirstOrientation, iSecondOrientation, iRotationAngle ) as RectPattern iShapeToCopy as Reference The shape to be copied by the rectangular pattern. iFirstDirectionInstancesNumber as Long The number of instances of iShapeToCopy along the pattern first direction. iSecondDirectionInstancesNumber as Long The number of instances of iShapeToCopy along the pattern second direction. iFirstDirectionOffset as Double The offset that will separate two consecutive instances in the pattern along its first direction. iSecondDirectionOffset as Double The offset that will separate two consecutive instances in the pattern along its second direction. iFirstDirectionPosition as Long Specifies the position of the original shape iShapeToCopy among its instances along iFirstDirection. iSecondDirectionPosition as Long Specifies the position of the original shape iShapeToCopy among its instances along iSecondDirection. iFirstDirection as Reference The line or linear edge that specifies the pattern first distribution direction. iSecondDirection as Reference The line or linear edge that specifies the pattern second distribution direction. iFirstOrientation as Boolean

The flag indicating the iFirstDirection orientation. See FirstOrientation syntax. iSecondOrientation as Boolean The flag indicating the iSecondDirection orientation. See SecondOrientation syntax. iRotationAngle as Double The angle applied to both directions iFirstDirection and iSecondDirection prior to applying the pattern. The original shape iShapeToCopy is used as the rotation center. Nevertheless, the copied shapes themselves are not rotated. This allows users to define of a rectangular pattern relatively to existing geometry, but not necessarily parallel to it. Example Set UserRectangularPattern = CATIA.ActiveDocument.Part.ShapeFactory.AddNewRectPattern ( UserShape, 2, 2, 10.000000, 15.000000, 1, 1, UserLine1, UserLine2, True, True, 0.000000 )

ActivatePosition Activates a pattern feature. Syntax ActivatePosition ( iFirstDirectionPosition, iSecondDirectionPosition ) iFirstDirectionPosition as Long The feature position along the first direction. iSecondDirectionPosition as Long The feature position along the second direction. Example UserRectangularPattern.ActivatePosition ( 2, 2 )

DesactivatePosition Deactivates a pattern feature. Syntax DesactivatePosition ( iFirstDirectionPosition, iSecondDirectionPosition ) iFirstDirectionPosition as Long The feature position along the first direction. iSecondDirectionPosition as Long The feature position along the second direction. Example UserRectangularPattern.DesactivatePosition ( 2, 2 )

GetFirstDirection Gets the first repartition direction. Syntax GetFirstDirection ( oFirstDirection ) oFirstDirection as Double A safe array with three elements : x, y, z direction coordinates. The array must be previously initialized. Example Dim PatternFirstDirection ( 2 ) As Double Dim x, y, z As Double UserRectangularPattern.GetFirstDirection ( PatternFirstDirection ) x = PatternFirstDirection ( 0 ) y = PatternFirstDirection ( 1 ) z = PatternFirstDirection ( 2 )

SetFirstDirection Sets the first repartition direction. Syntax SetFirstDirection ( iFirstDirection ) iFirstDirection as Reference The first repartition direction as a line or a linear edge. Example UserRectangularPattern.SetFirstDirection ( UserLine )

GetSecondDirection Gets the second repartition direction. Syntax GetSecondDirection ( oSecondDirection ) oSecondDirection as Double A safe array with three elements : x, y, z direction coordinates. The array must be previously initialized. Example Dim PatternSecondDirection ( 2 ) As Double Dim x, y, z As Double UserRectangularPattern.GetSecondDirection ( PatternSecondDirection ) x = PatternSecondDirection ( 0 )

y = PatternSecondDirection ( 1 ) z = PatternSecondDirection ( 2 )

SetSecondDirection Sets the first repartition direction. Syntax SetSecondDirection ( iFirstDirection ) iFirstDirection as Reference The second repartition direction as a line or a linear edge. Example UserRectangularPattern.SetSecondDirection ( UserLine )

Properties FirstDirectionRepartition.InstancesCount.Value Gets or sets the number of instances along the first direction. Syntax FirstDirectionRepartition.InstancesCount.Value as Long Example Number = UserRectangularPattern.FirstDirectionRepartition.InstancesCount.Value UserRectangularPattern.FirstDirectionRepartition.InstancesCount.Value = 5

FirstDirectionRepartition.Spacing.Value Gets or sets the spacing between instances along the first direction. Syntax FirstDirectionRepartition.Spacing.Value as Double Example Spacing = UserRectangularPattern.FirstDirectionRepartition.Spacing.Value UserRectangularPattern.FirstDirectionRepartition.Spacing.Value = 20.00000

FirstDirectionRow.Value Gets or sets the position of the shape to be copied along the first direction. Syntax FirstDirectionRow.Value as Long Example Row = UserRectangularPattern.FirstDirectionRow.Value UserRectangularPattern.FirstDirectionRow.Value = 2

FirstOrientation Gets or sets if the pattern is built towards the first direction orientation. Syntax FirstOrientation as Boolean = True, the pattern is copied in the direction of the natural orientation of the first direction. = False, the pattern is copied in the reverse direction of the natural orientation of the first direction. Example NaturalOrientation = UserRectangularPattern.FirstOrientation UserRectangularPattern.FirstOrientation = True

ItemToCopy Gets or sets the shape to be copied. Syntax ItemToCopy as Reference Example Set Shape = UserRectangularPattern.ItemToCopy UserRectangularPattern.ItemToCopy = UserShape

RectPattern Dimensions an object as RectPattern. Example Dim UserRectangularPattern as RectPattern

RotationAngle.Value Gets or sets the pattern rotation angle. The rotation is applied to the whole pattern, but not to the shapes themselves. The shape to be copied is used as the rotation center. Syntax RotationAngle.Value as Double Example Angle = UserRectangularPattern.RotationAngle.Value UserRectangularPattern.RotationAngle.Value = 45.000000

SecondDirectionRepartition.InstancesCount.Value Gets or sets the number of instances along the second direction. Syntax SecondDirectionRepartition.InstancesCount.Value as Long

Example Number = UserRectangularPattern.SecondDirectionRepartition.InstancesCount.Value UserRectangularPattern.SecondDirectionRepartition.InstancesCount.Value = 5

SecondDirectionRepartition.Spacing.Value Gets or sets the spacing between instances along the second direction. Syntax SecondDirectionRepartition.Spacing.Value as Double Example Spacing = UserRectangularPattern.SecondDirectionRepartition.Spacing.Value UserRectangularPattern.SecondDirectionRepartition.Spacing.Value = 20.00000

SecondDirectionRow.Value Gets or sets the position of the shape to be copied along the second direction. Syntax SecondDirectionRow.Value as Long Example Row = UserRectangularPattern.SecondDirectionRow.Value UserRectangularPattern.SecondDirectionRow.Value = 2

SecondOrientation Gets or sets if the pattern is built towards the second direction orientation. Syntax SecondOrientation as Boolean = True, the pattern is copied in the direction of the natural orientation of the second direction. = False, the pattern is copied in the reverse direction of the natural orientation of the second direction. Example NaturalOrientation = UserRectangularPattern.SecondOrientation UserRectangularPattern.SecondOrientation = True

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

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

Circular Pattern Definition The shape is duplicated along concentric circles to build crowns. A linear repartition object defines the duplication along radial directions, thus determining the number of crowns. An angular repartition object defines the duplication on the crowns.

Methods ShapeFactory.AddNewCircPattern Creates and returns a new circular pattern within the current body. Syntax ShapeFactory.AddNewCircPattern ( iShapeToCopy, iRadialDirectionInstancesNumber, iAngularDirectionInstancesNumber, iRadialDirectionOffset, iAngularDirectionOffset, iRadialDirectionPosition, iAngularDirectionPosition, iRotationCenter, iRotationAxis, iRotationOrientation, iRotationAngle, ) as CircPattern iShapeToCopy as Reference The shape to be copied by the circular pattern. iRadialDirectionInstancesNumber as Long The number of instances of iShapeToCopy along the pattern radial direction. iAngularDirectionInstancesNumber as Long The number of instances of iShapeToCopy along the pattern angular direction. iRadialDirectionOffset as Double The offset that will separate two consecutive instances in the pattern along its radial direction. iAngularDirectionOffset as Double The angle that will separate two consecutive instances in the pattern along its angular direction. iRadialDirectionPosition as Long Specifies the position of the original shape iShapeToCopy among its instances along iRadialDirection. iAngularDirectionPosition as Long Specifies the position of the original shape iShapeToCopy among its instances along iAngularDirection. iRotationCenter as Reference The point or vertex that specifies the pattern center of rotation. iRotationAxis as Reference The line or linear edge that specifies the axis around which instances will be rotated relative to each other. iRotationOrientation as Boolean The flag indicating the iRotationAxis orientation. See RotationOrientation syntax.

iRotationAngle as Double The angle applied to both directions iRotationAxis prior to applying the pattern. The original shape iShapeToCopy is used as the rotation center. Nevertheless, the copied shapes themselves are not rotated. This allows users to define of a circular pattern relatively to existing geometry, but not necessarily parallel to it. iRadialAlignment as Boolean The boolean flag that indicating the iShapeToCopy instances alignment. See RadialAlignment syntax. Example Set UserCircularPattern = CATIA.ActiveDocument.Part.ShapeFactory.AddNewCircPattern ( UserShape, 2, 2, 10.000000, 45.000000, 1, 1, UserPoint, UserLine, True, 0.000000, True )

ActivatePosition Activates a pattern feature. Syntax ActivatePosition ( iRadialDirectionPosition, iAngularDirectionPosition ) iRadialDirectionPosition as Long The feature position along the radial direction. iAngularDirectionPosition as Long The feature position along the angular direction. Example UserCircularPattern.ActivatePosition ( 2, 2 )

DesactivatePosition Deactivates a pattern feature. Syntax DesactivatePosition ( iRadialDirectionPosition, iAngularDirectionPosition ) iRadialDirectionPosition as Long The feature position along the radial direction. iAngularDirectionPosition as Long The feature position along the angular direction. Example UserCircularPattern.DesactivatePosition ( 2, 2 )

GetRotationAxis Gets the pattern rotation axis. Syntax GetRotationAxis ( oRotationAxis ) oRotationAxis as Double A safe array with three elements : x, y, z direction coordinates. The array must be previously initialized.

Example Dim PatternRotationAxis ( 2 ) As Double Dim x, y, z As Double UserCircularPattern.GetRotationAxis ( PatternRotationAxis ) x = PatternRotationAxis ( 0 ) y = PatternRotationAxis ( 1 ) z = PatternRotationAxis ( 2 )

SetRotationAxis Sets the pattern rotation axis. Syntax SetRotationAxis ( iRotationAxis ) iRotationAxis as Reference The rotation axis as a line or a linear edge or a plane reference: in this last case the plane normal is taken into account. Example UserCircularPattern.SetRotationAxis ( UserLine )

GetRotationCenter Gets the pattern rotation center. Syntax GetRotationCenter ( oRotationCenter ) oRotationCenter as Double A safe array with three elements : x, y, z direction coordinates. The array must be previously initialized. Example Dim PatternRotationCenter ( 2 ) As Double Dim x, y, z As Double UserCircularPattern.GetRotationCenter ( PatternRotationCenter ) x = PatternRotationCenter ( 0 ) y = PatternRotationCenter ( 1 ) z = PatternRotationCenter ( 2 )

SetRotationCenter Sets the pattern rotation center. Syntax SetRotationCenter ( iRotationCenter ) iRotationCenter as Reference The rotation center as point or vertex. Example

UserCircularPattern.SetRotationCenter ( UserPoint )

Properties AngularDirectionRow.Value Gets or sets the position of the shape to be copied along the angular direction. Syntax AngularDirectionRow.Value as Long Example Row = UserCircularPattern.AngularDirectionRow.Value UserCircularPattern.AngularDirectionRow.Value = 2

AngularRepartition.AngularSpacing.Value Gets or sets the angular spacing between instances along the angular direction. Syntax AngularRepartition.AngularSpacing.Value as Double Example AngularSpacing = UserCircularPattern.AngularRepartition.AngularSpacing.Value UserCircularPattern.AngularRepartition.AngularSpacing.Value = 30.00000

AngularRepartition.InstancesCount.Value Gets or sets the number of instances along the angular direction. Syntax RadialRepartition.InstancesCount.Value as Long Example Number = UserCircularPattern.AngularRepartition.InstancesCount.Value UserCircularPattern.AngularRepartition.InstancesCount.Value = 5

CircPattern Dimensions an object as CircPattern. Example Dim UserCircularPattern as CircPattern

ItemToCopy Gets or sets the shape to be copied. Syntax ItemToCopy as Reference Example Set Shape = UserCircularPattern.ItemToCopy UserCircularPattern.ItemToCopy = UserShape

RadialAlignment Gets or sets the radial instances alignment. Syntax RadialAlignment as Boolean = True, indicates that the instances should be kept parallel to each other. = False, indicates that the instances should be aligned with the radial direction they lie upon. Example RadialInstancesAlignment = UserCircularPattern.RadialAlignment UserCircularPattern.RadialAlignment = True

RadialDirectionRow.Value Gets or sets the position of the shape to be copied along the radial direction. Syntax RadialDirectionRow.Value as Long Example Row = UserCircularPattern.RadialDirectionRow.Value UserCircularPattern.RadialDirectionRow.Value = 2

RadialRepartition.InstancesCount.Value Gets or sets the number of instances along the radial direction. Syntax RadialRepartition.InstancesCount.Value as Long Example Number = UserCircularPattern.RadialRepartition.InstancesCount.Value UserCircularPattern.RadialRepartition.InstancesCount.Value = 5

RadialRepartition.Spacing.Value Gets or sets the spacing between instances along the radial direction. Syntax RadialRepartition.InstancesCount.Value as Double Example Spacing = UserCircularPattern.RadialRepartition.Spacing.Value UserCircularPattern.RadialRepartition.InstancesCount.Value = 20.00000

RotationAngle.Value Gets or sets the pattern rotation angle. The rotation is applied to the whole pattern, but not to the shapes themselves. The shape to be copied is used as the rotation center. Syntax RotationAngle.Value as Double Example Angle = UserCircularPattern.RotationAngle.Value

UserCircularPattern.RotationAngle.Value = 45.000000

RotationOrientation Gets or sets the pattern rotation orientation. Syntax RotationOrientation as Boolean = True, indicates that the instances are copied counterclockwise when the rotation axis direction goes towards you when you look at the crown. = False, indicates that the instances are copied clockwise when the rotation axis direction goes towards you when you look at the crown. Example PatternRotationOrientation = UserCircularPattern.RotationOrientation UserCircularPattern.RotationOrientation = True

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

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

User Pattern Definition The shape is copied along user's positions.

Methods ShapeFactory.AddNewUserPattern Creates and returns a new user pattern within the current body. Syntax ShapeFactory.AddNewUserPattern ( iShapeToCopy, iInstancesNumber ) iShapeToCopy as Shape The shape to be copied by the user pattern. iInstancesNumber as Long The number of instances of iShapeToCopy in the pattern . Example Set UserUserPattern = CATIA.ActiveDocument.Part.ShapeFactory.AddNewUserPattern ( UserShape, 10 )

AddFeatureToLocatePositions Adds the sketch to locate instances. Syntax AddFeatureToLocatePositions ( iSketch ) iSketch as Sketch The sketch. Example UserUserPattern.AddFeatureToLocatePositions ( UserSketch )

Properties FeatureToLocatePositions Gets or sets the sketch to locate instances. Syntax FeatureToLocatePositions as Sketch Example

Sketch = UserUserPattern.FeatureToLocatePositions UserUserPattern.FeatureToLocatePositions = UserSketch

ItemToCopy Gets or sets the shape to be copied. Syntax ItemToCopy as Reference Example Set Shape = UserUserPattern.ItemToCopy UserUserPattern.ItemToCopy = UserShape

UserPattern Dimensions an object as UserPattern. Example Dim UserUserPattern as UserPattern

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

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

Part Basics Properties Body Reference Update

Properties Definition Part properties.

Properties Bodies Returns the collection object containing the independent bodies of the part. Independent bodies means the main body and those bodies not yet used in boolean shapes. Syntax Bodies as Bodies Example PartBodiesCollection = UserPart.Bodies

Constraints Returns the collection object containing the constraints of the part. Syntax Constraints as Constraints Example PartConstraintsCollection = UserPart.Constraints

Density Gets or sets the part density. Syntax Part.Density as Double Example PartDensity = UserPart.Density UserPart.Density = 1.000000

GeometricElements Returns the collection object containing the geometrical elements of the part. Syntax GeometricElement as GeometricElements Example

PartGeometricElementsCollection = UserPart.GeometricElements

HybridBodies Returns the collection object containing the hybrid bodies of the part. Syntax HybridBodies as HybridBodies Example PartHybridBodiesCollection = UserPart.HybridBodies

InWorkObject Gets or sets the part's in work object. Syntax InWorkObject as AnyObject Example PartInWorkObject = UserPart.InWorkObject UserPart.InWorkObject = UserFeature

OriginElements.PlaneXY Returns the XY plane of the part's 3D reference axis system. Syntax OriginElements.PlaneXY as GeometricElement Example PartParametersCollection = UserPart.OriginElements.PlaneXY

OriginElements.PlaneYZ Returns the YZ plane of the part's 3D reference axis system. Syntax OriginElements.PlaneYZ as GeometricElement Example PartParametersCollection = UserPart.OriginElements.PlaneYZ

OriginElements.PlaneZX Returns the ZX plane of the part's 3D reference axis system. Syntax OriginElements.PlaneZX as GeometricElement Example PartParametersCollection = UserPart.OriginElements.PlaneZX

Parameters Returns the collection object containing the parameters of the part. Syntax Parameters as Parameters Example PartParametersCollection = UserPart.Parameters

Part Dimensions an object as Part. Example Dim UserPart as Part

PartDocument Dimensions an object as part document. Example Dim UserPartDocument as PartDocument

Relations Returns the collection object containing the formula of the part. Syntax Relations as Relations Example PartRelationsCollection = UserPart.Relations

Body Definition Defines a body in a part.

Methods Bodies.Item Returns a body using its index or its name from the Bodies collection. This body becomes the current one. Syntax Bodies.Item ( iIndex ) as Body iIndex as Long or String The index or the name of the body to retrieve from the collection of bodies. As a numerics, this index is the rank of the body in the collection. The index of the first body in the collection is 1, and the index of the last body is Count. As a string, it is the feature name assigned to the body. Note, the name of the part body is already "MechanicalTool.1". Example Set UserBody = CATIA.ActiveDocument.Part.Bodies.Item ( "MechanicalTool.1" )

Properties Bodies Dimensions an object as a bodies collection. Example Dim UserBodiesCollection as Bodies

Body Dimensions an object as body. Example Dim UserBody as Body

Reference Definition References features in a part.

Methods CreateReferenceFromName Creates a reference from a Generic Naming label. Syntax CreateReferenceFromName ( iLabel ) as Reference iLabel as String The GenericNaming identification for an object. Example Set UserReference = CATIA.ActiveDocument.Part.CreateReferenceFromName ( UserLabel )

CreateReferenceFromGeometry Creates a reference from a geometric object. Syntax CreateReferenceFromGeometry ( iGeometricElement ) as Reference iGeometricElement as GeometricElement The geometric element to be referenced. Example Set UserReference = CATIA.ActiveDocument.Part.CreateReferenceFromGeometry ( UserGeometricalElement )

CreateReferenceFromObject Creates a reference from an operator. Syntax CreateReferenceFromObject ( iObject ) as Reference iObject as AnyObject The object to be referenced. Example Set UserReference = CATIA.ActiveDocument.Part.CreateReferenceFromObject ( UserObject )

CreateReferenceFromBRepName Creates a reference from a GenericNaming label. Syntax CreateReferenceFromBRepName ( iLabel, iObjectContext ) as Reference iLabel as AnyObject The Generic Naming identification for an object. iObjectContext as AnyObject The object context of resolution. This is the feature used for label Generic Naming resolution. Example Set UserReference = CATIA.ActiveDocument.Part.CreateReferenceFromBRepName ( UserLabel, UserObject )

Properties Reference Dimensions an object as reference. Example Dim UserReference as Reference

References Dimensions an object as a references collection. Example Dim UserReferencesCollection as References

Update Definition Updates a part.

Methods Update Updates the part. Syntax Update Example UserPart.Update

UpdateObject Updates a part's feature. Syntax UpdateObject ( iFeature ) iFeature The feature to be updated. Example UserPart.UpdateObject ( UserFeature )

IsUpToDate Gets the part's feature update status. Syntax IsUpToDate ( iFeature ) = True, the feature is updated. = False, the feature is not updated iFeature The feature to be analysed. Example UserPart.IsUpToDate ( UserFeature )

Inactivate Deactivates the part's feature update attribut.

Prevents to take deactivated features into account during an update operation. Syntax Inactivate ( iFeature ) Example UserPart.Inactivate ( UserFeature )

Activate Activates the part's feature update attribut. Syntax Activate ( iFeature ) Example UserPart.Activate ( UserFeature )

IsInactive Gets whether the part's feature update attribut is deactivated. Syntax IsInactive ( iFeature ) as Boolean = True, the feature update attribut is deactivated. = False, the feature update attribut is activated. Example FeatureUpdateAttribut = UserPart.IsInactive ( UserFeature )

Part Constraints Constraints Length Constraint

Constraints Definition Constraints part features.

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 )

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 whether 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 three 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 three 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. = 4, Tangency only with AddBiEltCst.

= 5, Length only with AddMonoEltCst. = 6, Angle only with AddBiEltCst. = 8, Parallelism only with AddBiEltCst. = 11, Perpendicularity 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

Length Constraint Definition Sets length constraints between part features. These macros use the methods and properties described in 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.

Advanced Tasks

Boolean Shapes

Boolean Shapes Creates and manages bodies. Insert Body Assemble Bodies Intersect Bodies Add Bodies Remove Bodies Trim Bodies

Insert Body Definition Inserts a new body in the part document.

Methods Bodies.Add Creates a new body and adds it to the Bodies collection. This body becomes the current one. Syntax Bodies.Add as Body Example Set UserBody = CATIA.ActiveDocument.Part.Bodies.Add

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

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

Assemble Bodies Definition Assembles bodies in the part document.

Methods ShapeFactory.AddNewAssemble Creates and returns a new assembly operation within the current body, see InWorkObject properties. Syntax ShapeFactory.AddNewAssemble ( iBody ) as Assemble iBody as Body The body to be assembled with the current body. Example Set UserAssemble = CATIA.ActiveDocument.ShapeFactory.AddNewAssemble ( UserBody )

Properties Assemble Dimensions an object as assemble. Example Dim UserAssemble as Assemble

Body Returns the inserted body. Syntax Body as Body Example AssembleBody = UserAssemble.Body

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

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

Intersect Bodies Definition Intersects bodies in the part document.

Methods ShapeFactory.AddNewIntersect Creates and returns a new intersect operation within the current body, see InWorkObject properties. Syntax ShapeFactory.AddNewIntersect ( iBody ) as Intersect iBody as Body The body to be intersected with the current body. Example Set UserIntersect = CATIA.ActiveDocument.ShapeFactory.AddNewIntersect ( UserBody )

Properties Body Returns the inserted body. Syntax Body as Body Example IntersectBody = UserIntersect.Body

Intersect Dimensions an object as intersect. Example Dim UserIntersect as Intersect

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

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

4. Open the IntersectBodies1.CATPart document.

5. Load the IntersectBodies2.CATScript macro. 6. Run the macro.

Add Bodies Definition Adds bodies in the part document.

Methods ShapeFactory.AddNewAdd Creates and returns a new add operation within the current body, see InWorkObject properties. Syntax ShapeFactory.AddNewAdd ( iBody ) as Add iBody as Body The body to be added with the current body. Example Set UserAdd = CATIA.ActiveDocument.ShapeFactory.AddNewAdd ( UserBody )

Properties Add Dimensions an object as add. Example Dim UserAdd as Add

Body Returns the inserted body. Syntax Body as Body Example AddBody = UserAdd.Body

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

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

Remove Bodies Definition Removes bodies in the part document.

Methods ShapeFactory.AddNewRemove Creates and returns a new remove operation within the current body, see InWorkObject properties. Syntax ShapeFactory.AddNewRemove ( iBody ) as Remove iBody as Body The body to be removed with the current body. Example Set UserRemove = CATIA.ActiveDocument.ShapeFactory.AddNewRemove ( UserBody )

Properties Body Returns the inserted body. Syntax Body as Body Example RemoveBody = UserRemove.Body

Remove Dimensions an object as remove. Example Dim UserRemove as Remove

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

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

Trim Bodies Definition Trims bodies in the part document.

Methods ShapeFactory.AddNewTrim Creates and returns a new trim operation within the current body. Syntax ShapeFactory.AddNewTrim ( iBody ) as Trim iBody as Body The body to be trimmed with the current body. Example Set UserTrim = CATIA.ActiveDocument.ShapeFactory.AddNewTrim ( UserBody )

AddFaceToRemove Adds a face to the removed faces (if the face is not divided by trim operation). Syntax AddFaceToRemove ( iFaceToAdd ) iFaceToAdd as Reference The face to be added to the removed faces. Example UserTrim.AddFaceToRemove ( UserFace )

WithdrawFaceToRemove Removes a face from the removed faces (if the face is not divided by trim operation). Syntax WithdrawFaceToRemove ( iFaceToRemove ) iFaceToRemove as Reference The face to be removed from the removed faces. Example UserTrim.WithdrawFaceToRemove ( UserFace )

AddFaceToRemove2 Adds a face to the removed faces (if the face is divided by trim operation). Syntax AddFaceToRemove2 ( iFaceToAdd, iAdjacentFaceForRemove ) iFaceToAdd as Reference The face to be added to the removed faces. iAdjacentFaceForRemove as Reference An adjacent face of iFaceToAdd belonging to the other operand. Example UserTrim.AddFaceToRemove2 ( UserFace, UserAdjacentFace )

WithdrawFaceToRemove2 Removes a face from the removed faces (if the face is divided by trim operation). Syntax WithdrawFaceToRemove2 ( iFaceToRemove, iAdjacentFaceForRemove ) iFaceToRemove as Reference The face to be removed from the removed faces. iAdjacentFaceForRemove as Reference An adjacent face of iFaceToRemove belonging to the other operand. Example UserTrim.WithdrawFaceToRemove2 ( UserFace, UserAdjacentFace )

AddFaceToKeep Adds a face to the kept faces (if the face is not divided by trim operation). Syntax AddFaceToKeep ( iFaceToAdd ) iFaceToAdd as Reference The face to be added to the kept faces. Example UserTrim.AddFaceToKeep ( UserFace )

WithdrawFaceToKeep Removes a face from the kept faces (if the face is not divided by trim operation). Syntax WithdrawFaceToKeep ( iFaceToRemove ) iFaceToRemove as Reference The face to be removed from the kept faces.

Example UserTrim.WithdrawFaceToKeep ( UserFace )

AddFaceToKeep2 Adds a face to the kept faces (if the face is divided by trim operation). Syntax AddFaceToKeep2 ( iFaceToAdd, iAdjacentFaceForRemove ) iFaceToAdd as Reference The face to be added to the kept faces. iAdjacentFaceForRemove as Reference An adjacent face of iFaceToAdd belonging to the other operand. Example UserTrim.AddFaceToKeep2 ( UserFace, UserAdjacentFace )

WithdrawFaceToKeep2 Removes a face from the kept faces (if the face is divided by trim operation). Syntax WithdrawFaceToKeep2 ( iFaceToRemove, iAdjacentFaceForRemove ) iFaceToRemove as Reference The face to be removed from the kept faces. iAdjacentFaceForRemove as Reference An adjacent face of iFaceToRemove belonging to the other operand. Example UserTrim.WithdrawFaceToKeep2 ( UserFace, UserAdjacentFace )

Properties Body Returns the inserted body. Syntax Body as Body Example TrimBody = UserTrim.Body

Trim Dimensions an object as trim. Example

Dim UserTrim as trim

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

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

Glossary B body

See part body.

C chamfer

A cut through the thickness of the feature at an angle, giving a sloping edge.

child

A status defining the genealogical relationship between a feature or element and another feature or element. For instance, a pad is the child of a sketch. See also parent. constraint A geometric or dimension relation between two elements.

D draft angle A feature provided with a face with an angle and a pulling direction.

F feature

A component of a part. For instance, shafts, fillets and drafts are features.

fillet

A curved surface of a constant or variable radius that is tangent to, and that joins two surfaces. Together, these three surfaces form either an inside corner or an outside corner.

G groove

A feature corresponding to a cut in the shape of a revolved feature.

H hole

A feature corresponding to an opening through a feature. Holes can be simple, tapered, counterbored, countersunk, or counterdrilled.

M mirror

A feature created by duplicating an initial feature. The duplication is defined by symmetry.

P pad

A feature created by extruding a profile.

parent

A status defining the genealogical relationship between a feature or element and another feature or element. For instance, a pad is the parent of a draft.

part

A 3D entity obtained by combining different features.

part body A component of a part made of one or several features. pattern

A set of similar features repeated in the same feature or part.

pocket

A feature corresponding to an opening through a feature. The shape of the opening corresponds to the extrusion of a profile.

profile

An open or closed shape including arcs and lines created by the profile command in the Sketcher workbench.

R reorder

An operation consisting in reorganizing the order of creation of the features.

rib

A feature obtained by sweeping a profile along a center curve.

S scaling

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

shaft

A revolved feature

shell

A hollowed out feature

sketch

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

slot

A feature consisting of a passage through a part obtained by sweeping a profile along a center curve.

split

A feature created by cutting a part or feature into another part or feature using a plane or face.

stiffener

A feature used for reinforcing a feature or part.

Index A Activate

,

ActivatePosition

,

Add AddBiEltCst AddEdgeToFillet AddEdgeToKeep

,

AddElementToChamfer AddFaceToDraft AddFaceToKeep AddFaceToKeep2 AddFaceToRemove

,

AddFaceToRemove2 AddFaceToThicken AddFeatureToLocatePositions AddImposedVertex AddMonoEltCst AddObjectToFillet AddObjectToMirror AnchorMode Angle.Value AngleSector AngularDirectionRow.Value AngularRepartition.AngularSpacing.Value AngularRepartition.InstancesCount.Value Assemble

B Bodies.Add Bodies.Item Bodies Body

, ,

,

,

,

,

BotOffset.Value BottomAngle.Value BottomLimit.Dimension.Value BottomLimit.LimitMode BottomLimit.LimitingElement BottomType BrokenConstraintsCount

C CenterCurveElement

,

Chamfer CircPattern CloseSurface ConstRadEdgeFillet Constraint Constraints

,

CreateReferenceFromBRepName CreateReferenceFromGeometry CreateReferenceFromName CreateReferenceFromObject

D Deactivate Density DesactivatePosition

,

Diameter.Value Dimension.Value DirectionOrientation

,

DirectionType

,

DistanceConfig DistanceDirection Documents.Add Documents.Open Draft DraftAngle.Value DraftDomain DraftDomains.Item

E EdgePropagation

,

EdgesToFillet EdgesToKeep

,

ElementsToChamfer ExternalThickness.Value

F FaceFillet FaceToRemove FacesToDraft FacesToRemove FacesToThicken FeatureToLocatePositions FilletVariation FirstAngle.Value

,

FirstDirectionRepartition.InstancesCount.Value FirstDirectionRepartition.Spacing.Value FirstDirectionRow.Value FirstFace

,

FirstLimit.Dimension.Value FirstLimit.LimitMode

,

FirstLimit.LimitingElement FirstOrientation

, ,

G GeometricElements GetConstraintElement GetConstraintVisuLocation GetDirection

,

,

GetFirstDirection GetOrigin GetPullingDirection GetRotationAxis GetRotationCenter GetSecondDirection Groove

H HeadAngle.Value HeadDepth.Value HeadDiameter.Value Hole HybridBodies

I ImposedVertexRadius ImposedVertices InWorkObject Inactivate InternalThickness.Value Intersect IsInactive IsSymmetric

, ,

,

,

,

IsUpToDate Item ItemToCopy

L Length1.Value Length2.Value

M MergeMode

,

Mirror MirroringObject MirroringPlane Mode

,

,

MultiselectionMode

N NeutralElement NeutralPropagationMode

O ObjectsToFillet Offset.Value OffsetSide Orientation

,

OriginElements.PlaneXY OriginElements.PlaneYZ OriginElements.PlaneZX

P Pad Parameters Part PartDocument PartingElement

Pocket Propagation PullingDirElement

,

PullingDirectionElement

R RadialAlignment RadialDirectionRow.Value RadialRepartition.InstancesCount.Value RadialRepartition.Spacing.Value Radius.Value

,

RectPattern Reference ReferenceSurfaceElement

,

References Relations Remove

,

RemoveFaceToDraft Reverse ReverseDepth ReverseInnerSide

,

ReverseThickness Rib RotationAngle.Value

,

RotationOrientation

S SecondAngle.Value

,

SecondDirectionRepartition.InstancesCount.Value SecondDirectionRepartition.Spacing.Value SecondDirectionRow.Value SecondFace

,

SecondLimit.Dimension.Value SecondLimit.LimitMode

,

,

SecondLimit.LimitingElement

,

SecondOrientation SetConstraintElement SetConstraintVisuLocation SetDirection

,

,

SetFirstDirection SetKeepAngleOption

,

SetOrigin SetPullingDirection SetRotationAxis SetRotationCenter SetSecondDirection SewSurface SewingSide Shaft ShapeFactory.AddNewAdd ShapeFactory.AddNewAssemble ShapeFactory.AddNewChamfer ShapeFactory.AddNewCircPattern ShapeFactory.AddNewCloseSurface ShapeFactory.AddNewDraft ShapeFactory.AddNewEdgeFilletWithConstantRadius ShapeFactory.AddNewEdgeFilletWithVaryingRadius ShapeFactory.AddNewFaceFillet ShapeFactory.AddNewGroove ShapeFactory.AddNewHole ShapeFactory.AddNewHoleFromPoint ShapeFactory.AddNewHoleFromRefPoint ShapeFactory.AddNewHoleFromSketch ShapeFactory.AddNewHoleWith2Constraints ShapeFactory.AddNewHoleWithConstraint ShapeFactory.AddNewIntersect ShapeFactory.AddNewMirror ShapeFactory.AddNewPad ShapeFactory.AddNewPadFromRef ShapeFactory.AddNewPocket

ShapeFactory.AddNewPocketFromRef ShapeFactory.AddNewRectPattern ShapeFactory.AddNewRemove ShapeFactory.AddNewRib ShapeFactory.AddNewSewSurface ShapeFactory.AddNewShaft ShapeFactory.AddNewShell ShapeFactory.AddNewSlot ShapeFactory.AddNewSplit ShapeFactory.AddNewStiffener ShapeFactory.AddNewThickSurface ShapeFactory.AddNewThickness ShapeFactory.AddNewTrim ShapeFactory.AddNewTritangentFillet ShapeFactory.AddNewUserPattern Shapes.Item

,

Shell Side Sketch

,

,

,

,

Slot Split SplittingSide

,

Status Stiffener Surface

,

,

,

swap_OffsetSide

T ThickSurface Thickness.Value Thickness ThreadDepth.Value ThreadDiameter.Value ThreadPitch.Value ThreadSide

,

,

,

ThreadingMode TopOffset.Value Trim TritangentFillet Type

,

U UnUpdatedConstraintsCount Update UpdateObject UserPattern

V VarRadEdgeFillet

W WithdrawEdgeToFillet WithdrawEdgeToKeep

,

WithdrawElementToChamfer WithdrawFaceToKeep WithdrawFaceToKeep2 WithdrawFaceToRemove WithdrawFaceToRemove2 WithdrawFaceToThicken WithdrawImposedVertex WithdrawObjectToFillet

,