Skip to main content
Welcome back to another week and another great Script Tip. This one was presented to us by Mark Lytell, a Staff Engineer 2, Mechanical from Chamberlain Group, LLC. Thanks Mark! “Below is a demonstration on how you can add contact tools to the solution brand for all contacts: Functions
  • Create a contact tool for a single contact containing Pressure, Frictional Stress, Sliding Distance, Penetration and Gap for a list of times
  • Get all nonliner connections and contacts
  • Contact names and IDs:
  • Create contact tool for each contact:
  • Create a contact tool for a single contact containing Pressure, Frictional Stress, Sliding Distance, Penetration and Gap for a list of times

Parameters

contactID : int (the ID of the contact for which to create the tool) lstContID : list of ints (list of contact IDs for all contacts in the model) contName : string (the name of the contact for which the tool is created) dispTimes : list of Quantities (list of analysis times for which to display contact tools)

Returns

Ansys.ACT.Automation.Mechanical.PostContactTool (The newly created post processing contact tool) Add contact tool:
Scope only to single contact ID (These lines are unsupported beta features contact_tool.InternalObject.AddScopedContact(contIDs[130])):
Rename the contact tool:
Create contact Status, Pressure, Frictional Stress, Penetration and Gap for each time in dispTimes
Calling the function
Put all contact tools into a group folder: