Assembly Design Journaling Preface Basic Tasks Glossary Index © Dassault Systèmes 1994-2000. All rights reserved.
Assembly Design Journaling
Preface
Basic Tasks
Glossary
Index
© Dassault Systèmes 1994-2000. All rights reserved.
PrefaceThe CATIA - Assembly Design Journaling Guide has been designed to show you how tocreate assembly constraint starting from a CATIA script document. This book aims at illustratingthe several stages of creation you may encounter.
The information contained in this guide is specific to Version 5 Release 5 of the CATIA -Assembly Design workbench, which operates in a WINDOWS or UNIX workstationenvironment under the AIX, IRIX, SUN OS and HP-UX operating system.
Basic Tasks
CATProduct DocumentAssembly Basics
Assembly Constraints
CATProduct Document
New CATProductOpen CATProduct
Create a CATProduct DocumentDefinitionCreates a new assembly.
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 CATProduct.= "Product"
ExampleCATIA.Documents.Add ( "Product" )
Running The MacroOpen CATIA.1. Load the CreateCATProduct1.CATScript macro.2. Run the macro.3.
Open a CATProduct DocumentDefinitionOpen an existing product.
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:\ProductDirectory\UserProduct.CATProduct " )
Running The MacroOpen CATIA.1. Check in OpenCATProduct.CATScript the path to the Assembly Design Journaling Guidedirectory sample.
2.
Load the OpenCATProduct1.CATScript macro.3. Run the macro.4.
Assembly Basics
PropertiesReference
Update
PropertiesDefinitionAssembly properties.
Properties
Connections
Returns the collection object containing the constraints of the product.Syntax
Product.Connections as ConstraintsExample
AssemblyConstraintsCollection = UserAssembly.Connections
Product
Dimensions an object as assembly.Example
Dim UserAssembly as Product
ProductDocument
Dimensions an object as assembly document.Example
Dim UserAssemblyDocument as ProductDocument
ReferenceDefinitionReferences features in a assembly.
Methods
CreateReferenceFromName
Returns a reference from a name.A reference is an object that can stand for any geometrical object.Creating references is mandatory for adding constraints between two components using Brepelements of the representations of these components.Syntax
CreateReferenceFromName ( iLabel ) as ReferenceiLabel as String
The GenericNaming identification for an object.This is a cryptic form for "the edge surrounded by the face extruded from line.12 ofsketch.4 and the face...").
ExampleSet UserReference = CATIA.ActiveDocument.Product.CreateReferenceFromName ( )
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 an assembly.
Methods
Update
Updates the assembly.Syntax
UpdateExample
UserAssembly.Update
Assembly Constraints
ConstraintsCoincidence Constraint
Contact ConstraintAngle Constraint
Fix ConstraintDeactivate Activate Constraint
ConstraintsDefinitionConstraints assembly components.
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.Product.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.Product.Constraints.AddBiEltCst ( 0,UserReference1, UserReference2 )
AddTriEltCst
Creates a new constraint applying to three geometric elements and adds it to the constraintscollection.Syntax
AddTriEltCst ( iConstraintType, iFirstElement, iSecondElement, iThirdElement ) asConstraint
iConstraintType as LongThe constraint type.See Type syntax.
iFirstElement as ReferenceThe first geometric element to be constrained.
iSecondElement as ReferenceThe second geometric element to be constrained.
iThirdElement as ReferenceThe second geometric element to be constrained.
ExampleSet UserConstraint = CATIA.ActiveDocument.Product.Constraints.AddTriEltCst ( 0,UserReference1, UserReference2, UserReference3 )
Activate
Activates a constraint.An activated constraint is take into account during the update process.Syntax
ActivateExample
UserConstraint.Activate
Deactivate
Deactivates a constraint.An deactivated constraint is not take into account during the update process.Syntax
DeactivateExample
UserConstraint.Deactivate
IsInactive
Indicates if a constraint is take into account during the update process.Syntax
IsInactive as Boolean
= True, the constraint is not active= False, the constraint is active.
ExampleConstraintActivity = UserConstraint.IsInactive
GetConstraintElement
Gets a constraint's element.Syntax
GetConstraintElement ( iElementIndex ) as ReferenceiElementIndex as Long
The index of the element of the constraint to be returned.= 1 for the first element.= 2 for the second element.Notice it must not exceed the total number of elements of the constraint. See Type syntax.
ExampleUserReference = UserConstraint.GetConstraintElement ( 1 )
SetConstraintElement
Sets a constraint's element.Syntax
SetConstraintElement ( iElementIndex, iElement ) as ReferenceiElementIndex as Long
The index of the element of the constraint to be replaced.= 1 for the first element.= 2 for the second element.Notice it must not exceed the total number of elements of the constraint. See Type syntax.
iElement as ReferenceThe element to be constrained.
ExampleUserConstraint.GetConstraintElement ( 2, UserReference )
GetConstraintVisuLocation
Returns the constraint's visualisation location.When displayed on screen, the constraint is visualized as a dimension positioned close to theconstrained geometric elements.This method retrieves the data used to position this representation within the 3D space.Syntax
GetConstraintVisuLocation ( oAnchorPoint, oAnchorVector )oAnchorPoint as 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.:
Example
Set UserConstraint = CATIA.ActiveDocument.Part.Constraints.Item ( 1 )
Remove
Returns a constraint using its index or its name from the Constraints collection.Syntax
Remove ( iIndex ) as ConstraintiIndex as Long
The index or the name of the constraint to remove from the collection of constraints.As a numerics, this index is the rank of the constraint in the collection.The index of the first constraint in the collection is 1, and the index of the last constraint isCount.:
ExampleSet UserConstraint = CATIA.ActiveDocument.Part.Constraints.Remove ( 1 )
Properties
AngleSector
Gets or sets the constraint's angle (or angular) sector, for angle constraint only, Type = 6.The geometric elements of an angle constraint (e.g. : 2 lines or 2 planes) divide the space in 4regions which are called angle or angular sectors, numbered from 0 to 3. By default, the constraint is created in the sector number 0.One angle sector corresponds exactly to particular values of Dimension.Value, Side andOrientation.When changing the angle sector, Dimension.Value, Side and Orientation are also modified.Syntax
AngleSector as Long= 0, Dimension.Value = angle, Orientation = 0, Side = 0= 1, if angle>180: Dimension.Value= angle-180, otherwise: Dimension.Value=abs(angle)+180, Orientation = 1, Side = 0.= 2, if angle>180: Dimension.Value = abs(540-angle), otherwise: Dimension.Value =180-abs(angle), Orientation = 1, Side = 1.= 3, Dimension.Value = 360-abs(angle), Orientation = 0, Side = 1.
ExampleConstraintAngleSector = UserConstraint.AngleSectorUserConstraint.AngleSector = 0
BrokenConstraintsCount
Gets the number of broken constraints from the constraints collection.Syntax
BrokenConstraintsCount as LongExample
BrokenConstraints = UserConstraintsCollection.BrokenConstraintsCount
Constraint
Dimensions an object as constraint.Example
Dim UserConstraint as Constraint
Constraints
Dimensions an object as a constraints collection.Example
Dim UserConstraintsCollection as Constraints
Dimension.Value
Gets or sets the constraint's dimension.The dimension may be meaningless for some types of constraints such as tangency constraints,or if the constraint is not currently checked, see Status syntax.Syntax
Dimension.Value as DoubleExample
ConstraintDimension = UserConstraint.Dimension.Value UserConstraint.Dimension.Value = 50.00000
DistanceConfig
Gets or sets the constraint's distance configuration, for distance constraint only, Type = 1.Distance constraints between lines and cylinders offer often more degrees of freedom togeometry than acually desired.This property allows user to limit these degrees of freedom without having to redefine additionalconstraints.Syntax
DistanceConfig as Long= 0, no additional condition is set on the constraint.= 1, in addition to being positioned at a specified distance, constrained elements arerequired to be parallel.Their orientation can be the same or opposite.= 2, in addition to being positioned at a specified distance, constrained elements arerequired to be parallel, and their orientations are required to be the same.= 3, in addition to being positioned at a specified distance, constrained elements arerequired to be parallel, and their orientations are required to be opposite.
Example
ConstraintDistanceConfiguration = UserConstraint.DistanceConfigUserConstraint.DistanceConfig = 0
DistanceDirection
Gets or sets the distance's constraint direction.This property is useless for constraints whose type is not Distance, Type =1.Distance constraints may be measured along a particular direction.This property will be used if the direction is a reference axis.Syntax
DistanceDirection as Long= 0, no direction has been specified. The constraint is measured as usual.= 1, the constraint is measured along the X axis.= 2, the constraint is measured along the Y axis.= 3, the constraint is measured along the Z axis.
ExampleConstraintDistanceDirection = UserConstraint.DistanceDirectionUserConstraint.DistanceDirection = 0
Mode
Gets or sets the constraint's driving mode.For constraint types supporting the concept of value, such as distance constraints, the drivingmode tells whether the constraint value actually drives the geometry position, or, conversely, isdriven by it.Syntax
Mode as Long= 0, the constraint mode, the value assigned to the constraint drives the actual position ofthe constrained geometry.= 1, the measure mode, the constraint value only reflects what can be observed from theactual position of the constrained geometry.
ExampleConstraintMode = UserConstraint.ModeUserConstraint.Mode = 1
Orientation
Gets or sets the constraint's orientation.This is used for constraints that involve two geometric elements and specifies the orientation forthe second geometric element with regard to the first one, when several possible orientations areall satisfying the constraint.Syntax
Orientation as Long= 0, the characteristic vectors associated to the constrained elements have sameorientation.
= 1, the characteristic vectors associated to the constrained elements have oppositeorientation.= 2, the relative orientation of the characteristic vectors associated to the constrainedelements is not specified.
ExampleConstraintOrientation = UserConstraint.OrientationUserConstraint.Orientation = 0
Side
Gets or sets the constraint's side.Some constraint types need to relatively position the constrained geometries, when severalpossible configurations are all satisfying the constraint.Syntax
Side as Long= 0, the first constrained element characteristic vector points towards the secondconstrained element.Arithmetic sign of constraint value is ignored, only its absolute value is taken into account.= 1, the first constrained element characteristic vector points is opposite to the secondconstrained element.Arithmetic sign of constraint value is ignored, only its absolute value is taken into account.= 2, the arithmetic sign of constraint value specifies where the second element lies withregard to the first one: a positive value means in the direction of first constrained elementcharacteristic vector, a negative value in the opposite direction.= 3, Arithmetic sign of constraint value specifies where second element lies with regard tofirst one: a negative value means in the direction of first constrained element characteristicvector, a positive value in the opposite direction.= 4, the relative positionning of constrained elements is not defined.
ExampleConstraintSide = UserConstraint.SideUserConstraint.Side = 1
Status
Gets the constraint's status.The constraint's status is a diagnosis if the constraint is checked.Syntax
Status as Long= 0, the constraint is checked.= 1, the constraint is strongly not checked (e.g. distance constraint between two planes,which are not currently parallel).= 2, the constraint is not checked because of the wrong orientation or side of its geometricelements (e.g. planes are parallel and at the specified distance, but their orientation isinverted with respect to the one specified by the constraint).= 3, the constraint is not checked because of its value (e.g. planes are parallel and at the
specified orientation and side but not at the specified distance).= 4, the constraint is not checked because of the wrong type of its geometric elements(e.g. angle between a point and a plane).= 5, the constraint is not checked because a geometric element is missing.
ExampleConstraintStatus = UserConstraint.Status
Type
Gets or sets the constraint's type.Syntax
Type as Long= 0, Fix only with AddMonoEltCst.= 1, Distance only with AddBiEltCst.= 2, Coincidence only with AddBiEltCst.= 6, Angle only with AddBiEltCst.= 7, Planar Angle only with AddTriEltCst .= 8, Parallelism only with AddBiEltCst.= 11, Perpendicularity only with AddBiEltCst.= 20, Surfacic Contact only with AddBiEltCst.= 21, Lineic Contact Angle only with AddBiEltCst .= 22, Point Contact only with AddBiEltCst.= 25, Annular Contact 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
Coincidence ConstraintDefinitionCreates a coincidence constraint between two assembly components.
Running The MacroOpen the CoincidenceConstraint.CATProduct document.1.
Load the CoincidenceConstraint2.CATScript macro.2. Run the macro.3.
Contact ConstraintDefinitionCreates a contact constraint between two assembly components.
Running The MacroOpen the ContactConstraint1.CATProduct document.1.
Load the ContactConstraint1.CATScript macro.2. Run the macro.3.
Angle ConstraintDefinitionCreates an angle constraint between two assembly components.
Running The MacroOpen the AngleConstraint1.CATProduct document.1.
Load the AngleConstraint1.CATScript macro.2. Run the macro.3.
Fix ConstraintDefinitionCreates a fix constraint on one assembly component.
Running The MacroOpen the FixConstraint1.CATProduct document.1.
Load the FixConstraint1.CATScript macro.2. Run the macro.3.
Deactivate Activate ConstraintDefinitionDeactivates or activates an assembly constraint.
Running The MacroOpen the DeactivateActivateConstraint1.CATProduct document.1.
Load the DeactivateConstraint1.CATScript macro.2. Run the macro.3.
Load the ActivateConstraint1.CATScript macro.4. Run the macro5.
Glossary
Aactive component A selected component currently being edited. This component is
underlined in the specification tree.
active object An object currently being edited.
angle constraint A constraint used to define an angle or parallelism between twogeometric elements.
assembly An entity composed of various components which have been positionedrelative to each other.
Bbill of material A list of data about the properties of the components contained in the
active component.
Cchild component One or more components originating from a single component. Compare
parent component.
coincidenceconstraint
A constraint used to align two geometric elements, or get them tocoincide.
component A reference integrated in an assembly. A component possessescharacteristics related to how it is integrated in an assembly (forexample, its relative location in an assembly).
constraint A geometrical or dimensional relation between several geometricelements of different components. It may be used to define thepositioning of components.
context-specificrepresentation
A hierarchical design of an assembly in a specific context (for example:engineering or manufacturing).
contact constraint A constraint used to define a contact area between two elements(tangent or coincident).
Ffixed component A component for which all degrees of freedom are locked, in relation to
the parent component.
Ggeometric element The geometric elements which can be constrained in the Assembly
workbench are:pointlineplane (or plane surface from a model)sphereconecylinder
Lleaf component The last component at the end of each branch of the specification tree.
Mmanipulation A freehand translation or rotation of a component with the mouse.
model A CATIA Version 4 model.
Ooffset constraint A constraint used to define a distance or an offset between two
geometric elements.
Pparent component A component that is hierarchically just above one or more components.
Compare child component
part Within the Assembly workbench, it is either a part of the Part Designworkbench, or a 3D entity whose geometry is contained in a model.
primary childcomponent
One or more components originating from the first level under the activecomponent.
product A 3D entity which contains several components.
Rreference A product or part with its own characteristics. Compare component.
representation See context specific representation.
Ssearch order A hierarchical set of paths used when searching for the files included in
the assembly. The search begins with the first path, and stops when thefile is found.
snap Projects a geometric element onto another one.
subassembly An assembly contained within another assembly.
Uupdate In the Assembly workbench, updates the position of the constrained
components so as to satisfy the constraint requirements.
IndexA
Activate AddBiEltCst AddMonoEltCst AddTriEltCst AngleSector
BBrokenConstraintsCount
CConnections Constraint Constraints CreateReferenceFromName
DDeactivate Dimension.Value DistanceConfig DistanceDirection Documents.Open
GGetConstraintElement GetConstraintVisuLocation
IIsInactive Item
MMode
OOrientation
PProduct ProductDocument
RReference References Remove
SSetConstraintElement SetConstraintVisuLocation Side Status
TType
UUnUpdatedConstraintsCount Update