Ansys Learning Forum › Forums › Discuss Simulation › General Mechanical › Mechanical Scripting: Pressure Import componentwise › Reply To: Mechanical Scripting: Pressure Import componentwise
You should be able to do most of if by studying and modifying the script you attached. You'll need to add two pressure data columns in the External Data, so that its just copying the code a couple times and changing a name.
For the code sent to Mechanical, you'll need this to change the pressure from the default "Normal to" to "Components:
DefineByProp = importedPres.PropertyByName('PROPID_DefineByType')
DefineByProp = 0 Â Â # 0="Components", 2="Normal To"
Then, you'll have another two columns of data, so use a couple more indices in the table:
  for i in range(numfilestoload):
    table[i][0] = "File"+str(i+1)+":"+str(allfiles[i])
    table[i][1] = "File"+str(i+2)+":"+str(allfiles[i+1])
    table[i][2] = "File"+str(i+3)+":"+str(allfiles[i+2])
    table[i][3] = (i+1)*100
This method assumes you have a separate file for each X,Y,Z component of pressure.
Â