×
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

Regarding Generating Clash report in CATIA

Regarding Generating Clash report in CATIA

Regarding Generating Clash report in CATIA

(OP)
Hello Everyone,
This code is working perfectly :
Sub Main()

Dim CATIA As INFITF.Application
CATIA = GetObject(, "CATIA.Application")
If CATIA Is Nothing Then
CATIA = CreateObject("CATIA.Application")
End If

Dim cClashes As Clashes
Dim oSelection As Selection
oSelection = CATIA.ActiveDocument.Selection
Dim oProduct As AnyObject
oProduct = oSelection.FindObject("CATIAProduct")
cClashes = oProduct.GetTechnologicalObject("Clashes")
Dim oClash As Clash
oClash = cClashes.AddFromSel()
oClash.ComputationType = CatClashComputationType.catClashComputationTypeBetweenAll
oClash.InterferenceType = CatClashInterferenceType.catClashInterferenceTypeContact
oClash.Compute()
Dim cConflicts As Conflicts
cConflicts = oClash.Conflicts
Dim count As Integer
count = cConflicts.Count
Dim oConflict As Conflict
Dim Produs1 As Product
Dim oNume1 As String
Dim prod1run As Integer
Dim i As Integer
For i = 1 To count
oConflict = cConflicts.Item(i)
Produs1 = oConflict.FirstProduct
oNume1 = Produs1.PartNumber
If (UCase(Left(oNume1, 3)) = "RUN") Then
prod1run = prod1run + 1
End If

If (oConflict.Type = CatConflictType.catConflictTypeClash) Then
If (oConflict.Value <> 0) Then
oConflict.Status = CatConflictStatus.catConflictStatusRelevant
oConflict.Comment = "Automatic filter : penetration less than "
End If
ElseIf (oConflict.Type = CatConflictType.catConflictTypeContact) Then
oConflict.Status = CatConflictStatus.catConflictStatusIrrelevant
oConflict.Comment = "lalalalalala"
End If
Next
Dim iType As CatClashExportType = CatClashExportType.CatClashExportTypeXMLResultOnly
oClash.Export(iType, "c:\\Temp\ClashReport")
End Sub

End Module



I have 3 Queries:
1)For getting Clashes object,I am using oProduct.GetTechnologicalObject("Clashes")..I know that the method GetTechnologicalObject("Clashes") can be used only on the Root Product,Please help me to find the root Product from the Active Document because I dont want to manually select the root product everytime.
2)What if I have a root product consisting of 13-14 parts and I want to know clash report of each Part with other Parts? Then how should I modify my code
3)Once Interference feature is created in the model tree,If you click on that another window gets popup showing the exact Clash analysis of 2 parts..Will it be possible to export this particular window to "3DXML file"?..I Actually want to export each and every parts Clash analysis window to "3DXML files"

Any help would be appreciated

Thank you

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