Exporting Laminate Forces for elements in ACP-Post


I am trying to export the laminate forces in all elements associated with a given named selection from ACP.

For this I have written a first script in APDL which selects the elements in the name selection and export their ID and centroid location to a csv file.

This csv file is then read in ACP and for each elements I create a sampling point at the centroid location and retrieve the dictionary of laminate forces.

This is the main loop I use to do so (with Node_Num, Node_x, Node_y and Note_z read from the csv file):

for i in range(0,len(Node_Num)) :

    Name = ('SamplingPoint'+'.'+str(i))

    db.models['ACP Model'].create_sampling_point(name=Name)

    db.models['ACP Model'].sampling_points[Name].point = (Node_x[i],Node_y[i],Node_z[i])

    db.models['ACP Model'].sampling_points[Name].direction =(0,0,1)

    db.models['ACP Model'].sampling_points[Name].use_default_reference_direction

    db.models['ACP Model'].sampling_points[Name].solution_set = (db.models['ACP Model'].solutions['Solution 1'],-1)

    db.models['ACP Model'].update(objects=[db.models['ACP Model'].sampling_points[Name]])

    Lam_Forces.append(db.models['ACP Model'].sampling_points[Name].clt_query(query = 'laminate_forces')

Now my problem is that in the places where elements from 2 different parts overlap the wrong element gets selected and I get the results for the wrong ModellingPly.

I have tried to set the element id using :

db.models['ACP Model'].sampling_points[Name].element_id = xxxxx

but I get a “Cannot Set Attribute” error, so I guess this is a non editable field.

I have also tried to set the modelling ply I want using :

db.models['ACP Model'].sampling_points[Name].plies = xxxxx but similarly this is not an editable field I believe.

The last thing I have tried is to simply deactivate the Modelling Plies which I do not want using :

db.models['ACP Model'].modeling_groups[‘Modeling_Group'].plies['ModelingPly’].active = False.

But in this case some sampling points simply remain empty (i.e the coordinates are correct but no ModellingPly is selected and no laminate forces are exported.

I have seen that there exists a command model.select_elements which would let me select all elements attached to a ModellingPly but I am not sure how I could use it in any useful way.

Thank you 

PS: @gnagapp from other posts I have seen, I believe this might be your area of expertise !

Sign In or Register to comment.