ANSYS WB: Element Centroid
ANSYS WB: Element Centroid
(OP)
Hi guys,
i have i problem and i cannot find a solution, i hope you can help me.
I have a named selection of solid elements and i would like to export the element id and the location of the centroid. Is it possile?
For named selections of nodes it is sufficient to set Include Node Location in options, but for elements is not possible.
Thank you a lot.
i have i problem and i cannot find a solution, i hope you can help me.
I have a named selection of solid elements and i would like to export the element id and the location of the centroid. Is it possile?
For named selections of nodes it is sufficient to set Include Node Location in options, but for elements is not possible.
Thank you a lot.
RE: ANSYS WB: Element Centroid
paste this code to the console. You can then write the data to a text file.
model = ExtAPI.DataModel.Project.Model
analysis = model.Analyses[0]
meshdata = analysis.MeshData
ns = ExtAPI.DataModel.Tree.FirstActiveObject
element_ids = ns.Location
elements = [meshdata.ElementById(element_id) for element_id in element_ids]
centroids = [element.Centroid for element in elements]
RE: ANSYS WB: Element Centroid
RE: ANSYS WB: Element Centroid
of how to write the ids and centroids to a text file.
CODE --> python
RE: ANSYS WB: Element Centroid
RE: ANSYS WB: Element Centroid
the resulting named selection is nodal.
If you create a new named selection and go to the worksheet you can find that EntityType column has an option "Element Face".
In the criterion column the options are named selection, normal and xyz locations. Unfortunately ID is not an option.
So at least I don't know how to automate this. Can you share a sample of the file?