General Mechanical

General Mechanical

Topics relate to Mechanical Enterprise, Motion, Additive Print and more

Exporting Laminate Forces for elements in ACP-Post

    • SimonSimon
      Subscriber

      Hi,nnI am trying to export the laminate forces in all elements associated with a given named selection from ACP.nFor 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.nThis 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.nThis is the main loop I use to do so (with Node_Num, Node_x, Node_y and Note_z read from the csv file):nnfor i in range(0,len(Node_Num)) :n    Name = ('SamplingPoint'+'.'+str(i))n    db.models['ACP Model'].create_sampling_point(name=Name)n    db.models.sampling_points[Name].point = (Node_x,Node_y,Node_z)n    db.models.sampling_points[Name].direction =(0,0,1)n    db.models.sampling_points[Name].use_default_reference_directionn    db.models.sampling_points[Name].solution_set = (db.models.solutions,-1)n    db.models.update(objects=[db.models.sampling_points[Name]])n    Lam_Forces.append(db.models.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.nnI have tried to set the element id using :ndb.models.sampling_points[Name].element_id = xxxxxnbut I get a "Cannot Set Attribute" error, so I guess this is a non editable field.nI have also tried to set the modelling ply I want using :ndb.models.sampling_points[Name].plies = xxxxx but similarly this is not an editable field I believe.nnThe last thing I have tried is to simply deactivate the Modelling Plies which I do not want using :ndb.models.modeling_groups[‘Modeling_Group'].plies.active = False.nBut 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.nnI 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

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

    • Govindan Nagappan
      Ansys Employee
      nCan you loop over the elements of an Element Set in ACP directly instead of using element ID and centroid from an ADPL generated text?nWhat element type are you using? Can you check and see if the laminate forces are available for that element in APDL smisc results?n
Viewing 1 reply thread
  • You must be logged in to reply to this topic.