part design journaling preface glossary indexdunet.nicolas.free.fr/catiav5/prtjg.pdfpreface the...
TRANSCRIPT
Part Design Journaling
Preface
Basic Tasks
Advanced Tasks
Glossary
Index
© Dassault Systèmes 1994-2000. All rights reserved.
PrefaceThe CATIA - Part Design Journaling Guide has been designed to show you how to create apart starting from a CATIA script document. This book aims at illustrating the several stages ofcreation you may encounter.
The information contained in this guide is specific to Version 5 Release 5 of the CATIA - PartDesign workbench, which operates in a WINDOWS or UNIX workstation environment under theAIX, IRIX, SUN OS and HP-UX operating system.
Basic Tasks
CATPart DocumentSketch-Based Features
Dress-Up FeaturesSurface-Based FeaturesTransformation Features
Part BasicsPart Constraints
CATPart Document
New CATPartOpen CATPart
Create a CATPart DocumentDefinitionCreates a new part.Note the reference planes and the part body are implicitly created, see Properties and Body toretrieve them.
Methods
Documents.Add
Creates a document object and adds it to the documents collection.This document becomes the active one, and a window is created to accomodate it whichbecomes the active window.Syntax
Documents.Add ( iDocType ) as DocumentiDocType as String
The type of the document to be created, here a CATPart.= "Part"
ExampleCATIA.Documents.Add ( "Part" )
Running The MacroOpen CATIA.1. Load the CreateCATPart1.CATScript macro.2. Run the macro.3.
Open a CATPart DocumentDefinitionOpen an existing part.
Methods
Documents.Open
Opens and reads a document stored in a file, displays it in a new window, adds the document tothe documents collection and the window to the windows collection, and makes both thedocument and the window the active ones.Syntax
Documents.Add ( iFileName ) as DocumentiFileName as String
The string containing the document name and path to be opened. Example
CATIA.Documents.Open ( "C:\PartDirectory\UserPart.CATPart" )
Running The MacroOpen CATIA.1. Check in OpenCATPart1.CATScript the path to the Part Design Journaling Guide directorysample.
2.
Load the OpenCATPart1.CATScript macro.3. Run the macro.4.
Sketch-Based Features
PadDrafted Filleted Pad
PocketDrafted Filleted Pocket
ShaftGroove
HoleRibSlot
Stiffener
PadDefinitionA 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 PadiSketch 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 PadiProfileElement 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 DoubleA safe array with three elements : x, y, z direction coordinates.The array must be previously initialized.
ExampleDim PadDirection ( 2 ) As DoubleDim 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
ReverseInnerSideExample
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 extrusiondirection vector.= 1, the pad is extruded with the reverse orientation as the one given by its extrusiondirection vector.
ExamplePadDirectionOrientation = UserPad.DirectionOrientationUserPad.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 = 0Syntax
FirstLimit.Dimension.Value as DoubleExample
PadFirstLimitDimension = UserPad.FirstLimit.Dimension.ValueUserPad.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.
ExamplePadFirstLimitLimitMode = UserPad.FirstLimit.LimitModeUserPad.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
4Syntax
FirstLimit.LimitingElement as ReferenceExample
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.
ExamplePadSymmetry = 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 = 0Syntax
SecondLimit.Dimension.Value as DoubleExample
PadSecondLimitDimension = UserPad.SecondLimit.Dimension.ValueUserPad.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.LimitModeUserPad.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 = 3or 4Syntax
SecondLimit.LimitingElement as ReferenceExample
PadSecondLimitLimitingElement = UserPad.SecondLimit.LimitingElementUserPad.SecondLimit.LimitingElement = UserReference
Shapes.Item
Gets a shape using its index or its name from the Shapes collection.Syntax
Shapes.Item ( iIndex ) as PadiIndex
The index or the name of the shape to retrieve from the collection of shapes. As anumerics, this index is the rank of the shape in the collection.
ExampleSet UserPad= UserBody.Shapes.Item ( "Pad.1" )
Sketch
Gets the pad's sketch.Syntax
Sketch as SketchExample
Set SketchOfUserPad = UserPad.Sketch
Running The MacroOpen the Pad1.CATPart document.1.
Load the Pad1.CATScript macro.2. Run the macro.3.
Drafted Filleted PadDefinitionA pad is created by extruding a profile represented by a sketch in one direction, while drafting itslateral 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 MacroOpen the DraftedFilletedPad1.CATPart document.1.
Load the DraftedFilletedPad1.CATScript macro.2. Run the macro.3.
PocketDefinitionA pocket is created by extruding a profile represented by a sketch in one or two oppositedirections.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 PocketiSketch 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 PocketiProfileElement 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.
ExampleDim PocketDirection ( 2 ) As DoubleDim 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 toreach.Syntax
ReverseInnerSideExample
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.
ExamplePocketDirectionType = UserPocket.DirectionTypeUserPocket.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 extrusiondirection vector.= 1, the pocket is extruded with the reverse orientation as the one given by its extrusiondirection vector.
ExamplePocketDirectionOrientation = UserPocket.DirectionOrientationUserPocket.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 = 0Syntax
FirstLimit.Dimension.Value as DoubleExample
PocketFirstLimitDimension = UserPocket.FirstLimit.Dimension.ValueUserPocket.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.
ExamplePocketFirstLimitLimitMode = UserPocket.FirstLimit.LimitModeUserPocket.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 or4Syntax
FirstLimit.LimitingElement as ReferenceExample
PocketFirstLimitLimitingElement = UserPocket.FirstLimit.LimitingElementUserPocket.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.
ExamplePocketSymmetry = UserPocket.IsSymmetricUserPocket.IsSymmetric = True
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 = 0Syntax
SecondLimit.Dimension.Value as DoubleExample
PocketSecondLimitDimension = UserPocket.SecondLimit.Dimension.ValueUserPocket.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.LimitModeUserPocket.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 = 3or 4Syntax
SecondLimit.LimitingElement as ReferenceExample
PocketSecondLimitLimitingElement = UserPocket.SecondLimit.LimitingElementUserPocket.SecondLimit.LimitingElement = UserReference
Shapes.Item
Returns a shape using its index or its name from the Shapes collection.Syntax
Shapes.Item (iIndex) as PocketiIndex
The index or the name of the shape to retrieve from the collection of shapes. As anumerics, this index is the rank of the shape in the collection.
ExampleSet UserPocket= UserBody.Shapes.Item ( "Pocket.1" )
Sketch
Gets the pocket's sketch.Syntax
Sketch as SketchExample
Set SketchOfUserPocket = UserPocket.Sketch
Running The MacroOpen the Pocket1.CATPart document.1.
Load the Pocket1.CATScript macro.2. Run the macro.3.
Drafted Filleted PocketDefinitionA pocket is created by extruding a profile represented by a sketch in one direction, while draftingits lateral faces and filleting its edges.The drafted filleted pocket combines Pocket, Draft Angle and Edge Fillet methods andproperties.It is a "negative" shape: it removes material to the body it belongs to.
Running The MacroOpen the DraftedFilletedPocket1.CATPart document.1.
Load the DraftedFilletedPocket1.CATScript macro.2. Run the macro.3.
ShaftDefinitionA shaft is made up of a sketch, used as the shaft profile, and containing an axis, used as therevolution 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 ShaftiSketch 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 axisthat 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 thecurve in the space around the axis, the shaft operation will define a revolution shape. Thisalso works if the sketch contains a closed contour and an axis outside of this contour: inthat case a revolution shape will be created, for example a torus.
ExampleSet 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 theplane perpendicular to the revolution axis, and is counted positive clockwise when looking at thisplane in the revolution axis direction.Syntax
FirstAngle.Value as DoubleExample
ShaftFirstAngle = UserShaft.FirstAngle.ValueUserShaft.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 theplane perpendicular to the revolution axis, and is counted positive counterclockwise whenlooking at this plane in the revolution axis direction. Its default value is 0.Syntax
SecondAngle.Value as DoubleExample
ShaftSecondAngle = UserShaft.SecondAngle.ValueUserShaft.SecondAngle.Value = 360.000000
Shaft
Dimensions an object as shaft.Example
Dim UserShaft as Shaft
Sketch
Gets the shaft's sketch.Syntax
Sketch as SketchExample
Set SketchOfUserShaft = UserShaft.Sketch
Running The MacroOpen the Shaft1.CATPart document.1.
Load the Shaft1.CATScript macro.2. Run the macro.3.
GrooveDefinitionA groove is made up of a sketch, used as the groove profile, and containing an axis, used as therevolution 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 GrooveiSketch 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 thespace, thus defining the groove.The contour has to penetrate in 3D space the current shape.
ExampleSet 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 theplane perpendicular to the revolution axis, and is counted positive clockwise when looking at thisplane in the revolution axis direction.Syntax
FirstAngle.Value as DoubleExample
GrooveFirstAngle = UserGroove.FirstAngle.ValueUserGroove.FirstAngle.Value = 0.000000
Groove
Dimensions an object as Groove.
ExampleDim 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 theplane perpendicular to the revolution axis, and is counted positive counterclockwise whenlooking at this plane in the revolution axis direction. Its default value is 0.Syntax
SecondAngle.Value as DoubleExample
GrooveSecondAngle = UserGroove.SecondAngleUserGroove.SecondAngle.Value = 360.000000
Sketch
Gets the groove's sketch.Syntax
Sketch as SketchExample
Set SketchOfUserGroove = UserGroove.Sketch
Running The MacroOpen the Groove1.CATPart document.1.
Load the Groove1.CATScript macro.2. Run the macro.3.
HoleDefinitionA hole is created by removing material from a body. Various shapes of standard holes can becreated.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 HoleiSupport 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 DoubleThe hole depth.
ExampleSet 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 HoleiX, 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 ReferenceThe support defining the hole reference plane.
iDepth as DoubleThe hole depth.
ExampleSet 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 HoleiOrigin 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 HoleiSketch 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 3Dpasses through that point and is normal to the sketch plane.
iDepth as DoubleThe hole depth.
ExampleSet 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 DoubleOrigin 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 ReferenceThe 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 beoverridden).If not, the origin of the hole will have a length constraint with the edge.
iSupport as ReferenceThe support defining the hole reference plane.
iDepth as DoubleThe hole depth.
ExampleSet 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 DoubleOrigin 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 ReferenceThe first edge which the hole is constrained to.The origin of the hole will have a length constraint with the first edge.
iEdge2 as ReferenceThe second edge which the hole is constrained to.The origin of the hole will have a length constraint with the second edge.
iSupport as ReferenceThe support defining the hole reference plane.
iDepth as DoubleThe hole depth.
ExampleSet 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.
ExampleDim HoleDirection ( 2 ) As DoubleDim 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 ReferenceExample
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.
ExampleDim HoleOrigin ( 2 ) As DoubleDim 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
ReverseExample
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 3Syntax
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
ExampleHoleAnchorMode = UserHole.AnchorModeUserHole.AnchorMode = 0
BottomAngle.Value
Gets or sets the hole bottom angle.This property is valid when the hole bottom type is conic: BottomType = 1Syntax
BottomAngle.Value as DoubleExample
HoleBottomAngle = UserHole.BottomAngle.ValueUserHole.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 = 0Syntax
BottomLimit.Dimension.Value as DoubleExample
HoleBottomLimitDimension = UserHole.BottomLimit.Dimension.ValueUserHole.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.
ExampleHoleBottomLimitLimitMode = UserHole.BottomLimit.LimitModeUserHole.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 = 3or 4Syntax
FirstLimit.LimitingElement as ReferenceExample
HoleFirstLimitLimitingElement = UserHole.FirstLimit.LimitingElementUserHole.FirstLimit.LimitingElement = UserReference
BottomType
Gets or sets the hole bottom type.This property is valid when the hole type is simple: Type = 0Syntax
BottomType as Long
= 0, the hole bottom is flat= 1, the hole bottom is conic
ExampleHoleBottomType = UserHole.BottomTypeUserHole.BottomType = 0
Diameter.Value
Gets or sets the hole diameter.Syntax
Diameter.Value as DoubleExample
HoleDiameter = UserHole.Diameter.ValueUserHole.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 = 1or 2 or 3Syntax
HeadAngle.Value as DoubleExample
HoleHeadAngle = UserHole.HeadAngle.ValueUserHole.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 4Syntax
HeadDepth.Value as DoubleExample
HoleHeadDepth = UserHole.HeadDepth.ValueUserHole.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 3Syntax
HeadDiameter.Value as DoubleExample
HoleHeadDiameter = UserHole.HeadDiameter.ValueUserHole.HeadDiameter.Value = 20.000000
Hole
Dimensions an object as hole .Example
Dim UserHole as hole
Sketch
Gets the hole's sketch.Syntax
Sketch as SketchExample
Set SketchOfUserHole = UserHole.Sketch
ThreadDepth.Value
Gets or sets the hole threading depth.This property is valid when the hole is threaded: ThreadingMode = 0Syntax
ThreadDepth.Value as DoubleExample
HoleThreadDepth = UserHole.ThreadDepth.ValueUserHole.ThreadDepth = 5.000000
ThreadDiameter.Value
Gets or sets the hole threading diameter.This property is valid when the hole is threaded: ThreadingMode = 0Syntax
ThreadDiameter.Value as DoubleExample
HoleThreadDiameter = UserHole.ThreadDiameter.ValueUserHole.ThreadDiameter.Value = 10.000000
ThreadPitch.Value
Gets or sets the hole threading pitch.This property is valid when the hole is threaded: ThreadingMode = 0Syntax
ThreadPitch.Value as DoubleExample
HoleThreadPitch = UserHole.ThreadPitch.ValueUserHole.ThreadPitch.Value = 1.000000
ThreadSide
Gets or sets the hole threading side.This property is valid when the hole is threaded: ThreadingMode = 0Syntax
ThreadSide as Long= 0, the hole is right-threaded.= 1, the hole is left-threaded.
ExampleHoleThreadSide = UserHole.ThreadSideUserHole.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
ExampleHoleThreadingMode = UserHole.ThreadingModeUserHole.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
ExampleHoleType = UserHole.Type UserHole.Type = 0
Running The MacroOpen the Hole1.CATPart document.1.
Load the Hole1.CATScript macro.2. Run the macro.3.
RibDefinitionThe rib shape is made up of a profile represented by a sketch swept along a center curverepresented 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 RibiSketch 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 definitionsketch iSketch within the inner part of its contour.
ExampleSet UserRib = CATIA.ActiveDocument.Part.ShapeFactory.AddNewRib ( UserSketch,UserCenterCurve )
SetKeepAngleOption
Sets the Keep angle profil control option.Syntax
SetKeepAngleOptionExample
UserRib.SetKeepAngleOption
Properties
CenterCurveElement
Gets or sets the rib's center curve.The rib is built along this reference.Syntax
CenterCurveElement as ReferenceExample
UserRib.CenterCurveElement = UserReferenceSet 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.
ExampleRibMergeMode = UserRib.MergeModeUserRib.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 ReferenceExample
UserRib.PullingDirElement = UserReferenceSet 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 ReferenceExample
UserRib.ReferenceSurface = UserReferenceSet ReferenceSurfaceOfUserRib = UserRib.ReferenceSurfaceElement
Rib
Dimensions an object as Rib.Example
Dim UserRib as Rib
Sketch
Gets the rib's sketch.Syntax
Sketch as SketchExample
Set SketchOfUserRib = UserRib.Sketch
Running The MacroOpen the Rib1.CATPart document.1.
Load the Rib1.CATScript macro.2. Run the macro.3.
SlotDefinitionThe slot shape is made up of a profile represented by a sketch swept along a center curverepresented 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 SlotiSketch 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 definitionsketch iSketch within the inner part of its contour.
ExampleSet UserSlot = CATIA.ActiveDocument.Part.ShapeFactory.AddNewSlot ( UserSketch,UserCenterCurve )
SetKeepAngleOption
Sets the Keep angle profil control option.Syntax
SetKeepAngleOptionExample
UserSlot.SetKeepAngleOption
Properties
CenterCurveElement
Gets or sets the slot's center curve.The slot is built along this reference.Syntax
CenterCurveElement as ReferenceExample
UserSlot.CenterCurveElement = UserReferenceSet 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.
ExampleSlotMergeMode = UserSlot.MergeModeUserSlot.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 ReferenceExample
UserSlot.PullingDirElement = UserReferenceSet 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 ReferenceExample
UserSlot.ReferenceSurface = UserReferenceSet ReferenceSurfaceOfUserSlot = UserSlot.ReferenceSurfaceElement
Sketch
Gets the slot's sketch Syntax
Sketch as SketchExample
Set SketchOfUserSlot = UserSlot.Sketch
Slot
Dimensions an object as Slot.Example
Dim UserSlot as Slot
Running The MacroOpen the Slot1.CATPart document.1.
Load the Slot1.CATScript macro.2. Run the macro.3.
StiffenerDefinitionA stiffener is made up of a sketch used as the stiffener profile, that is extruded (offset) and thatfills 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 thatfills the nearest shape.Syntax
ShapeFactory.AddNewStiffener ( iSketch ) as StiffeneriSketch 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.
ExampleSet UserStiffener = CATIA.ActiveDocument.Part.ShapeFactory.AddNewStiffener (UserSketch )
ReverseDepth
Reverses the stiffener direction. This is useful for finding the shape to reach.Syntax
ReverseDepthExample
UserStiffener.ReverseDepth
ReverseThickness
Reverses the stiffener thickness direction. The stiffener thickness is swapped with respect to thebase sketch.Syntax
ReverseThicknessExample
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.
ExampleStiffenerSymmetry = UserStiffener.IsSymmetricUserStiffener.IsSymmetric = True
Sketch
Gets the stiffener's sketch.Syntax
Sketch as SketchExample
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 DoubleExample
StiffenerThickness = UserStiffener.Thickness.ValueUserStiffener.Thickness.Value = 10.000000
Running The MacroOpen the Stiffener1.CATPart document.1.
Load the Stiffener1.CATScript macro.2.
Run the macro.3.
Dress-Up Feature
Edge FilletVariable Radius Fillet
Face-Face FilletTritangent Fillet
ChamferDraft Angle
Draft Reflect LineShell
Thickness
Edge FilletDefinitionThe 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, ) asConstRadEdgeFillet
iEdgeToFillet as ReferenceThe first edge to be filleted.
iEdgePropagation as LongControls whether other edges found adjacent to the first one should also be filleted in thesame operation.See EdgePropagation syntax.
iRadius as DoubleThe fillet radius.
ExampleSet 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 naturalrelimitation.= 1, the fillet is propagated to all the tangent contiguous edges.
ExampleEdgeFilletEdgePropagation = UserEdgeFillet.EdgePropagationUserEdgeFillet.EdgePropagation = 0
EdgesToKeep
Gets the collection of edges to be kept by the edge fillet.Syntax
EdgesToKeep as ReferencesExample
Set EdgesKeptCollection = UserEdgeFillet.EdgesToKeep
ObjectsToFillet
Gets the collection of reference elements to be filleted.Syntax
ObjectsToFillet as ReferencesExample
Set FilletedObjectsCollection = UserEdgeFillet.ObjectsToFillet
Radius.Value
Gets or sets the edge fillet constant radius.Syntax
Radius.Value as DoubleExample
EdgeFilletRadius = UserEdgeFillet.Radius.ValueUserEdgeFillet.Radius.Value = 5.000000
Running The MacroOpen the EdgeFillet1.CATPart document.1.
Load the EdgeFillet1.CATScript macro.2. Run the macro.3.
Variable Radius FilletDefinitionThe 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 ReferenceThe first edge to be filleted.
iEdgePropagation as LongControls whether other edges found adjacent to the first one should also be filleted in thesame operation.See EdgePropagation syntax.
iFilletVariation as LongControls the law of evolution for the fillet radius between specified control points, such asedges extremities.See FilletVariation syntax.
iDefaultRadius as DoubleThe fillet radius.
ExampleSet 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 theedge.
ExampleUserVariableRadiusFillet.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 naturalrelimitation.= 1, the fillet is propagated to all the tangent contiguous edges.
ExampleVariableRadiusFilletEdgePropagation = UserVariableRadiusFillet.EdgePropagationUserVariableRadiusFillet.EdgePropagation = 0
EdgesToFillet
Gets the collection of edges to be filleted.Syntax
EdgesToFillet as ReferencesExample
Set FilletedEdgesCollection = UserVariableRadiusFillet.EdgesToFillet
EdgesToKeep
Gets the collection of edges to be kept by the edge fillet.Syntax
EdgesToKeep as ReferencesExample
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.
ExampleVariableRadiusFilletFilletVariation = UserVariableRadiusFillet.FilletVariationUserVariableRadiusFillet.FilletVariation = 0
ImposedVertexRadius
Gets the fillet radius on an imposed vertex.Syntax
ImposedVertexRadius ( iImposedVertex ) as DoubleiImposedVertex 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 ReferencesExample
Set ImposedVerticesCollection = UserVariableRadiusFillet.ImposedVertices
VarRadEdgeFillet
Dimensions an object as variable radius fillet.Example
Dim UserVariableRadiusFillet as VarRadEdgeFillet
Running The MacroOpen the VariableRadiusFillet1.CATPart document.1.
Load the VariableRadiusFillet1.CATScript macro.2. Run the macro.3.
Face-Face FilletDefinitionA 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 FaceFilletiF1 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 ReferenceExample
FaceFaceFilletFirstFace = UserFaceFaceFillet.FirstFace UserFaceFaceFillet.FirstFace = UserFace
Radius.Value
Gets or sets the face fillet radius.Syntax
Radius.Value as DoubleExample
FaceFaceFilletRadius = UserFaceFaceFillet.Radius.ValueUserFaceFaceFillet.Radius.Value = 5.000000
SecondFace
Gets or sets the second limiting face.Syntax
SecondFace as ReferenceExample
FaceFaceFilletSecondFace = UserFaceFaceFillet.SecondFaceUserFaceFaceFillet.SecondFace = UserFace
Running The MacroOpen the FaceFaceFillet1.CATPart document.1.
Load the FaceFaceFillet1.CATScript macro.2. Run the macro.3.
Tritangent FilletDefinitionThe Tritangent Fillet feature: a fillet is built between three faces, two faces will be relimited, thethird one ("face to remove") will be used for fillet tangency and will disappear within the resultingshape.
Methods
ShapeFactory.AddNewTritangentFillet
Creates a new tritangent filletwithin the current body.Syntax
ShapeFactory.AddNewTritangentFillet ( iF1, iF2, iRemovedFace ) as TritangentFilletiF1 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 toiF2.This face will be removed at the end of the filleting operation.
ExampleSet 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 ReferenceExample
TritangentFilletFaceToRemove = UserTritangentFillet.FaceToRemoveUserTritangentFillet.FaceToRemove = UserFace
FirstFace
Gets or sets the first face limiting the tritangent fillet.Syntax
FirstFace as ReferenceExample
TritangentFilletFirstFace = UserTritangentFillet.FirstFaceUserTritangentFillet.FirstFace = UserFace
SecondFace
Gets or sets the second face limiting the tritangent fillet.Syntax
SecondFace as ReferenceExample
TritangentFilletSecondFace = UserTritangentFillet.SecondFaceUserTritangentFillet.SecondFace = UserFace
TritangentFillet
Dimensions an object as TritangentFillet.Example
Dim UserTritangentFillet as TritangentFillet
Running The Macro
Open the TritangentFillet1.CATPart document.1.
Load the TritangentFillet1.CATScript macro.2. Run the macro.3.
ChamferDefinitionA chamfer is made up of a list of geometrical elements to process, such as faces, and is definedusing 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 ReferenceThe first edge or face to be chamfered.
iPropagation as LongControls if and how the chamfering operation should propagate beyond when the firstchamfer element iObjectToChamfer is an edge.See Propagation syntax.
iMode as LongControls if the chamfer is defined with two lengthes, or with an angle and a lengthThe value of this argument changes the way the arguments iLength1 and iLength2OrAngleshould be interpreted.See Mode syntax.
iOrientation as LongDefines the relative meaning of arguments iLength1 and iLength2OrAngle when defining achamfer with two lengthes.See Orientation syntax.
iLength1 as DoubleThe first value for chamfer dimensioning.It represents the chamfer first length if the chamfer is defined with two lengthes, or thechamfer length if the chamfer is defined with a length and an angle.
iLength2OrAngle as DoubleThe second value for chamfer dimensioning.It represents the chamfer second length if the chamfer is defined with two lengthes, or thechamfer angle if the chamfer is defined with a length and an angle.
ExampleSet 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 = 1Syntax
Angle.Value as DoubleExample
ChamferAngle = UserChamfer.Angle.ValueUserChamfer.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 ReferencesExample
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 isdefined with a length and an angle.Syntax
Length1.Value as DoubleExample
ChamferLength1 = UserChamfer.Length1.ValueUserChamfer.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 = 0Syntax
Length2.Value as DoubleExample
ChamferLength2 = UserChamfer.Length2.ValueUserChamfer.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 alength 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.
ExampleChamferMode = UserChamfer.ModeUserChamfer.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.
ExampleChamferOrientation = UserChamfer.OrientationUserChamfer.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 edgeextremities, as long as they are tangent with it. This process repeats until no more tangentedges 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 twochamfer created edges.
ExampleChamferPropagation = UserChamfer.PropagationUserChamfer.Propagation = 0
Running The MacroOpen the Chamfer1.CATPart document.1.
Load the Chamfer1.CATScript macro.2. Run the macro.3.
Draft AngleDefinitionA 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 ReferenceThe first face to draft in the body. This face should be adjacent to the iFaceToDraft face. Ifseveral faces are to be drafted, only the first one is specified here, the others beinginferred by propagating the draft operation onto faces adjacent to this first face. This iscontrolled by the iNeutralMode argument.
iNeutral as ReferenceThe reference face for the draft. The draft needs a reference face on the body, that willremain unchanged in the draft operation, while faces adjacent to it and specified fordrafting will be rotated according to the draft angle iAngle.
iNeutralPropagationMode as LongControls if and how the drafting operation should be propagated beyond the first face todraft iFaceToDraft to other adjacent faces.See NeutralPropagationMode syntax.
iParting as ReferenceThe draft parting plane, face or surface. It specifies the element within the body to draftthat represents the bottom of the mold. This element can be located either somewhere inthe middle of the body or be one of its boundary faces. When located in the middle of thebody, it crosses the faces to draft, and as a result, those faces are drafted with a positiveangle on one side of the parting surface, and with a negative angle on the other side.
iDirX, iDirY, iDirZ as DoubleThe X, Y, and Z components of the absolute vector representing the drafting direction (i.e.the mold extraction direction).
iMode as LongThe 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 asneighbors 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.
ExampleSet 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.
ExampleDim DraftPullingDirection ( 2 ) As DoubleDim 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, iZiX, 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 DraftDomainsiIndex 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 draftdomain is Count.
ExampleSet 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 DoubleExample
DraftAngle = UserDraftDomain.DraftAngle.ValueUserDraftDomain.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 ReferencesExample
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.
ExampleDraftMode = UserDraft.ModeUserDraft.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.
ExampleDraftMultiselectionMode = UserDraftDomain.MultiselectionModeUserDraftDomain.MultiselectionMode = 0
NeutralElement
Gets or sets the draft neutral element.Syntax
NeutralElement as ReferenceExample
DraftNeutralElement = UserDraftDomain.NeutralElementUserDraftDomain.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 tangentsurfaces.
ExampleDraftNeutralPropagationMode = UserDraftDomain.NeutralPropagationModeUserDraftDomain.NeutralPropagationMode = 0
PartingElement
Gets or sets the draft parting element.Syntax
PartingElement as ReferenceExample
DraftPartingElement = UserDraft.PartingElementUserDraft.PartingElement = UserReference
PullingDirectionElement
Gets or sets the draft pulling direction element.Syntax
PullingDirectionElement as ReferenceExample
DraftPullingDirectionElement = UserDraftDomain.PullingDirectionElementUserDraftDomain.PullingDirectionElement = UserReference
Running The MacroOpen the DraftAngle1.CATPart document.1.
Load the DraftAngle1.CATScript macro.2. Run the macro.3.
Draft Reflect LineDefinitionA draft reflect line shape is made up of draft domains (at least one) and of a parting element, anddraft a face by using reflect lines as neutral lines from which the resulting faces will be generatedThe draft reflect line reuses Draft Angle methods and properties.
Methods and Properties
Running The MacroOpen the DraftReflectLine1.CATPart document.1.
Load the DraftReflectLine1.CATScript macro.2. Run the macro.3.
ShellDefinitionA 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 ) asShell
iFaceToRemove as ReferenceThe first face to be removed in the shell process.
iInternalThickness as DoubleThe thickness of material to be added on the internal side of all the faces during the shellprocess, except for those to be removed.
iExternalThickness as DoubleThe thickness of material to be added on the external side of all the faces during the shellprocess, except for those to be removed.
ExampleSet 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 DoubleExample
ShellExternalThickness = UserShell.ExternalThickness.ValueUserShell.ExternalThickness.Value = 1.000000
FacesToRemove
Gets the collection of faces to be removed by the shell process.Syntax
FacesToRemove as ReferencesExample
Set FacesToRemoveCollection = UserShell.FacesToRemove
InternalThickness.Value
Gets or sets the shell internal thickness.Syntax
InternalThickness.Value as DoubleExample
ShellInternalThickness = UserShell.InternalThickness.ValueUserShell.InternalThickness.Value = 1.000000
Running The MacroOpen the Shell1.CATPart document.1.
Load the Shell1.CATScript macro.2. Run the macro.3.
ThicknessDefinitionThe 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 ThicknessiFaceToThicken 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 offeredby the created thickness.
iOffset as DoubleThe thickness of material to be added on the external side of the face iFaceToThickenduring the thickening process.
ExampleSet 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 DoubleExample
ThicknessOffset = UserThickness.Offset.ValueUserThickness.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 ReferenceExample
Set FacesToThickenCollection = UserThickness.FacesToThicken
Running The MacroOpen the Thickness1.CATPart document.1.
Load the Thickness1.CATScript macro.2. Run the macro.3.
Surface-Based Feature
SplitThick SurfaceClose SurfaceSew Surface
SplitDefinitionSplits 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 SplitiSplittingElement 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 splitoperation.See SplittingSide syntax.
ExampleSet 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 thesplitting element normal vector. This vector is oriented towards the outside of the materialwhen 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.SplittingSideUserSplit.SplittingSide = 0
Surface
Gets or sets the splitting surface.Syntax
Surface as ReferenceExample
SplitSurface = UserSplit.SurfaceUserSplit.Surface = UserSurface
Running The MacroOpen the Split1.CATPart document.1.
Load the Split1.CATScript macro.2.
Run the macro.3.
Thick SurfaceDefinitionThicks surface using an offset element (such as a surface or a skin) and two offset values: Topoffset 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 ReferenceThe skin that will be thicken and added with the current body.
iOffsetSide as LongThe direction of the offset in regard to the direction of the normal.See OffsetSide syntax.
iTopOffset as DoubleThe Offset between the iOffsetElement and the upper skin of the resulting feature.
iBottomOffset as DoubleThe Offset between the iOffsetElement and the lower skin of the resulting feature.
ExampleSet UserThickSurface = CATIA.ActiveDocument.Part.ShapeFactory.AddNewThickSurface( UserSurface, 0, 15.00000, 10.000000 )
swap_OffsetSide
Swaps the side of the offset.Syntax
swap_OffsetSideExample
UserThickSurface.swap_OffsetSide
Properties
BotOffset.Value
Gets or sets the thick surface bottom offset length.Syntax
BotOffset.Value as DoubleExample
ThickSurfaceBottomOffset = UserThickSurface.BotOffset.ValueUserThickSurface.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.
ExampleThickSurfaceOffsetSide = UserThickSurface.OffsetSideUserThickSurface.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 thesplitting element normal vector. This vector is oriented towards the outside of the materialwhen a face is selected= 1, material in the splitted element should be removed in the reverse direction to the oneindicated by the splitting element normal vector.
ExampleThickSurfaceSplittingSide = UserThickSurface.SplittingSideUserThickSurface.SplittingSide = 0
Surface
Gets or sets the surface to be thicken.Syntax
Surface as ReferenceExample
ThickSurfaceSurface = UserThickSurface.SurfaceUserThickSurface.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 DoubleExample
ThickSurfaceTopOffset = UserThickSurface.TopOffset.ValueUserThickSurface.TopOffset.Value = 15.000000
Running The MacroOpen the ThickSurface1.CATPart document.1.
Load the ThickSurface1.CATScript macro.2. Run the macro.3.
Close SurfaceDefinitionCloses a skin surface.
Methods
ShapeFactory.AddNewCloseSurface
Creates and returns a new close surface operation within the current body.Syntax
ShapeFactory.AddNewCloseSurface ( iCloseElement ) as CloseSurfaceiCloseElement 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 ReferenceExample
CloseSurfaceSurface = UserCloseSurface.SurfaceUserCloseSurface.Surface = UserSurface
Running The MacroOpen the CloseSurface1.CATPart document.1.
Load the CloseSurface1.CATScript macro.2. Run the macro.3.
Sew SurfaceDefinitionSews 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 SewSurfaceiSewingElement 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 sewingoperation.See SewingSide syntax.
ExampleSet 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 thesplitting element normal vector. This vector is oriented towards the outside of the materialwhen a face is selected.= 1, material in the splitted element should be removed in the direction opposite to the oneindicated by the splitting element normal vector.
ExampleSewSurface.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 ReferenceExample
SewSurfaceSurface = UserSewSurface.SurfaceUserSewSurface.Surface = UserSurface
Running The MacroOpen the SewSurface1.CATPart document.1.
Load the SewSurface1.CATScript macro.2. Run the macro.3.
Transformation Features
MirrorRectangular Pattern
Circular PatternUser Pattern
MirrorDefinitionDuplicates 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.
SyntaxMirroringPlane as AnyObject
ExampleMirrorMirroringObject = UserMirror.MirroringPlane
MirroringPlane
Gets or sets the mirroring reference plane.It can be a plane, or a plane face.Syntax
MirroringPlane as ReferenceExample
MirrorMirroringPlane = UserMirror.MirroringPlane UserMirror.MirroringPlane = UserPlane
Running The MacroOpen the Mirror1.CATPart document.1.
Load the Mirror1.CATScript macro.2. Run the macro.3.
Rectangular PatternDefinitionCopies 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 ReferenceThe shape to be copied by the rectangular pattern.
iFirstDirectionInstancesNumber as LongThe number of instances of iShapeToCopy along the pattern first direction.
iSecondDirectionInstancesNumber as LongThe number of instances of iShapeToCopy along the pattern second direction.
iFirstDirectionOffset as DoubleThe offset that will separate two consecutive instances in the pattern along its firstdirection.
iSecondDirectionOffset as DoubleThe offset that will separate two consecutive instances in the pattern along its seconddirection.
iFirstDirectionPosition as LongSpecifies the position of the original shape iShapeToCopy among its instances alongiFirstDirection.
iSecondDirectionPosition as LongSpecifies the position of the original shape iShapeToCopy among its instances alongiSecondDirection.
iFirstDirection as ReferenceThe line or linear edge that specifies the pattern first distribution direction.
iSecondDirection as ReferenceThe 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 BooleanThe flag indicating the iSecondDirection orientation.See SecondOrientation syntax.
iRotationAngle as DoubleThe angle applied to both directions iFirstDirection and iSecondDirection prior to applyingthe 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 notnecessarily parallel to it.
ExampleSet 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.
ExampleDim PatternFirstDirection ( 2 ) As DoubleDim 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.
ExampleDim PatternSecondDirection ( 2 ) As DoubleDim 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 LongExample
Number = UserRectangularPattern.FirstDirectionRepartition.InstancesCount.ValueUserRectangularPattern.FirstDirectionRepartition.InstancesCount.Value = 5
FirstDirectionRepartition.Spacing.Value
Gets or sets the spacing between instances along the first direction.Syntax
FirstDirectionRepartition.Spacing.Value as DoubleExample
Spacing = UserRectangularPattern.FirstDirectionRepartition.Spacing.ValueUserRectangularPattern.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 LongExample
Row = UserRectangularPattern.FirstDirectionRow.ValueUserRectangularPattern.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 firstdirection.
ExampleNaturalOrientation = UserRectangularPattern.FirstOrientationUserRectangularPattern.FirstOrientation = True
ItemToCopy
Gets or sets the shape to be copied.Syntax
ItemToCopy as ReferenceExample
Set Shape = UserRectangularPattern.ItemToCopyUserRectangularPattern.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 DoubleExample
Angle = UserRectangularPattern.RotationAngle.ValueUserRectangularPattern.RotationAngle.Value = 45.000000
SecondDirectionRepartition.InstancesCount.Value
Gets or sets the number of instances along the second direction.Syntax
SecondDirectionRepartition.InstancesCount.Value as Long
ExampleNumber = UserRectangularPattern.SecondDirectionRepartition.InstancesCount.ValueUserRectangularPattern.SecondDirectionRepartition.InstancesCount.Value = 5
SecondDirectionRepartition.Spacing.Value
Gets or sets the spacing between instances along the second direction.Syntax
SecondDirectionRepartition.Spacing.Value as DoubleExample
Spacing = UserRectangularPattern.SecondDirectionRepartition.Spacing.ValueUserRectangularPattern.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 LongExample
Row = UserRectangularPattern.SecondDirectionRow.ValueUserRectangularPattern.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 seconddirection.= False, the pattern is copied in the reverse direction of the natural orientation of thesecond direction.
ExampleNaturalOrientation = UserRectangularPattern.SecondOrientationUserRectangularPattern.SecondOrientation = True
Running The MacroOpen the RectangularPattern1.CATPart document.1.
Load the RectangularPattern1.CATScript macro.2. Run the macro.3.
Circular PatternDefinitionThe shape is duplicated along concentric circles to build crowns. A linear repartition object defines theduplication along radial directions, thus determining the number of crowns. An angular repartition objectdefines 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 ReferenceThe shape to be copied by the circular pattern.
iRadialDirectionInstancesNumber as LongThe number of instances of iShapeToCopy along the pattern radial direction.
iAngularDirectionInstancesNumber as LongThe number of instances of iShapeToCopy along the pattern angular direction.
iRadialDirectionOffset as DoubleThe offset that will separate two consecutive instances in the pattern along its radial direction.
iAngularDirectionOffset as DoubleThe angle that will separate two consecutive instances in the pattern along its angular direction.
iRadialDirectionPosition as LongSpecifies the position of the original shape iShapeToCopy among its instances alongiRadialDirection.
iAngularDirectionPosition as LongSpecifies the position of the original shape iShapeToCopy among its instances alongiAngularDirection.
iRotationCenter as ReferenceThe point or vertex that specifies the pattern center of rotation.
iRotationAxis as ReferenceThe line or linear edge that specifies the axis around which instances will be rotated relative toeach other.
iRotationOrientation as BooleanThe flag indicating the iRotationAxis orientation.See RotationOrientation syntax.
iRotationAngle as DoubleThe 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 necessarilyparallel to it.
iRadialAlignment as BooleanThe boolean flag that indicating the iShapeToCopy instances alignment.See RadialAlignment syntax.
ExampleSet 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.
ExampleDim PatternRotationAxis ( 2 ) As DoubleDim 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 normalis taken into account.
ExampleUserCircularPattern.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.
ExampleDim PatternRotationCenter ( 2 ) As DoubleDim 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 LongExample
Row = UserCircularPattern.AngularDirectionRow.ValueUserCircularPattern.AngularDirectionRow.Value = 2
AngularRepartition.AngularSpacing.Value
Gets or sets the angular spacing between instances along the angular direction.Syntax
AngularRepartition.AngularSpacing.Value as DoubleExample
AngularSpacing = UserCircularPattern.AngularRepartition.AngularSpacing.ValueUserCircularPattern.AngularRepartition.AngularSpacing.Value = 30.00000
AngularRepartition.InstancesCount.Value
Gets or sets the number of instances along the angular direction.Syntax
RadialRepartition.InstancesCount.Value as LongExample
Number = UserCircularPattern.AngularRepartition.InstancesCount.ValueUserCircularPattern.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 ReferenceExample
Set Shape = UserCircularPattern.ItemToCopyUserCircularPattern.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.
ExampleRadialInstancesAlignment = UserCircularPattern.RadialAlignmentUserCircularPattern.RadialAlignment = True
RadialDirectionRow.Value
Gets or sets the position of the shape to be copied along the radial direction.Syntax
RadialDirectionRow.Value as LongExample
Row = UserCircularPattern.RadialDirectionRow.ValueUserCircularPattern.RadialDirectionRow.Value = 2
RadialRepartition.InstancesCount.Value
Gets or sets the number of instances along the radial direction.Syntax
RadialRepartition.InstancesCount.Value as LongExample
Number = UserCircularPattern.RadialRepartition.InstancesCount.ValueUserCircularPattern.RadialRepartition.InstancesCount.Value = 5
RadialRepartition.Spacing.Value
Gets or sets the spacing between instances along the radial direction.Syntax
RadialRepartition.InstancesCount.Value as DoubleExample
Spacing = UserCircularPattern.RadialRepartition.Spacing.ValueUserCircularPattern.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 DoubleExample
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 directiongoes towards you when you look at the crown.= False, indicates that the instances are copied clockwise when the rotation axis direction goestowards you when you look at the crown.
ExamplePatternRotationOrientation = UserCircularPattern.RotationOrientationUserCircularPattern.RotationOrientation = True
Running The MacroOpen the CircularPattern1.CATPart document.1.
Load the CircularPattern1.CATScript macro.2. Run the macro.3.
User PatternDefinitionThe 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 SketchExample
Sketch = UserUserPattern.FeatureToLocatePositionsUserUserPattern.FeatureToLocatePositions = UserSketch
ItemToCopy
Gets or sets the shape to be copied.Syntax
ItemToCopy as ReferenceExample
Set Shape = UserUserPattern.ItemToCopyUserUserPattern.ItemToCopy = UserShape
UserPattern
Dimensions an object as UserPattern.Example
Dim UserUserPattern as UserPattern
Running The MacroOpen the UserPattern1.CATPart document.1.
Load the UserPattern1.CATScript macro.2. Run the macro.3.
Part Basics
PropertiesBody
ReferenceUpdate
PropertiesDefinitionPart 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 BodiesExample
PartBodiesCollection = UserPart.Bodies
Constraints
Returns the collection object containing the constraints of the part.Syntax
Constraints as ConstraintsExample
PartConstraintsCollection = UserPart.Constraints
Density
Gets or sets the part density.Syntax
Part.Density as DoubleExample
PartDensity = UserPart.DensityUserPart.Density = 1.000000
GeometricElements
Returns the collection object containing the geometrical elements of the part.Syntax
GeometricElement as GeometricElementsExample
PartGeometricElementsCollection = UserPart.GeometricElements
HybridBodies
Returns the collection object containing the hybrid bodies of the part.Syntax
HybridBodies as HybridBodiesExample
PartHybridBodiesCollection = UserPart.HybridBodies
InWorkObject
Gets or sets the part's in work object.Syntax
InWorkObject as AnyObjectExample
PartInWorkObject = UserPart.InWorkObjectUserPart.InWorkObject = UserFeature
OriginElements.PlaneXY
Returns the XY plane of the part's 3D reference axis system.Syntax
OriginElements.PlaneXY as GeometricElementExample
PartParametersCollection = UserPart.OriginElements.PlaneXY
OriginElements.PlaneYZ
Returns the YZ plane of the part's 3D reference axis system.Syntax
OriginElements.PlaneYZ as GeometricElementExample
PartParametersCollection = UserPart.OriginElements.PlaneYZ
OriginElements.PlaneZX
Returns the ZX plane of the part's 3D reference axis system.Syntax
OriginElements.PlaneZX as GeometricElementExample
PartParametersCollection = UserPart.OriginElements.PlaneZX
Parameters
Returns the collection object containing the parameters of the part.Syntax
Parameters as ParametersExample
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 RelationsExample
PartRelationsCollection = UserPart.Relations
BodyDefinitionDefines 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 BodyiIndex 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".
ExampleSet 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
ReferenceDefinitionReferences features in a part.
Methods
CreateReferenceFromName
Creates a reference from a Generic Naming label.Syntax
CreateReferenceFromName ( iLabel ) as ReferenceiLabel 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 ReferenceiGeometricElement 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 ReferenceiObject 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 ReferenceiLabel 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.
ExampleSet 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
UpdateDefinitionUpdates a part.
Methods
Update
Updates the part.Syntax
UpdateExample
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
iFeatureThe feature to be analysed.
ExampleUserPart.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.
ExampleFeatureUpdateAttribut = UserPart.IsInactive ( UserFeature )
Part Constraints
ConstraintsLength Constraint
ConstraintsDefinitionConstraints part features.
Methods
AddMonoEltCst
Creates a new constraint applying to a single geometric element and adds it to the constraintscollection.Syntax
AddMonoEltCst ( iConstraintType, iElement ) as ConstraintiConstraintType as Long
The constraint type.See Type syntax.
iElement as ReferenceThe geometric element to be constrained.
ExampleSet UserConstraint = CATIA.ActiveDocument.Part.Constraints.AddMonoEltCst ( 0,UserReference )
AddBiEltCst
Creates a new constraint applying to two geometric elements and adds it to the constraintscollection.Syntax
AddBiEltCst ( iConstraintType, iFirstElement, iSecondElement ) as ConstraintiConstraintType as Long
The constraint type.See Type syntax.
iFirstElement as ReferenceThe first geometric element to be constrained.
iSecondElement as ReferenceThe second geometric element to be constrained.
ExampleSet UserConstraint = CATIA.ActiveDocument.Part.Constraints.AddBiEltCst ( 0,UserReference1, UserReference2 )
Activate
Activates a constraint.An activated constraint is take into account during the update process.Syntax
ActivateExample
UserConstraint.Activate
Deactivate
Deactivates a constraint.An deactivated constraint is not take into account during the update process.Syntax
DeactivateExample
UserConstraint.Deactivate
IsInactive
Indicates 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.
ExampleConstraintActivity = UserConstraint.IsInactive
GetConstraintElement
Gets a constraint's element.Syntax
GetConstraintElement ( iElementIndex ) as ReferenceiElementIndex as Long
The index of the element of the constraint to be returned.= 1 for the first element.= 2 for the second element.Notice it must not exceed the total number of elements of the constraint. See Type syntax.
ExampleUserReference = UserConstraint.GetConstraintElement ( 1 )
SetConstraintElement
Sets a constraint's element.Syntax
SetConstraintElement ( iElementIndex, iElement ) as ReferenceiElementIndex as Long
The index of the element of the constraint to be replaced.= 1 for the first element.= 2 for the second element.Notice it must not exceed the total number of elements of the constraint. See Type syntax.
iElement as ReferenceThe element to be constrained.
ExampleUserConstraint.GetConstraintElement ( 2, UserReference )
GetConstraintVisuLocation
Returns the constraint's visualisation location.When displayed on screen, the constraint is visualized as a dimension positioned close to theconstrained geometric elements.This method retrieves the data used to position this representation within the 3D space.Syntax
GetConstraintVisuLocation ( oAnchorPoint, oAnchorVector )oAnchorPoint as Double
A safe array with three elements : x, y, z point coordinates where the constraint value isdisplayed.The array must be previously initialized.
oAnchorVector as DoubleA safe array with three elements : x, y, z vector normal to the plane coordinates onto whichthe constraint value is displayed.The array must be previously initialized.
ExampleDim ConstraintAnchorPoint ( 2 ), ConstraintAnchorVector ( 2 ) As DoubleDim xp, yp, zp, xv, yv, zv As Double
UserConstraint.GetConstraintVisuLocation ( ConstraintAnchorPoint,ConstraintAnchorVector )
xp = ConstraintAnchorPoint ( 0 )yp = ConstraintAnchorPoint ( 1 )zp = ConstraintAnchorPoint ( 2 )
xv = ConstraintAnchorVector ( 0 )yv = ConstraintAnchorVector ( 1 )zv = ConstraintAnchorVector ( 2 )
SetConstraintVisuLocation
Sets the constraint's visualisation location.Syntax
SetConstraintVisuLocation ( iX, iY, iZ )iX, iY, iZ as Double
Origin point x, y, z absolute coordinates.Example
UserConstraint.SetConstraintVisuLocation 10.000000, 0.000000, 0.000000
Item
Returns a constraint using its index or its name from the Constraints collection.Syntax
Item ( iIndex ) as ConstraintiIndex as Long
The index or the name of the constraint to retrieve from the collection of constraints.As a numerics, this index is the rank of the constraint in the collection.The index of the first constraint in the collection is 1, and the index of the last constraint isCount.:
ExampleSet UserConstraint = CATIA.ActiveDocument.Part.Constraints.Item ( 1 )
Remove
Returns a constraint using its index or its name from the Constraints collection.Syntax
Remove ( iIndex ) as ConstraintiIndex as Long
The index or the name of the constraint to remove from the collection of constraints.As a numerics, this index is the rank of the constraint in the collection.The index of the first constraint in the collection is 1, and the index of the last constraint isCount.:
ExampleSet UserConstraint = CATIA.ActiveDocument.Part.Constraints.Remove ( 1 )
Properties
AngleSector
Gets or sets the constraint's angle (or angular) sector, for angle constraint only, Type = 6.The geometric elements of an angle constraint (e.g. : 2 lines or 2 planes) divide the space in 4regions which are called angle or angular sectors, numbered from 0 to 3. By default, the constraint is created in the sector number 0.One angle sector corresponds exactly to particular values of Dimension.Value, Side andOrientation.When changing the angle sector, Dimension.Value, Side and Orientation are also modified.Syntax
AngleSector as Long= 0, Dimension.Value = angle, Orientation = 0, Side = 0= 1, if angle>180: Dimension.Value= angle-180, otherwise: Dimension.Value=abs(angle)+180, Orientation = 1, Side = 0.= 2, if angle>180: Dimension.Value = abs(540-angle), otherwise: Dimension.Value =180-abs(angle), Orientation = 1, Side = 1.= 3, Dimension.Value = 360-abs(angle), Orientation = 0, Side = 1.
ExampleConstraintAngleSector = UserConstraint.AngleSectorUserConstraint.AngleSector = 0
BrokenConstraintsCount
Gets the number of broken constraints from the constraints collection.Syntax
BrokenConstraintsCount as LongExample
BrokenConstraints = UserConstraintsCollection.BrokenConstraintsCount
Constraint
Dimensions an object as constraint.Example
Dim UserConstraint as Constraint
Constraints
Dimensions an object as a constraints collection.Example
Dim UserConstraintsCollection as Constraints
Dimension.Value
Gets or sets the constraint's dimension.The dimension may be meaningless for some types of constraints such as tangency constraints,or if the constraint is not currently checked, see Status syntax.Syntax
Dimension.Value as DoubleExample
ConstraintDimension = UserConstraint.Dimension.Value UserConstraint.Dimension.Value = 50.00000
DistanceConfig
Gets or sets the constraint's distance configuration, for distance constraint only, Type = 1.Distance constraints between lines and cylinders offer often more degrees of freedom togeometry than acually desired.This property allows user to limit these degrees of freedom without having to redefine additionalconstraints.Syntax
DistanceConfig as Long= 0, no additional condition is set on the constraint.= 1, in addition to being positioned at a specified distance, constrained elements arerequired to be parallel.Their orientation can be the same or opposite.= 2, in addition to being positioned at a specified distance, constrained elements arerequired to be parallel, and their orientations are required to be the same.= 3, in addition to being positioned at a specified distance, constrained elements arerequired to be parallel, and their orientations are required to be opposite.
ExampleConstraintDistanceConfiguration = UserConstraint.DistanceConfigUserConstraint.DistanceConfig = 0
DistanceDirection
Gets or sets the distance's constraint direction.This property is useless for constraints whose type is not Distance, Type =1.Distance constraints may be measured along a particular direction.This property will be used if the direction is a reference axis.Syntax
DistanceDirection as Long= 0, no direction has been specified. The constraint is measured as usual.= 1, the constraint is measured along the X axis.= 2, the constraint is measured along the Y axis.= 3, the constraint is measured along the Z axis.
Example
ConstraintDistanceDirection = UserConstraint.DistanceDirectionUserConstraint.DistanceDirection = 0
Mode
Gets or sets the constraint's driving mode.For constraint types supporting the concept of value, such as distance constraints, the drivingmode tells whether the constraint value actually drives the geometry position, or, conversely, isdriven by it.Syntax
Mode as Long= 0, the constraint mode, the value assigned to the constraint drives the actual position ofthe constrained geometry.= 1, the measure mode, the constraint value only reflects what can be observed from theactual position of the constrained geometry.
ExampleConstraintMode = UserConstraint.ModeUserConstraint.Mode = 1
Orientation
Gets or sets the constraint's orientation.This is used for constraints that involve two geometric elements and specifies the orientation forthe second geometric element with regard to the first one, when several possible orientations areall satisfying the constraint.Syntax
Orientation as Long= 0, the characteristic vectors associated to the constrained elements have sameorientation.= 1, the characteristic vectors associated to the constrained elements have oppositeorientation.= 2, the relative orientation of the characteristic vectors associated to the constrainedelements is not specified.
ExampleConstraintOrientation = UserConstraint.OrientationUserConstraint.Orientation = 0
Side
Gets or sets the constraint's side.Some constraint types need to relatively position the constrained geometries, when severalpossible configurations are all satisfying the constraint.Syntax
Side as Long= 0, the first constrained element characteristic vector points towards the 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 secondconstrained element.Arithmetic sign of constraint value is ignored, only its absolute value is taken into account.= 2, the arithmetic sign of constraint value specifies where the second element lies withregard to the first one: a positive value means in the direction of first constrained elementcharacteristic vector, a negative value in the opposite direction.= 3, Arithmetic sign of constraint value specifies where second element lies with regard tofirst one: a negative value means in the direction of first constrained element characteristicvector, a positive value in the opposite direction.= 4, the relative positionning of constrained elements is not defined.
ExampleConstraintSide = UserConstraint.SideUserConstraint.Side = 1
Status
Gets the constraint's status.The constraint's status is a diagnosis if the constraint is checked.Syntax
Status as Long= 0, the constraint is checked.= 1, the constraint is strongly not checked (e.g. distance constraint between two planes,which are not currently parallel).= 2, the constraint is not checked because of the wrong orientation or side of its geometricelements (e.g. planes are parallel and at the specified distance, but their orientation isinverted with respect to the one specified by the constraint).= 3, the constraint is not checked because of its value (e.g. planes are parallel and at thespecified orientation and side but not at the specified distance).= 4, the constraint is not checked because of the wrong type of its geometric elements(e.g. angle between a point and a plane).= 5, the constraint is not checked because a geometric element is missing.
ExampleConstraintStatus = UserConstraint.Status
Type
Gets or sets the constraint's type.Syntax
Type as Long= 0, Fix only with AddMonoEltCst.= 1, Distance only with AddBiEltCst.= 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.
ExampleConstraintType = UserConstraint.TypeUserConstraint.Type = 1
UnUpdatedConstraintsCount
Gets the number of not updated constraints from the constraints collection.Syntax
BrokenConstraintsCount as LongExample
BrokenConstraints = UserConstraintsCollection.BrokenConstraintsCount
Length ConstraintDefinitionSets length constraints between part features. These macros use the methods and propertiesdescribed in Constraints.
Running The MacroOpen the Constraint1.CATPart document.1.
Load the Constraint1.CATScript macro.2. Run the macro.3.
Open the Constraint2.CATPart document.4.
Load the Constraint2.CATScript macro.5. Run the macro.6.
Advanced Tasks
Boolean Shapes
Boolean ShapesCreates and manages bodies.
Insert BodyAssemble BodiesIntersect Bodies
Add BodiesRemove Bodies
Trim Bodies
Insert BodyDefinitionInserts 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 BodyExample
Set UserBody = CATIA.ActiveDocument.Part.Bodies.Add
Running The MacroOpen the InsertBody1.CATPart document.1.
Load the InsertBody1.CATScript macro.2. Run the macro.3.
Assemble BodiesDefinitionAssembles bodies in the part document.
Methods
ShapeFactory.AddNewAssemble
Creates and returns a new assembly operation within the current body, see InWorkObjectproperties.Syntax
ShapeFactory.AddNewAssemble ( iBody ) as AssembleiBody 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 BodyExample
AssembleBody = UserAssemble.Body
Running The MacroOpen the AssembleBodies1.CATPart document.1.
Load the AssembleBodies1.CATScript macro.2. Run the macro.3.
Intersect BodiesDefinitionIntersects bodies in the part document.
Methods
ShapeFactory.AddNewIntersect
Creates and returns a new intersect operation within the current body, see InWorkObjectproperties.Syntax
ShapeFactory.AddNewIntersect ( iBody ) as IntersectiBody 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 BodyExample
IntersectBody = UserIntersect.Body
Intersect
Dimensions an object as intersect.Example
Dim UserIntersect as Intersect
Running The MacroOpen the IntersectBodies1.CATPart document.1.
Load the IntersectBodies1.CATScript macro.2. Run the macro.3.
Open the IntersectBodies1.CATPart document.4.
Load the IntersectBodies2.CATScript macro.5. Run the macro.6.
Add BodiesDefinitionAdds 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 AddiBody 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 BodyExample
AddBody = UserAdd.Body
Running The MacroOpen the AddBodies1.CATPart document.1.
Load the AddBodies1.CATScript macro.2. Run the macro.3.
Remove BodiesDefinitionRemoves bodies in the part document.
Methods
ShapeFactory.AddNewRemove
Creates and returns a new remove operation within the current body, see InWorkObjectproperties.Syntax
ShapeFactory.AddNewRemove ( iBody ) as RemoveiBody 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 BodyExample
RemoveBody = UserRemove.Body
Remove
Dimensions an object as remove.Example
Dim UserRemove as Remove
Running The MacroOpen the RemoveBodies1.CATPart document.1.
Load the RemoveBodies1.CATScript macro.2. Run the macro.3.
Trim BodiesDefinitionTrims bodies in the part document.
Methods
ShapeFactory.AddNewTrim
Creates and returns a new trim operation within the current body.Syntax
ShapeFactory.AddNewTrim ( iBody ) as TrimiBody 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.
ExampleUserTrim.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 BodyExample
TrimBody = UserTrim.Body
Trim
Dimensions an object as trim.Example
Dim UserTrim as trim
Running The MacroOpen the TrimBodies1.CATPart document.1.
Load the TrimBodies1.CATScript macro.2. Run the macro.3.
GlossaryB
body See part body.
Cchamfer 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 alsoparent.
constraint A geometric or dimension relation between two elements.
Ddraft angle A feature provided with a face with an angle and a pulling direction.
Ffeature 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 anoutside corner.
Ggroove A feature corresponding to a cut in the shape of a revolved feature.
Hhole A feature corresponding to an opening through a feature. Holes can be simple,
tapered, counterbored, countersunk, or counterdrilled.
Mmirror A feature created by duplicating an initial feature. The duplication is defined by
symmetry.
Ppad A feature created by extruding a profile.
parent A status defining the genealogical relationship between a feature or element andanother 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.
Rreorder An operation consisting in reorganizing the order of creation of the features.rib A feature obtained by sweeping a profile along a center curve.
Sscaling An operation that resizes features to a percentage of their initial sizes.shaft A revolved featureshell A hollowed out featuresketch 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.
IndexA
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
BBodies.Add Bodies.Item Bodies , Body , , , , , BotOffset.Value BottomAngle.Value BottomLimit.Dimension.Value BottomLimit.LimitMode BottomLimit.LimitingElement BottomType BrokenConstraintsCount
CCenterCurveElement , Chamfer CircPattern CloseSurface ConstRadEdgeFillet Constraint Constraints , CreateReferenceFromBRepName CreateReferenceFromGeometry CreateReferenceFromName CreateReferenceFromObject
DDeactivate Density DesactivatePosition , Diameter.Value Dimension.Value DirectionOrientation ,
DirectionType , DistanceConfig DistanceDirection Documents.Add Documents.Open Draft DraftAngle.Value DraftDomain DraftDomains.Item
EEdgePropagation , EdgesToFillet EdgesToKeep , ElementsToChamfer ExternalThickness.Value
FFaceFillet 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
GGeometricElements GetConstraintElement GetConstraintVisuLocation GetDirection , , GetFirstDirection GetOrigin GetPullingDirection GetRotationAxis GetRotationCenter GetSecondDirection Groove
HHeadAngle.Value HeadDepth.Value HeadDiameter.Value Hole HybridBodies
IImposedVertexRadius ImposedVertices InWorkObject Inactivate InternalThickness.Value Intersect IsInactive , IsSymmetric , , IsUpToDate Item ItemToCopy , ,
LLength1.Value Length2.Value
MMergeMode , Mirror MirroringObject MirroringPlane Mode , , MultiselectionMode
NNeutralElement NeutralPropagationMode
OObjectsToFillet Offset.Value OffsetSide Orientation , OriginElements.PlaneXY OriginElements.PlaneYZ OriginElements.PlaneZX
PPad Parameters Part PartDocument PartingElement
Pocket Propagation PullingDirElement , PullingDirectionElement
RRadialAlignment 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
SSecondAngle.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
TThickSurface Thickness.Value Thickness ThreadDepth.Value ThreadDiameter.Value ThreadPitch.Value ThreadSide
ThreadingMode TopOffset.Value Trim TritangentFillet Type ,
UUnUpdatedConstraintsCount Update UpdateObject UserPattern
VVarRadEdgeFillet
WWithdrawEdgeToFillet WithdrawEdgeToKeep , WithdrawElementToChamfer WithdrawFaceToKeep WithdrawFaceToKeep2 WithdrawFaceToRemove , WithdrawFaceToRemove2 WithdrawFaceToThicken WithdrawImposedVertex WithdrawObjectToFillet