The CreoConstraintInfo object is a structure used to supply complex criteria to the CAD.Component.Assemble command for each constraint needed during the assemble.

Remarks

In ALL cases some properties of this object are not used! Which properties are data-filled depend on the type of constraint being built.

Use the Right Click Menu in the Script Editor "Insert CAD Object Templated" to build a CreoConstraintInfo Object that you can just set the values for.

Examples

See the Sub-Topic for information regarding each of the Properties that can be set in this object.

Create 3 Datum Reference Constraints and assemble a part into an assembly.

Dim cc1 As New CreoConstraintInfo()
With cc1
.Type = "Align"
.Offset = 0
.AssemblyModelItem = "ASM_TOP"
.AssemblyDatumSide = "Primary"
.ComponentModelItem = "TOP"
.ComponentDatumSide = "Primary"
End With

Dim cc2 As New CreoConstraintInfo()
With cc2
.Type = "Align"
.Offset = 0
.AssemblyModelItem = "ASM_RIGHT"
.AssemblyDatumSide = "Primary"
.ComponentModelItem = "RIGHT"
.ComponentDatumSide = "Primary"
End With

Dim cc3 As New CreoConstraintInfo()
With cc3
.Type = "Align"
.Offset = 0
.AssemblyModelItem = "ASM_FRONT"
.AssemblyDatumSide = "Primary"
.ComponentModelItem = "FRONT"
.ComponentDatumSide = "Primary"
End With

CAD.Component.Assemble("ASM0001.asm","prt0001.prt", {Cc1,Cc2,Cc3})