CATIA macro for finding constraint
CATIA macro for finding constraint
(OP)
Here is the problem:
I Have a large assembly (over 200 parts and 1000 constraints)
When I make a certain modification, there is an update needed.
Is there a macro code which could find WHICH constraint needs to be updated?
Scrolling through 1000+ constraints in the tree is long, and finding the "blacked out" constraint in the assembly is merely impossible!
Thanks in advance
I Have a large assembly (over 200 parts and 1000 constraints)
When I make a certain modification, there is an update needed.
Is there a macro code which could find WHICH constraint needs to be updated?
Scrolling through 1000+ constraints in the tree is long, and finding the "blacked out" constraint in the assembly is merely impossible!
Thanks in advance





RE: CATIA macro for finding constraint
In a CATScript, copy code bellow. After testing on a small assy (two-three constrains), if I would be in your place, I would modify the code to do the update automatically (otherwise I suppose you will have to kill CATIA).
Option Explicit
Sub CATMain()
' get root product
Dim prdRoot As Product
Set prdRoot = CATIA.ActiveDocument.Product
' get constraints stored in the root product
Dim oConstraints As Constraints
Set oConstraints = prdRoot.Connections("CATIAConstraints")
' loop through all constraints
Dim iConstraint
iConstraint = oConstraints.Count
MsgBox iConstraint
For iConstraint = 1 TO oConstraints.Count
' check if constraint is ok or not
If (oConstraints.Item(iConstraint).Status = catCstStatusOK) Then
MsgBox oConstraints.Item(iConstraint).Name & " OK"
Else
MsgBox oConstraints.Item(iConstraint).Name & " Not_OK"
End If
Next
End Sub
Regards
Fernando
https://picasaweb.google.com/102257836106335725208
RE: CATIA macro for finding constraint
RE: CATIA macro for finding constraint
indocti discant et ament meminisse periti