×
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 Clash Analyze - Problem when loading XML back to Catia

Catia Clash Analyze - Problem when loading XML back to Catia

Catia Clash Analyze - Problem when loading XML back to Catia

(OP)
Hello

I am having problems loading back to Catia a xml containing clash results.

I use the following script to generate the xml:

Sub clashTOxml()
Dim cClashes As Clashes
Dim oClash As Clash
Dim dFilterValue As Double
Dim oConflict As Conflict
Dim Produs1 As Product
Dim oNume1 As String
Dim Produs2 As Product
Dim oNume2 As String
Dim prod1run As Integer
Dim prod2run As Integer

Set cClashes = CATIA.ActiveDocument.Product.GetTechnologicalObject("Clashes")

dFilterValue = 0

Set oClash = cClashes.AddFromSel
oClash.ComputationType = catClashComputationTypeInsideOne
oClash.InterferenceType = catClashInterferenceTypeContact
oClash.Compute

Dim cConflicts As Conflicts
Set cConflicts = oClash.Conflicts

Dim I As Integer
For I = 1 To cConflicts.Count

    Set oConflict = cConflicts.Item(I)

    Set Produs1 = oConflict.FirstProduct
    oNume1 = Produs1.PartNumber
    If (UCase(Left(oNume1, 3)) = "RUN") Then
        prod1run = prod1run + 1
    End If
   
    Set Produs2 = oConflict.SecondProduct
    oNume2 = Produs2.PartNumber
    If (UCase(Left(oNume2, 3)) = "RUN") Then
        prod2run = prod2run + 1
    End If

    If (oConflict.Type = catConflictTypeClash) Then
        If (oConflict.Value <> 0) Then
            oConflict.Status = catConflictStatusRelevant
            oConflict.Comment = "Automatic filter : penetration less than " & dFilterValue
        End If
    ElseIf (oConflict.Type = catConflictTypeContact) Then
        oConflict.Status = catConflictStatusIrrelevant
        oConflict.Comment = "lalalalalala"
    End If
Next

oClash.Export CatClashExportTypeXMLTypeStructureAndClash, "C:\Temp\rezultate_clash"
End Sub

For loading it back to Catia I use this script:

Sub Read()
Dim rClashes As ClashResults
Set rClashes = CATIA.ActiveDocument.Product.GetTechnologicalObject("ClashResults")
Dim rClash As ClashResult
Set rClash = rClashes.AddFromXML("C:\Temp\rezultate_clash.xml", CatClashImportTypeStructureAndClash)
MsgBox "Ok"
End Sub

After loading in the product tree under Applications->Interference I get a Interference Results.1 but it is empty. It does not contains the clashes from the xml file. I have generated a xml file manually from the clashes window but when I have tried to load it back to Catia using this script it was also empty.

RE: Catia Clash Analyze - Problem when loading XML back to Catia

(OP)
I found a solution to the problem. Now I can load the XML back to Catia and see all the clashes in the tree. The problem has a simple solution: Tools->Options->Digital Mockup->DMU Space Analysis->DMU Clash - Process unmark the Federated XML output.

RE: Catia Clash Analyze - Problem when loading XML back to Catia

Hi,

Thanks for sharing the code (and your solution) with us.

I've tried the code in a CATScript and got no xml file (I don't have on all computers vba installed) but it works in catvba with a slide modification.

I got an error (entry point) so I modified your Sub clashTOxml with Sub CATMain . It works with that box marked also but after loading  the xml file , I have to give few escapes keys to be able to do ssomething in CATIA (or run Fit All In command, with the same result).
 

Regards
Fernando
 

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