×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

CATIA macro for finding constraint

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


RE: CATIA macro for finding constraint

Hi,

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

(OP)
Amazing! Thank you!

RE: CATIA macro for finding constraint

in assembly design, Analyze menu, use Updates...

Eric N.
indocti discant et ament meminisse periti

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources