Hi
I'm looking for API code to suppress and unsupress some constraints within an assembly.
Manly:
1- Access the constraints by name ( Assembly constraints have a parameter name)
2- Suppress the constraints and unsuppress
I want to allocate a form with 2 command buttons one for suppress and another one for Unsupress.
i.e : oConstraint.Suppressed = False ( how do I access the constraint name ?)
oConstraint.Suppressed = True
Thanks in advance
Luis
Solved! Go to Solution.
Solved by luismestre. Go to Solution.
I think I'm not far to have the code.
I'm having problems with the last part , ... accessing the constraint.
Any help would be very appreciated.
my code:
Private Sub CommandButton1_Click()
' Get the active assembly.
Dim oAsmDoc As AssemblyDocument
Set oAsmDoc = ThisApplication.ActiveDocument
' Get the assembly component definition.
Dim oAsmDef As AssemblyComponentDefinition
Set oAsmDef = oAsmDoc.ComponentDefinition
Dim oConstraints As AssemblyConstraints
Set oConstraints = oAsmDef.Constraints
Dim oCons As AssemblyConstraint
Set oCons = oConstraints(Angle)
' get component occurrence.
Dim oOcc As ComponentOccurrence
Dim obj As AngleConstraint
For Each obj In oCons
oOcc = obj
oOcc.Constraints.Item(1).Suppressed = True
Next
End Sub