Initial contact information via the contact tool for a particular contact

Erik Kostson
Erik Kostson Member, Employee Posts: 87
First Answer Name Dropper First Anniversary Ansys Employee
edited December 2023 in General Language Questions

How can we extract initial contact information via the contact tool for a particular contact using ACT?

Comments

  • Erik Kostson
    Erik Kostson Member, Employee Posts: 87
    First Answer Name Dropper First Anniversary Ansys Employee
    edited December 2023

    See the code below that does this (exports data to text file - change file dir. as needed)

    solu= ExtAPI.DataModel.Project.Model.Analyses[0].Solution # Solution object
    
    con = solu.AddContactTool()
    
    contact_gap = con.AddGap()
    
    
    
    connection = ExtAPI.DataModel.Project.Model.Connections
    
    cont1g =connection.Children[0]
    cont1=cont1g.Children[0]
    
    con.InternalObject.AddScopedContact(cont1.ObjectId)
    
    #con.InternalObject.RemoveScopedContact(cont1.ObjectId) #remove the perticular contact from the list
    
    
    
    con.EvaluateAllResults()
    
    #export the result to txt file
    
    contact_gap.ExportToTextFile("D:/file2.txt")
    
This discussion has been closed.